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

Fix Application::run() return values #4849

Conversation

weierophinney
Copy link
Member

This PR addresses concerns raised in #4831:

  • run() now always returns an Application instance; its docblock has been updated accordingly as well.
  • If an event returns a response object, it is pushed into the Application instance.

- Always return the application instance. (and fix docblock to indicate this)
- If an alternate response object is returned by an event, give it to
  the application instance.
@Maks3w
Copy link
Member

Maks3w commented Jul 18, 2013

Since introduces a BC Break Should this be scheudle for 2.3?

@weierophinney
Copy link
Member Author

@Maks3w We actually changed Application for 2.1 to return the Application instance -- but missed those few returns that occur due to short-circuiting. This just makes it consistent finally.

@ghost ghost assigned Maks3w Jul 18, 2013
Maks3w added a commit that referenced this pull request Jul 18, 2013
@Maks3w Maks3w closed this Jul 18, 2013
@reenl
Copy link

reenl commented Jul 18, 2013

@Maks3w
Copy link
Member

Maks3w commented Jul 19, 2013

@reenl This will be released with 2.3

@reenl
Copy link

reenl commented Jul 19, 2013

Docs:

$response = $application->run();
$response->send();

2.2.1:
https://github.com/zendframework/zf2/blob/release-2.2.1/library/Zend/Mvc/Application.php#L324
return $this; // Zend\Mvc\Application

In this PR:
https://github.com/weierophinney/zf2/blob/5c70772642323e8d2f2665d5bb921095568e65ee/library/Zend/Mvc/Application.php#L38

 * <code>
 * $services = new Zend\ServiceManager\ServiceManager($servicesConfig);
 * $app      = new Application($appConfig, $services);
 * $app->bootstrap();
 * $response = $app->run();
 * $response->send();
 * </code>

@weierophinney
Copy link
Member Author

@reenl Those docs are generated from a tag. When the new code is released, new docs will be generated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants