File manager - Edit - /var/www/payraty/helpdesk/vendor/rector/rector/vendor/symplify/easy-parallel/src/Reflection/CommandFromReflectionFactory.php
Back
<?php declare (strict_types=1); namespace RectorPrefix202208\Symplify\EasyParallel\Reflection; use ReflectionClass; use ReflectionMethod; use RectorPrefix202208\Symfony\Component\Console\Command\Command; use RectorPrefix202208\Symplify\EasyParallel\Exception\ParallelShouldNotHappenException; final class CommandFromReflectionFactory { /** * @param class-string<Command> $className */ public function create(string $className) : Command { $commandReflectionClass = new ReflectionClass($className); $command = $commandReflectionClass->newInstanceWithoutConstructor(); $parentClassReflection = $commandReflectionClass->getParentClass(); if (!$parentClassReflection instanceof ReflectionClass) { throw new ParallelShouldNotHappenException(); } $parentConstructorReflectionMethod = $parentClassReflection->getConstructor(); if (!$parentConstructorReflectionMethod instanceof ReflectionMethod) { throw new ParallelShouldNotHappenException(); } $parentConstructorReflectionMethod->invoke($command); return $command; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings