Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Added new 'resolvable' and 'isAlias' methods to the container.
- Loading branch information
|
@@ -58,6 +58,17 @@ class Container implements ArrayAccess { |
|
|
*/ |
|
|
protected $globalResolvingCallbacks = array(); |
|
|
|
|
|
/** |
|
|
* Determine if a given string is resolvable. |
|
|
* |
|
|
* @param string $abstract |
|
|
* @return bool |
|
|
*/ |
|
|
protected function resolvable($abstract) |
|
|
{ |
|
|
return $this->bound($abstract) || $this->isAlias($abstract); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Determine if the given abstract type has been bound. |
|
|
* |
|
@@ -69,6 +80,17 @@ public function bound($abstract) |
|
|
return isset($this[$abstract]) || isset($this->instances[$abstract]); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Determine if a given string is an alias. |
|
|
* |
|
|
* @param string $name |
|
|
* @return bool |
|
|
*/ |
|
|
public function isAlias($name) |
|
|
{ |
|
|
return isset($this->aliases[$name]); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Register a binding with the container. |
|
|
* |
|
|
|
@@ -35,7 +35,8 @@ |
|
|
{"message": "Cloned Eloquent query builders now clone the underlying query builder.", "backport": null}, |
|
|
{"message": "Allow for passing of custom attributes into Validator::make as fourth parameter.", "backport": null}, |
|
|
{"message": "Allow comma delimited list of queues to be passed to queue:listen / queue:work to implement queue priority.", "backport": null}, |
|
|
{"message": "When new bindings are added to container, old aliases bound to that key will now be dropped.", "backport": null} |
|
|
{"message": "When new bindings are added to container, old aliases bound to that key will now be dropped.", "backport": null}, |
|
|
{"message": "Added new 'resolvable' and 'isAlias' methods to the container.", "backport": null} |
|
|
], |
|
|
"4.0.x": [ |
|
|
{"message": "Added implode method to query builder and Collection class.", "backport": null}, |
|
|