31 lines
1.5 KiB
YAML
31 lines
1.5 KiB
YAML
|
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
|