REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.17 KB
Close
//opt/cpanel/ea-wappspector/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php
Text
Base64
<?php declare(strict_types=1); namespace DI\Invoker; use Invoker\ParameterResolver\ParameterResolver; use Psr\Container\ContainerInterface; use ReflectionFunctionAbstract; use ReflectionNamedType; /** * Inject the container, the definition or any other service using type-hints. * * {@internal This class is similar to TypeHintingResolver and TypeHintingContainerResolver, * we use this instead for performance reasons} * * @author Quim Calpe <quim@kalpe.com> * @author Matthieu Napoli <matthieu@mnapoli.fr> */ class FactoryParameterResolver implements ParameterResolver { public function __construct( private ContainerInterface $container, ) { } public function getParameters( ReflectionFunctionAbstract $reflection, array $providedParameters, array $resolvedParameters, ) : array { $parameters = $reflection->getParameters(); // Skip parameters already resolved if (! empty($resolvedParameters)) { $parameters = array_diff_key($parameters, $resolvedParameters); } foreach ($parameters as $index => $parameter) { $parameterType = $parameter->getType(); if (!$parameterType) { // No type continue; } if (!$parameterType instanceof ReflectionNamedType) { // Union types are not supported continue; } if ($parameterType->isBuiltin()) { // Primitive types are not supported continue; } $parameterClass = $parameterType->getName(); if ($parameterClass === 'Psr\Container\ContainerInterface') { $resolvedParameters[$index] = $this->container; } elseif ($parameterClass === 'DI\Factory\RequestedEntry') { // By convention the second parameter is the definition $resolvedParameters[$index] = $providedParameters[1]; } elseif ($this->container->has($parameterClass)) { $resolvedParameters[$index] = $this->container->get($parameterClass); } } return $resolvedParameters; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 2
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
DefinitionParameterResolver.php
1.83 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FactoryParameterResolver.php
2.17 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).