/** * @return void */ protected function callCommandMethod() { parent::callCommandMethod(); if ($this->reflectionService->isMethodAnnotatedWith(__CLASS__, $this->commandMethodName, 'SimplyAdmire\\Facets\\Annotations\\AutoCreateChildnodes')) { $this->verbose = FALSE; $this->autoCreateChildNodesCommand(); $this->verbose = TRUE; $this->outputLine('Automatically created childnodes if missing'); } }
/** * @return array */ protected function parseDescription() { $description = 'This class contains the following signals.' . chr(10) . chr(10); $methodReflections = $this->classReflection->getMethods(); foreach ($methodReflections as $methodReflection) { /** @var \TYPO3\Flow\Reflection\MethodReflection $methodReflection */ if ($this->reflectionService->isMethodAnnotatedWith($this->className, $methodReflection->getName(), \TYPO3\Flow\Annotations\Signal::class)) { $signalName = lcfirst(preg_replace('/^emit/', '', $methodReflection->getName())); $description .= $signalName; $description .= chr(10) . str_repeat('^', strlen($signalName)); $description .= chr(10) . chr(10) . $methodReflection->getDescription() . chr(10) . chr(10); } } return $description; }
/** * Compile the result of methods marked with CompileStatic into the proxy class * * @param string $className * @param \TYPO3\Flow\Object\Proxy\ProxyClass $proxyClass * @return void */ protected function compileStaticMethods($className, $proxyClass) { if ($this->classesWithCompileStaticAnnotation === null) { $this->classesWithCompileStaticAnnotation = array_flip($this->reflectionService->getClassesContainingMethodsAnnotatedWith(\TYPO3\Flow\Annotations\CompileStatic::class)); } if (!isset($this->classesWithCompileStaticAnnotation[$className])) { return; } $methodNames = get_class_methods($className); foreach ($methodNames as $methodName) { if ($this->reflectionService->isMethodStatic($className, $methodName) && $this->reflectionService->isMethodAnnotatedWith($className, $methodName, \TYPO3\Flow\Annotations\CompileStatic::class)) { $compiledMethod = $proxyClass->getMethod($methodName); $value = call_user_func(array($className, $methodName), $this->objectManager); $compiledResult = var_export($value, true); $compiledMethod->setMethodBody('return ' . $compiledResult . ';'); } } }