Returns the request params instances

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

@throws \Kotori\Exception\NotFoundException
189509
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;
    }
1115378
private function getService($class)
    {
        if (!array_key_exists($class, $this->services)) {
            $this->services[$class] = new $class($this->getClient(), $this->getLogger());
        }

        return $this->services[$class];
    }
1324764
public static function getReturnTypes($className, $methodName)
	{
		$methodName = Method::from($className, $methodName);
		list($types) = preg_split('~\s~', $methodName->getAnnotation('return'), 2);
		return explode('|', $types);
	}
514480
public static function getInstance(): Request
    {
        if (self::$instance === null) {
            $calledClass    = get_called_class(); //Autorize extends this class
            self::$instance = new $calledClass;
        }

        return self::$instance;
    }
329239
public function getMethod($classname, $method)
    {
        return $this->hasMethod($classname, $method)
            ? $this->methods[$classname . '::' . $method]
            : [];
    }
425064
public function getMethod($class, $method, $extraMappings = []) {
		if (isset($this->aliases[$class])) {
			$class = $this->aliases[$class];
		}

		return [
			$this->getSingleton($class),
			$this->resolveArgs($class, $method, " when resolving method $class::$method", $extraMappings)
		];
	}
767326
public static function getClassParameters(string $class, bool $toArray = false): array
    {
        if (!\class_exists($class)) {
            throw new \InvalidArgumentException("Class not exists: {$class} (autoloading failed)");
        }

        $reflection = new \ReflectionClass($class);

        if (!$reflection->isInstantiable()) {
            throw new \InvalidArgumentException("Unable to create instance of abstract class: {$class}");
        }

        $params = $reflection->getConstructor()->getParameters();

        if ($params === []) {
            return [];
        }

        if (!$toArray) {
            return $params;
        }

        return static::reflectionParameterToArray($params);
    }
822184
static public function instance($class,$method='') {
        $identify   =   $class.$method;
        if(!isset(self::$_instance[$identify])) {
            if(class_exists($class)){
                $o = new $class();
                if(!empty($method) && method_exists($o,$method))
                    self::$_instance[$identify] = call_user_func(array(&$o, $method));
                else
                    self::$_instance[$identify] = $o;
            }
            else
                self::halt(L('_CLASS_NOT_EXIST_').':'.$class);
        }
        return self::$_instance[$identify];
    }
710873
public static Method getMethod(final Class cls, final String methodName) {
		return getMethod(cls, methodName, false);
	}
537437
static function getAnnotation($name, $class, $method = NULL, $nullable = TRUE)
	{
		try {
			NULL === $method or $annotation = self::getMethodAnnotation($method, $name, $class);
			isset($annotation) or $annotation = self::getClassAnnotation($class, $name);
		} catch (ReflectionException $e) {
			$annotation = NULL;
		}

		return !$nullable && NULL === $annotation
			? self::annotationClass($name)
			: $annotation;
	}
483029
public function getAction(Request $request, $id, $class)
    {
        $query = $request->query->all();
        $object = $this->find($class, $id);

        $options = $this->options['get'];

        if (isset($query['options'])) {
            $options = $query['options'];
        }

        return $object ?
            new JsonResponse(
                $this->serializer->serialize($object, $options)
            ) :
            new JsonResponse("No object found for id {$id} of class {$class}", 404);
    }
628750
protected function getMethodInstance(&$object, $methodName)
    {
        $method = new ReflectionMethod(get_class($object), $methodName);
        $method->setAccessible(true);

        return $method;
    }
545121
public function getApi($class, $object = NULL)
    {
        $absoluteClass = "\\OntraportAPI\\" . $class;

        // For custom objects
        if ($object)
        {
            // Generate a unique name so that wrong object id is not stored with instantiated class
            $class = $class . "." . $object;
            if (!array_key_exists($class, $this->_apiInstances))
            {
                $this->_apiInstances[$class] = new $absoluteClass($this, $object);
            }
        }

        else
        {
            if (!array_key_exists($class, $this->_apiInstances))
            {
                $this->_apiInstances[$class] = new $absoluteClass($this);
            }
        }

        return $this->_apiInstances[$class];
    }
1051485
private function parseMethodWithoutAnnotation(string $className, string $methodName)
    {
        $parser = new MethodWithoutAnnotationParser($this->annotationResource);
        $parser->parser($className, null, "", $methodName);
    }
837292
function (methodName) {
            var params = this.getParameters(methodName),
                ret;
            params.forEach(function (param) {
                if (param && (param.envelope === 'JSON' ||
                        param.envelope === 'ENTITY')) {
                    ret = param;
                }
            });
            return ret;
        }
930275
private function getBindParams(string $className, string $methodName): array
    {
        $reflectClass = new \ReflectionClass($className);
        $reflectMethod = $reflectClass->getMethod($methodName);
        $reflectParams = $reflectMethod->getParameters();

        // binding params
        $bindParams = [];
        foreach ($reflectParams as $key => $reflectParam) {
            $reflectType = $reflectParam->getType();

            // undefined type of the param
            if ($reflectType === null) {
                $bindParams[$key] = null;
                continue;
            }

            /**
             * defined type of the param
             * @notice \ReflectType::getName() is not supported in PHP 7.0, that is why use __toString()
             */
            $type = $reflectType->__toString();
            if ($type === Output::class) {
                $bindParams[$key] = \output();
            } elseif ($type === Input::class) {
                $bindParams[$key] = \input();
            } else {
                $bindParams[$key] = null;
            }
        }

        return $bindParams;
    }
1328490
protected function findOrCreateMethod(Class_ $class, $name)
    {
        $foundMethods = array_filter(
            $class->getMethods(),
            function (ClassMethod $method) use ($name) {
                return $name === $method->name;
            }
        );

        $method = reset($foundMethods);

        if (!$method) {
            $class->stmts[] = $method = new ClassMethod($name);
        }

        return $method;
    }