Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Improved exceptions handling within the Container\ApplicationFactory #197

Merged

Conversation

nikolaposa
Copy link
Contributor

This PR addresses issue #196.

/cc @Maks3w

Fix #196

@Maks3w
Copy link
Member

Maks3w commented Nov 23, 2015

Oops check the CS rules

@nikolaposa
Copy link
Contributor Author

Have no idea why is that strange code formatting issue randomly happening, but after another file modification/commit, everything seems fine.

@@ -151,7 +152,12 @@ public function __invoke(ContainerInterface $container)
*/
private function injectRoutes(Application $app, ContainerInterface $container)
{
$config = $container->has('config') ? $container->get('config') : [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case is legitimate. Next isset provide a fallback. Revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, you're right, I'll revert it after you finish a review.

@Maks3w
Copy link
Member

Maks3w commented Nov 23, 2015

I'll review this again after to be rebased on top of #195.

@Maks3w Maks3w added this to the 1.0.0rc3 milestone Nov 23, 2015
@nikolaposa
Copy link
Contributor Author

Agreed.

->get('Zend\Expressive\Router\RouterInterface')
->will(function () use ($router) {
return $router->reveal();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikolaposa Can you please update these to use ZendTest\Expressive\ContainerTrait, now that #194/#195 have been merged? Doing so will cut down on a lot of noise, making it easier to see what's being tested.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weierophinney Sure, I've already discussed with @Maks3w how we should handle this.

$this->injectServiceInContainer($this->container, 'config', $config);

$this->setExpectedException(
'Zend\Expressive\Container\Exception\InvalidArgumentException',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import and use class constant

@Maks3w
Copy link
Member

Maks3w commented Nov 24, 2015

Please apply the last comment, and squash the commits.

Thanks for your contribution

@nikolaposa nikolaposa force-pushed the app-factory-exceptions branch from ca1483d to c472d15 Compare November 24, 2015 20:40
@nikolaposa
Copy link
Contributor Author

Done. I guess this is it.

@Maks3w
Copy link
Member

Maks3w commented Nov 24, 2015

@weierophinney This is good for me.

@weierophinney weierophinney merged commit c472d15 into zendframework:master Nov 24, 2015
weierophinney added a commit that referenced this pull request Nov 24, 2015
Improved exceptions handling within the Container\ApplicationFactory
weierophinney added a commit that referenced this pull request Nov 24, 2015
weierophinney added a commit that referenced this pull request Nov 24, 2015
weierophinney added a commit that referenced this pull request Nov 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants