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

Commit

Permalink
Added second argument to Container::has callas in order to make the S…
Browse files Browse the repository at this point in the history
…erviceManager to include abstract factories
  • Loading branch information
acelaya committed Oct 13, 2015
1 parent c2f73c1 commit 117b219
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,14 @@ public function pipe($path, $middleware = null)
{
// Lazy-load middleware from the container when possible
$container = $this->container;
if (null === $middleware && is_string($path) && $container && $container->has($path)) {
if (null === $middleware && is_string($path) && $container && $container->has($path, true)) {
$middleware = $this->marshalLazyMiddlewareService($path, $container);
$path = '/';
} elseif (is_string($middleware) && ! is_callable($middleware) && $container && $container->has($middleware)) {
} elseif (is_string($middleware)
&& ! is_callable($middleware)
&& $container
&& $container->has($middleware, true)
) {
$middleware = $this->marshalLazyMiddlewareService($middleware, $container);
} elseif (null === $middleware && is_callable($path)) {
$middleware = $path;
Expand Down Expand Up @@ -259,10 +263,14 @@ public function pipeErrorHandler($path, $middleware = null)
{
// Lazy-load middleware from the container
$container = $this->container;
if (null === $middleware && is_string($path) && $container && $container->has($path)) {
if (null === $middleware && is_string($path) && $container && $container->has($path, true)) {
$middleware = $this->marshalLazyErrorMiddlewareService($path, $container);
$path = '/';
} elseif (is_string($middleware) && ! is_callable($middleware) && $container && $container->has($middleware)) {
} elseif (is_string($middleware)
&& ! is_callable($middleware)
&& $container
&& $container->has($middleware, true)
) {
$middleware = $this->marshalLazyErrorMiddlewareService($middleware, $container);
} elseif (null === $middleware && is_callable($path)) {
$middleware = $path;
Expand Down Expand Up @@ -532,7 +540,7 @@ private function checkForDuplicateRoute($path, $methods = null)
private function marshalMiddlewareFromContainer($middleware)
{
$container = $this->container;
if (! $container || ! $container->has($middleware)) {
if (! $container || ! $container->has($middleware, true)) {
return $middleware;
}

Expand Down

0 comments on commit 117b219

Please sign in to comment.