private function getMethodInstances($class, $methodName = '__construct')
    {
        if (is_object($class)) {
            $reflectClass = new ReflectionClass(get_class($class));
        } else {
            $reflectClass = new ReflectionClass($class);
        }

        $instances = [];
        $hasDI = false;

        if ($reflectClass->hasMethod($methodName)) {
            $reflectMethod = $reflectClass->getMethod($methodName);

            $params = $reflectMethod->getParameters();

            if (count($params) > 0) {
                foreach ($params as $param) {
                    $paramClass = $param->getClass();
                    if ($paramClass) {
                        $paramClassName = $paramClass->getName();
                        array_push($instances, Container::getByClassName($paramClassName));
                        $hasDI = true;
                    } elseif ($hasDI) {
                        throw new NotFoundException('Dependency Injection cannot work with normal params');
                    }
                }
            }
        }

        if ($hasDI) {
            return $instances;
        }

        return false;
    }
private function getMethodInstances($class, $methodName = '__construct')
    {
        if (is_object($class)) {
            $reflectClass = new ReflectionClass(get_class($class));
        } else {
            $reflectClass = new ReflectionClass($class);
        }

        $instances = [];
        $hasDI = false;

        if ($reflectClass->hasMethod($methodName)) {
            $reflectMethod = $reflectClass->getMethod($methodName);

            $params = $reflectMethod->getParameters();

            if (count($params) > 0) {
                foreach ($params as $param) {
                    $paramClass = $param->getClass();
                    if ($paramClass) {
                        $paramClassName = $paramClass->getName();
                        array_push($instances, Container::getByClassName($paramClassName));
                        $hasDI = true;
                    } elseif ($hasDI) {
                        throw new NotFoundException('Dependency Injection cannot work with normal params');
                    }
                }
            }
        }

        if ($hasDI) {
            return $instances;
        }

        return false;
    }
private function getMethodInstances ( $ class , $ methodName = '__construct' ) { if ( is_object ( $ class ) ) { $ reflectClass = new ReflectionClass ( get_class ( $ class ) ) ; } else { $ reflectClass = new ReflectionClass ( $ class ) ; } $ instances = [ ] ; $ hasDI = false ; if ( $ reflectClass -> hasMethod ( $ methodName ) ) { $ reflectMethod = $ reflectClass -> getMethod ( $ methodName ) ; $ params = $ reflectMethod -> getParameters ( ) ; if ( count ( $ params ) > 0 ) { foreach ( $ params as $ param ) { $ paramClass = $ param -> getClass ( ) ; if ( $ paramClass ) { $ paramClassName = $ paramClass -> getName ( ) ; array_push ( $ instances , Container :: getByClassName ( $ paramClassName ) ) ; $ hasDI = true ; } elseif ( $ hasDI ) { throw new NotFoundException ( 'Dependency Injection cannot work with normal params' ) ; } } } } if ( $ hasDI ) { return $ instances ; } return false ; }
Returns the request params instances

@param  mixed  $class
@param  string $methodName
@return mixed

@throws \Kotori\Exception\NotFoundException
Returns the request params instances