Fix Application::run() return values #4849

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@weierophinney
Member

weierophinney commented Jul 18, 2013

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.
[#4831] Fix run() return values
- 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

This comment has been minimized.

Show comment
Hide comment
@Maks3w

Maks3w Jul 18, 2013

Member

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

Member

Maks3w commented Jul 18, 2013

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

@weierophinney

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Jul 18, 2013

Member

@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.

Member

weierophinney commented Jul 18, 2013

@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

This comment has been minimized.

Show comment
Hide comment
@Maks3w

This comment has been minimized.

Show comment
Hide comment
@Maks3w

Maks3w Jul 19, 2013

Member

@reenl This will be released with 2.3

Member

Maks3w commented Jul 19, 2013

@reenl This will be released with 2.3

@reenl

This comment has been minimized.

Show comment
Hide comment
@reenl

reenl 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>

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

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Jul 19, 2013

Member

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

Member

weierophinney commented Jul 19, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment