/** * Builds code which registers the lifecycle shutdown method, if any. * * @param \TYPO3\FLOW3\Object\Configuration\Configuration $objectConfiguration * @return string */ protected function buildLifecycleShutdownCode(\TYPO3\FLOW3\Object\Configuration\Configuration $objectConfiguration) { $lifecycleShutdownMethodName = $objectConfiguration->getLifecycleShutdownMethodName(); if (!$this->reflectionService->hasMethod($objectConfiguration->getClassName(), $lifecycleShutdownMethodName)) { return ''; } return "\n" . ' \\TYPO3\\FLOW3\\Core\\Bootstrap::$staticObjectManager->registerShutdownObject($this, \'' . $lifecycleShutdownMethodName . '\');' . PHP_EOL; }
/** * @test */ public function theDefaultFactoryMethodNameIsCreate() { $this->assertSame('create', $this->objectConfiguration->getFactoryMethodName()); }