src/AbstractEditableDiscovery.php
protected function initializeBinding(Binding $binding)
    {
        $binding->initialize($this->getBindingType($binding->getTypeName()));

        $bindingClass = get_class($binding);

        if (!isset($this->initializersByBindingClass[$bindingClass])) {
            $this->initializersByBindingClass[$bindingClass] = array();

            // Find out which initializers accept the binding
            foreach ($this->initializers as $initializer) {
                if ($initializer->acceptsBinding($bindingClass)) {
                    $this->initializersByBindingClass[$bindingClass][] = $initializer;
                }
            }
        }

        // Apply all initializers that we found
        foreach ($this->initializersByBindingClass[$bindingClass] as $initializer) {
            $initializer->initializeBinding($binding);
        }
    }
protected function initializeBinding(Binding $binding)
    {
        $binding->initialize($this->getBindingType($binding->getTypeName()));

        $bindingClass = get_class($binding);

        if (!isset($this->initializersByBindingClass[$bindingClass])) {
            $this->initializersByBindingClass[$bindingClass] = array();

            // Find out which initializers accept the binding
            foreach ($this->initializers as $initializer) {
                if ($initializer->acceptsBinding($bindingClass)) {
                    $this->initializersByBindingClass[$bindingClass][] = $initializer;
                }
            }
        }

        // Apply all initializers that we found
        foreach ($this->initializersByBindingClass[$bindingClass] as $initializer) {
            $initializer->initializeBinding($binding);
        }
    }
protected function initializeBinding ( Binding $ binding ) { $ binding -> initialize ( $ this -> getBindingType ( $ binding -> getTypeName ( ) ) ) ; $ bindingClass = get_class ( $ binding ) ; if ( ! isset ( $ this -> initializersByBindingClass [ $ bindingClass ] ) ) { $ this -> initializersByBindingClass [ $ bindingClass ] = array ( ) ; // Find out which initializers accept the binding foreach ( $ this -> initializers as $ initializer ) { if ( $ initializer -> acceptsBinding ( $ bindingClass ) ) { $ this -> initializersByBindingClass [ $ bindingClass ] [ ] = $ initializer ; } } } // Apply all initializers that we found foreach ( $ this -> initializersByBindingClass [ $ bindingClass ] as $ initializer ) { $ initializer -> initializeBinding ( $ binding ) ; } }
Initializes a binding.

@param Binding $binding The binding to initialize.

@throws BindingNotAcceptedException If the loaded type does not accept
the binding.
Initializes a binding .