Skip to content

Commit

Permalink
[8.x] Update type defs for $abstract (#35423)
Browse files Browse the repository at this point in the history
* Update type defs for $alias

`$alias` can also be a Closure or invocable. This change will make PHPStan complain less.

* Fixed cs

Co-authored-by: Johan Rosenson <10432296+johanrosenson@users.noreply.github.com>

Co-authored-by: Graham Campbell <GrahamCampbell@users.noreply.github.com>
Co-authored-by: Johan Rosenson <10432296+johanrosenson@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 1, 2020
1 parent 24636f0 commit 58aeab2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ public function factory($abstract)
/**
* An alias function name for make().
*
* @param string $abstract
* @param string|callable $abstract
* @param array $parameters
* @return mixed
*
Expand All @@ -640,7 +640,7 @@ public function makeWith($abstract, array $parameters = [])
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param string|callable $abstract
* @param array $parameters
* @return mixed
*
Expand Down Expand Up @@ -670,7 +670,7 @@ public function get($id)
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param string|callable $abstract
* @param array $parameters
* @param bool $raiseEvents
* @return mixed
Expand Down Expand Up @@ -745,7 +745,7 @@ protected function resolve($abstract, $parameters = [], $raiseEvents = true)
/**
* Get the concrete type for a given abstract.
*
* @param string $abstract
* @param string|callable $abstract
* @return mixed
*/
protected function getConcrete($abstract)
Expand All @@ -763,7 +763,7 @@ protected function getConcrete($abstract)
/**
* Get the contextual concrete binding for the given abstract.
*
* @param string $abstract
* @param string|callable $abstract
* @return \Closure|string|array|null
*/
protected function getContextualConcrete($abstract)
Expand All @@ -789,7 +789,7 @@ protected function getContextualConcrete($abstract)
/**
* Find the concrete binding for the given abstract in the contextual binding array.
*
* @param string $abstract
* @param string|callable $abstract
* @return \Closure|string|null
*/
protected function findInContextualBindings($abstract)
Expand Down

0 comments on commit 58aeab2

Please sign in to comment.