76 if (isset($classNameParts[0]) && $classNameParts[0] ===
'TYPO3' && isset($classNameParts[1]) && $classNameParts[1] ===
'CMS') {
77 $classNameParts[0] .=
'\\' . $classNameParts[1];
78 unset($classNameParts[1]);
79 $classNameParts = array_values($classNameParts);
81 if (count($classNameParts) !== 4 || strpos($classNameParts[3],
'CommandController') === FALSE) {
82 throw new \InvalidArgumentException(
83 'Invalid controller class name "' .
$controllerClassName .
'". Class name must end with "CommandController".',
87 $this->extensionName = $classNameParts[1];
89 $this->commandIdentifier = strtolower($extensionKey .
':' . substr($classNameParts[3], 0, -17) .
':' .
$controllerCommandName);
131 return count($lines) > 0 ? trim($lines[0]) :
'<no description available>';
144 $descriptionLines = array();
145 foreach ($lines as $line) {
146 $trimmedLine = trim($line);
147 if ($descriptionLines !== array() || $trimmedLine !==
'') {
148 $descriptionLines[] = $trimmedLine;
151 return implode(chr(10), $descriptionLines);
174 $commandArgumentDefinitions = array();
177 $commandParameters = $this->reflectionService->getMethodParameters($this->controllerClassName, $this->controllerCommandName .
'Command');
179 foreach ($commandParameters as $commandParameterName => $commandParameterDefinition) {
180 $explodedAnnotation = preg_split(
'/\s+/', $annotations[
'param'][$i], 3);
181 $description = !empty($explodedAnnotation[2]) ? $explodedAnnotation[2] :
'';
182 $required = $commandParameterDefinition[
'optional'] !== TRUE;
183 $commandArgumentDefinitions[] = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandArgumentDefinition', $commandParameterName, $required, $description);
186 return $commandArgumentDefinitions;
222 $relatedCommandIdentifiers = array();
224 if (preg_match(
'/^[\\w\\d\\.]+:[\\w\\d]+:[\\w\\d]+$/', $tagValue) === 1) {
225 $relatedCommandIdentifiers[] = $tagValue;
228 return $relatedCommandIdentifiers;
235 if ($this->commandMethodReflection === NULL) {
236 $this->commandMethodReflection = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Reflection\\MethodReflection', $this->controllerClassName, $this->controllerCommandName .
'Command');
__construct($controllerClassName, $controllerCommandName)
getControllerCommandName()
static camelCaseToLowerCaseUnderscored($string)
getCommandMethodReflection()
getRelatedCommandIdentifiers()