Permalink
Browse files

Added new 'resolvable' and 'isAlias' methods to the container.

  • Loading branch information...
taylorotwell committed Oct 31, 2013
1 parent 9974593 commit 8f240f83785e1aebd0d5abf848d8425786a9ba86
Showing with 24 additions and 1 deletion.
  1. +22 −0 src/Illuminate/Container/Container.php
  2. +2 −1 src/Illuminate/Foundation/changes.json
@@ -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},

0 comments on commit 8f240f8

Please sign in to comment.