Retrieves a series of ReflectionParameter objects for the static 'create' method of the given
tag handler class name.


@return \ReflectionParameter[]
421203
private function fetchParametersForHandlerFactoryMethod(string $handlerClassName): array
    {
        if (! isset($this->tagHandlerParameterCache[$handlerClassName])) {
            $methodReflection = new \ReflectionMethod($handlerClassName, 'create');
            $this->tagHandlerParameterCache[$handlerClassName] = $methodReflection->getParameters();
        }

        return $this->tagHandlerParameterCache[$handlerClassName];
    }
817443
protected function _reflectionCache()
    {
        $class = get_class($this);
        if (isset(self::$_reflectionCache[$class])) {
            return self::$_reflectionCache[$class];
        }

        $events = $this->implementedEvents();
        $eventMethods = [];
        foreach ($events as $e => $binding) {
            if (is_array($binding) && isset($binding['callable'])) {
                /* @var string $callable */
                $callable = $binding['callable'];
                $binding = $callable;
            }
            $eventMethods[$binding] = true;
        }

        $baseClass = 'Cake\ORM\Behavior';
        if (isset(self::$_reflectionCache[$baseClass])) {
            $baseMethods = self::$_reflectionCache[$baseClass];
        } else {
            $baseMethods = get_class_methods($baseClass);
            self::$_reflectionCache[$baseClass] = $baseMethods;
        }

        $return = [
            'finders' => [],
            'methods' => []
        ];

        $reflection = new ReflectionClass($class);

        foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
            $methodName = $method->getName();
            if (in_array($methodName, $baseMethods) ||
                isset($eventMethods[$methodName])
            ) {
                continue;
            }

            if (substr($methodName, 0, 4) === 'find') {
                $return['finders'][lcfirst(substr($methodName, 4))] = $methodName;
            } else {
                $return['methods'][$methodName] = $methodName;
            }
        }

        return self::$_reflectionCache[$class] = $return;
    }
1137699
public static function getCallableParameters(callable $callback, bool $toArray = false): array
    {
        $params = self::createFromCallable($callback)->getParameters();

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

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

        return static::reflectionParameterToArray($params);
    }
778619
public function getConstructorParameters()
    {
        $parameters = new BeanParameterCollection();

        if (($ctor = $this->getClass()->getConstructor()) !== null) {

            foreach ($ctor->getParameters() as $param) {
                if ($this->hasProperty($param->getName()) === true) {
                    $parameters[] = new BeanParameter($this->getClass()->getName(), '__construct', $param->getName());
                }
            }
        }

        return $parameters;
    }
600531
public static function getConstants() : array
    {
        if (self::$constCacheArray == null) {
            self::$constCacheArray = [];
        }
        $calledClass = get_called_class();
        if (!array_key_exists($calledClass, self::$constCacheArray)) {
            $reflect = new ReflectionClass($calledClass);
            self::$constCacheArray[$calledClass] = $reflect->getConstants();
        }
        return self::$constCacheArray[$calledClass];
    }
801519
public function getTags()
    {
        $tags = [];
        $this->caller->execute(TagCommand::getInstance($this)->listTags());
        foreach ($this->caller->getOutputLines() as $tagString) {
            if ($tagString != '') {
                $tags[] = new Tag($this, trim($tagString));
            }
        }

        return $tags;
    }
69998
public static function getConstList() : array
    {
        if (static::$constList === null) {
            $reflection        = new ReflectionClass(get_called_class());
            static::$constList = array_values($reflection->getConstants());
        }

        return static::$constList;
    }
743473
private function getConstructorArgs()
    {
        $reflector = $this->getReflector();
        $constructor = $reflector->getConstructor();
        if ($constructor !== null) {
            return $constructor->getParameters();
        }
        return array();
    }
212000
public function getAllTagsText(): string
    {
        $examples = [];

        foreach (get_class_methods($this) as $method) {
            $reflection = new ReflectionMethod($this, $method);
            if ($reflection->isPublic() && !in_array($method, self::$public_but_not_allowed, true) && (string) $reflection->getReturnType() !== Builder::class) {
                $examples[$method] = $method;
            }
        }

        ksort($examples);

        return implode('<br>', $examples);
    }
19032
final public static function getValues(): array
    {
        if (isset(self::$cache[static::class])) {
            return self::$cache[static::class];
        }

        $rc = new \ReflectionClass(static::class);

        return self::$cache[static::class] = $rc->getConstants();
    }
1316591
public function getParameters()
    {
        if (null === $this->parameters) {
            $this->parameters = array();
            foreach ($this->reflection->getParameters() as $reflectionParameter) {
                $this->parameters[$reflectionParameter->getName()] = new CallbackParameter($reflectionParameter);
            }
        }

        return $this->parameters;
    }
684480
private function getClassMethods(): array
    {
        if (null !== $this->reflectionMethods) {
            return $this->reflectionMethods;
        }

        $this->reflectionMethods = [];

        $class = $this->reflectionClass;

        do {
            $this->reflectionMethods = \array_merge(
                $this->reflectionMethods,
                $class->getMethods()
            );
        } while ($class = $class->getParentClass());

        return $this->reflectionMethods;
    }
886750
public function getPhpdocType($reflection, string $tagName)
    {
        /** @var Return_[]|Throws[] $tags */
        $tags = $this->getTags($reflection, $tagName);
        $tag = array_pop($tags);
        $type = $tag ? $tag->getType() : null;

        return $this->resolve($reflection, $type);
    }
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;
    }
968206
public function getCreators($tag = null)
    {
        $tag = is_null($tag) ? [] : (is_array($tag) ? $tag : [$tag]);

        return array_values(array_filter(Person::get($this), function (Person $person) use ($tag) {
            return empty($tag) || in_array($person->getType(), $tag);
        }));
    }
977393
public function getAllParameters()
	{
		// Collect parameters used in template
		$params = [];
		foreach ($this->configurator->tags as $tag)
		{
			if (isset($tag->template))
			{
				foreach ($tag->template->getParameters() as $paramName)
				{
					$params[$paramName] = '';
				}
			}
		}

		// Merge defined parameters and those collected from templates. Defined parameters take
		// precedence
		$params = iterator_to_array($this->parameters) + $params;

		// Sort parameters by name for consistency
		ksort($params);

		return $params;
	}
880758
public function getMethod(string $methodName, $tags = '*'): array
    {
        try {
            $method = new ReflectionMethod($this->className, $methodName);
        } catch (ReflectionException $e) {
            return [];
        }

        return $this->parse($method->getDocComment(), $tags);
    }