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

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

Builds code which registers the lifecycle shutdown method, if any.
protected buildLifecycleShutdownCode ( Configuration $objectConfiguration ) : string
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration
Результат string
    protected function buildLifecycleShutdownCode(Configuration $objectConfiguration)
    {
        $lifecycleShutdownMethodName = $objectConfiguration->getLifecycleShutdownMethodName();
        if (!$this->reflectionService->hasMethod($objectConfiguration->getClassName(), $lifecycleShutdownMethodName)) {
            return '';
        }
        $className = $objectConfiguration->getClassName();
        $code = "\n" . '        if (get_class($this) === \'' . $className . '\') {' . "\n";
        $code .= '        \\Neos\\Flow\\Core\\Bootstrap::$staticObjectManager->registerShutdownObject($this, \'' . $lifecycleShutdownMethodName . '\');' . PHP_EOL;
        $code .= '        }' . "\n";
        return $code;
    }