Neos\Flow\ObjectManagement\DependencyInjection\ProxyClassBuilder::buildSetterInjectionCode PHP Метод

buildSetterInjectionCode() защищенный Метод

If neither inject*() nor set*() exists, but the property does exist, NULL is returned
protected buildSetterInjectionCode ( string $className, string $propertyName, string $preparedSetterArgument ) : array
$className string Name of the class to inject into
$propertyName string Name of the property to inject
$preparedSetterArgument string PHP code to use for retrieving the value to inject
Результат array PHP code
    protected function buildSetterInjectionCode($className, $propertyName, $preparedSetterArgument)
    {
        $setterMethodName = 'inject' . ucfirst($propertyName);
        if ($this->reflectionService->hasMethod($className, $setterMethodName)) {
            return ['    $this->' . $setterMethodName . '(' . $preparedSetterArgument . ');'];
        }
        $setterMethodName = 'set' . ucfirst($propertyName);
        if ($this->reflectionService->hasMethod($className, $setterMethodName)) {
            return ['    $this->' . $setterMethodName . '(' . $preparedSetterArgument . ');'];
        }
        if (!property_exists($className, $propertyName)) {
            return [];
        }
        return null;
    }