src/Console/Command/ShowCommand.php
private function resolveConfiguration(RectorInterface $rector): array
    {
        $rectorReflection = new ReflectionClass($rector);

        $constructorReflection = $rectorReflection->getConstructor();
        if ($constructorReflection === null) {
            return [];
        }

        $configuration = [];
        foreach ($constructorReflection->getParameters() as $reflectionParameter) {
            $parameterType = (string) $reflectionParameter->getType();
            if (! $this->typeAnalyzer->isPhpReservedType($parameterType)) {
                continue;
            }

            if (! $rectorReflection->hasProperty($reflectionParameter->getName())) {
                continue;
            }

            $propertyReflection = $rectorReflection->getProperty($reflectionParameter->getName());
            $propertyReflection->setAccessible(true);

            $configurationValue = $propertyReflection->getValue($rector);
            $configuration[$reflectionParameter->getName()] = $configurationValue;
        }

        return $configuration;
    }
private function resolveConfiguration(RectorInterface $rector): array
    {
        $rectorReflection = new ReflectionClass($rector);

        $constructorReflection = $rectorReflection->getConstructor();
        if ($constructorReflection === null) {
            return [];
        }

        $configuration = [];
        foreach ($constructorReflection->getParameters() as $reflectionParameter) {
            $parameterType = (string) $reflectionParameter->getType();
            if (! $this->typeAnalyzer->isPhpReservedType($parameterType)) {
                continue;
            }

            if (! $rectorReflection->hasProperty($reflectionParameter->getName())) {
                continue;
            }

            $propertyReflection = $rectorReflection->getProperty($reflectionParameter->getName());
            $propertyReflection->setAccessible(true);

            $configurationValue = $propertyReflection->getValue($rector);
            $configuration[$reflectionParameter->getName()] = $configurationValue;
        }

        return $configuration;
    }
private function resolveConfiguration ( RectorInterface $ rector ) : array { $ rectorReflection = new ReflectionClass ( $ rector ) ; $ constructorReflection = $ rectorReflection -> getConstructor ( ) ; if ( $ constructorReflection === null ) { return [ ] ; } $ configuration = [ ] ; foreach ( $ constructorReflection -> getParameters ( ) as $ reflectionParameter ) { $ parameterType = ( string ) $ reflectionParameter -> getType ( ) ; if ( ! $ this -> typeAnalyzer -> isPhpReservedType ( $ parameterType ) ) { continue ; } if ( ! $ rectorReflection -> hasProperty ( $ reflectionParameter -> getName ( ) ) ) { continue ; } $ propertyReflection = $ rectorReflection -> getProperty ( $ reflectionParameter -> getName ( ) ) ; $ propertyReflection -> setAccessible ( true ) ; $ configurationValue = $ propertyReflection -> getValue ( $ rector ) ; $ configuration [ $ reflectionParameter -> getName ( ) ] = $ configurationValue ; } return $ configuration ; }
Resolve configuration by convention
@return mixed[]
Resolve configuration by convention