public function addInstances(array $instances): self
    {
        foreach ($instances as $_key => $_instance) {
            if (is_string($_key)) {
                $_class_name = ltrim($_key, '\\');
            } else {
                $_class_name = get_class($_instance);
            }
            $_class_key                   = strtolower($_class_name);
            $this->instances[$_class_key] = $_instance; // Cache the instance.
        } // unset($_key, $_instance, $_class_name, $_class_key);

        return $this;
    }
public function addInstances(array $instances): self
    {
        foreach ($instances as $_key => $_instance) {
            if (is_string($_key)) {
                $_class_name = ltrim($_key, '\\');
            } else {
                $_class_name = get_class($_instance);
            }
            $_class_key                   = strtolower($_class_name);
            $this->instances[$_class_key] = $_instance; // Cache the instance.
        } // unset($_key, $_instance, $_class_name, $_class_key);

        return $this;
    }
public function addInstances ( array $ instances ) : self { foreach ( $ instances as $ _key => $ _instance ) { if ( is_string ( $ _key ) ) { $ _class_name = ltrim ( $ _key , '\\' ) ; } else { $ _class_name = get_class ( $ _instance ) ; } $ _class_key = strtolower ( $ _class_name ) ; $ this -> instances [ $ _class_key ] = $ _instance ; // Cache the instance. } // unset($_key, $_instance, $_class_name, $_class_key); return $ this ; }
Add new instances.

@since 151115 Initial release.

@param array $instances Class instances.

@return self Reference; for chaining.
Add new instances .