platform/api/symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.yaml

31 lines
1.5 KiB
YAML
Raw Normal View History

2024-09-02 17:44:11 +00:00
name: ArgumentMetadataFactory
class_comment: null
dependencies: []
properties: []
methods:
- name: getType
visibility: private
parameters:
- name: parameter
comment: "# * Builds {@see ArgumentMetadata} objects based on the given Controller.\n\
# *\n# * @author Iltar van der Berg <kjarli@gmail.com>\n# */\n# final class ArgumentMetadataFactory\
\ implements ArgumentMetadataFactoryInterface\n# {\n# public function createArgumentMetadata(string|object|array\
\ $controller, ?\\ReflectionFunctionAbstract $reflector = null): array\n# {\n\
# $arguments = [];\n# $reflector ??= new \\ReflectionFunction($controller(...));\n\
# $controllerName = $this->getPrettyName($reflector);\n# \n# foreach ($reflector->getParameters()\
\ as $param) {\n# $attributes = [];\n# foreach ($param->getAttributes() as $reflectionAttribute)\
\ {\n# if (class_exists($reflectionAttribute->getName())) {\n# $attributes[] =\
\ $reflectionAttribute->newInstance();\n# }\n# }\n# \n# $arguments[] = new ArgumentMetadata($param->getName(),\
\ $this->getType($param), $param->isVariadic(), $param->isDefaultValueAvailable(),\
\ $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, $param->allowsNull(),\
\ $attributes, $controllerName);\n# }\n# \n# return $arguments;\n# }\n# \n# /**\n\
# * Returns an associated type to the given parameter if available."
- name: getPrettyName
visibility: private
parameters:
- name: r
comment: null
traits: []
interfaces:
- ArgumentMetadataFactoryInterface