public function enableInjecterDetection(array $blacklist = array(), $version = PHP_VERSION)
    {
        if (version_compare($version, '5.4.0') <= 0) {

            throw new RunTimeException('This feature requires PHP 5.4 or higher');

        }

        if ($this->detector === null) {
            $this->setDetector(new SimpleDetector);
        }

        $blacklist = $this->buildDimdBlacklist($blacklist);
        $this->dimbBlacklist = $blacklist;

        $this->onResolving(function ($object) use ($blacklist) {
            $class = get_class($object);

            $reflection = new ReflectionClass($class);

            $methods = $reflection->getMethods();

            /**
             * Cycle thru all methods. Filtering in the next control-construct
             */
            foreach ($methods as $method) {

                /**
                 * This is not a complex detection, but most injecter methods are starting with a set[...]
                 */
                if ($this->detector->detect($method)) {
                    
                    // Just check if the method is in the blacklist
                    if (in_array($method->name, $blacklist) || (isset($blacklist['_CLASSES_'][$class]) && in_array($method->name, $blacklist['_CLASSES_'][$class]))) {

                        continue;

                    }

                    try {
                        
                        $dependencies = $this->getDependencies($method->getParameters());

                        /**
                         * We keep this line in the try/catch block as well in order to skip it if an exception is thrown,
                         * otherwise we would get native PHP errors.. Nasty.
                         */
                        call_user_func_array(array($object, $method->name), $dependencies);

                    /**
                     * If an ParameterResolveException is thrown it hit a non class injector method and we simply ignore these
                     * We do NOT catch ResolveExceptions since a not found class is something we' re not responsible for.
                     */
                    } catch (ParameterResolveException $e) {
                    }
                }
            }
            
            return $object;

        }, -255);
    }
public function enableInjecterDetection(array $blacklist = array(), $version = PHP_VERSION)
    {
        if (version_compare($version, '5.4.0') <= 0) {

            throw new RunTimeException('This feature requires PHP 5.4 or higher');

        }

        if ($this->detector === null) {
            $this->setDetector(new SimpleDetector);
        }

        $blacklist = $this->buildDimdBlacklist($blacklist);
        $this->dimbBlacklist = $blacklist;

        $this->onResolving(function ($object) use ($blacklist) {
            $class = get_class($object);

            $reflection = new ReflectionClass($class);

            $methods = $reflection->getMethods();

            /**
             * Cycle thru all methods. Filtering in the next control-construct
             */
            foreach ($methods as $method) {

                /**
                 * This is not a complex detection, but most injecter methods are starting with a set[...]
                 */
                if ($this->detector->detect($method)) {
                    
                    // Just check if the method is in the blacklist
                    if (in_array($method->name, $blacklist) || (isset($blacklist['_CLASSES_'][$class]) && in_array($method->name, $blacklist['_CLASSES_'][$class]))) {

                        continue;

                    }

                    try {
                        
                        $dependencies = $this->getDependencies($method->getParameters());

                        /**
                         * We keep this line in the try/catch block as well in order to skip it if an exception is thrown,
                         * otherwise we would get native PHP errors.. Nasty.
                         */
                        call_user_func_array(array($object, $method->name), $dependencies);

                    /**
                     * If an ParameterResolveException is thrown it hit a non class injector method and we simply ignore these
                     * We do NOT catch ResolveExceptions since a not found class is something we' re not responsible for.
                     */
                    } catch (ParameterResolveException $e) {
                    }
                }
            }
            
            return $object;

        }, -255);
    }
public function enableInjecterDetection ( array $ blacklist = array ( ) , $ version = PHP_VERSION ) { if ( version_compare ( $ version , '5.4.0' ) <= 0 ) { throw new RunTimeException ( 'This feature requires PHP 5.4 or higher' ) ; } if ( $ this -> detector === null ) { $ this -> setDetector ( new SimpleDetector ) ; } $ blacklist = $ this -> buildDimdBlacklist ( $ blacklist ) ; $ this -> dimbBlacklist = $ blacklist ; $ this -> onResolving ( function ( $ object ) use ( $ blacklist ) { $ class = get_class ( $ object ) ; $ reflection = new ReflectionClass ( $ class ) ; $ methods = $ reflection -> getMethods ( ) ; /**
             * Cycle thru all methods. Filtering in the next control-construct
             */ foreach ( $ methods as $ method ) { /**
                 * This is not a complex detection, but most injecter methods are starting with a set[...]
                 */ if ( $ this -> detector -> detect ( $ method ) ) { // Just check if the method is in the blacklist if ( in_array ( $ method -> name , $ blacklist ) || ( isset ( $ blacklist [ '_CLASSES_' ] [ $ class ] ) && in_array ( $ method -> name , $ blacklist [ '_CLASSES_' ] [ $ class ] ) ) ) { continue ; } try { $ dependencies = $ this -> getDependencies ( $ method -> getParameters ( ) ) ; /**
                         * We keep this line in the try/catch block as well in order to skip it if an exception is thrown,
                         * otherwise we would get native PHP errors.. Nasty.
                         */ call_user_func_array ( array ( $ object , $ method -> name ) , $ dependencies ) ; /**
                     * If an ParameterResolveException is thrown it hit a non class injector method and we simply ignore these
                     * We do NOT catch ResolveExceptions since a not found class is something we' re not responsible for.
                     */ } catch ( ParameterResolveException $ e ) { } } } return $ object ; } , - 255 ) ; }
Enable the powerful injector method detection.

Example blacklist array:
[
'setString',
'setArray',
'_CLASSES_' => [
SomeClass' => [
'setMailer'
]
]

]

Strings in the main array are consired to be global and are ignored everytime.
The class specific blacklist is only checked if the object is an instance of this class

If the blacklist is empty it will try to recover the previous used.

<strong>This feature requires PHP 5.4 or higher</strong>

@param  array  $blacklist A blacklist of method names
@param  string $version   The current PHP_VERSION, default is the constant. This argument can be ignored! (used for unit-tests only)

@throws \DaGardner\DaContainer\Exceptions\ResolveException
@throws \RunTimeException (if PHP version is below 5.4.0)
Enable the powerful injector method detection .