这个可以有


namespace Illuminate\Container;

use Closure;
use ArrayAccess;
use ReflectionClass;
use ReflectionMethod;
use ReflectionFunction;
use ReflectionParameter;
use InvalidArgumentException;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Container\Container as ContainerContract;
// namespace
class Container implements ArrayAccess, ContainerContract
{// Container implements ArrayAccess, ContainerContract
    /** * The current globally available container (if any). * * @var static */
    protected static $instance;
    // The current globally available container (if any);

    /** * An array of the types that have been resolved. * * @var array */
    protected $resolved = [];// a resolved a array types
    // An array of the types that have been resolved.

    /** * The container's bindings. * * @var array */
    protected $bindings = [];// The container's bindings.
    // a array use by bindings types

    /** * The container's shared instances. * * @var array */
    protected $instances = [];
    // The container's shared instances.
    /** * The registered type aliases. * * @var array */
    protected $aliases = [];// The registered type aliases.

    /** * The extension closures for services. * * @var array */
    protected $extenders = [];// The extension closures for services.

    /** * All of the registered tags. * * @var array */
    protected $tags = [];// All of the registered tags.

    /** * The stack of concretions currently being built. * * @var array */
    protected $buildStack = [];// The stack of concretions currently being built.


    /** * The contextual binding map. * * @var array */
    public $contextual = [];//The contextual binding map.

    /** * All of the registered rebound callbacks. * * @var array */
    protected $reboundCallbacks = [];// All of the registered rebound callbacks.

    /** * All of the global resolving callbacks. * * @var array */
    protected $globalResolvingCallbacks = [];// All of the global callbacks.

    /** * All of the global after resolving callbacks. * * @var array */
    protected $globalAfterResolvingCallbacks = [];
// All of the global after resolving callbacks.
    /** * All of the after resolving callbacks by class type. * * @var array */
    protected $resolvingCallbacks = [];
// All of the after resolving callbacks by class type.
    /** * All of the after resolving callbacks by class type. * * @var array */
    protected $afterResolvingCallbacks = [];
//All of the after resolving callbacks by class type.
    /** * Define a contextual binding. * * @param string $concrete * @return \Illuminate\Contracts\Container\ContextualBindingBuilder */
    public function when($concrete)
    {
        $concrete = $this->normalize($concrete);// get a normal ize()

        return new ContextualBindingBuilder($this, $concrete);// return a function
    }// Define a contextual binding

你可能感兴趣的:(这个可以有)