public function getAvailableCommands()
    {
        $commands = [];
        $classReflection = new \ReflectionClass(get_class($this));
        $methods = $classReflection->getMethods(\ReflectionMethod::IS_PUBLIC);
        /** @var \ReflectionMethod $method */
        foreach ($methods as $method) {
            $methodDescription = [];
            $methodName = $method->name;
            $docComment = $method->getDocComment();
            $docCommentLines = explode(PHP_EOL, $docComment);

            if (substr($methodName, -7) !== 'Command') {
                continue;
            }

            foreach ($docCommentLines as $currentLine) {
                $currentLine = trim($currentLine);
                if (substr($currentLine, 0, 2) === '/*') {
                    continue;
                }

                if (substr($currentLine, 0, 1) === '*') {
                    $currentLine = substr($currentLine, 1);
                }

                $currentLine = trim($currentLine);
                if (!$currentLine) {
                    continue;
                }
                if ($currentLine[0] === '@') {
                    continue;
                }
                if ($currentLine === '/') {
                    continue;
                }
                $methodDescription[] = trim($currentLine);
            }
            $commands[substr($methodName, 0, -7)] = implode(' ', $methodDescription);
        }

        return $commands;
    }
public function getAvailableCommands()
    {
        $commands = [];
        $classReflection = new \ReflectionClass(get_class($this));
        $methods = $classReflection->getMethods(\ReflectionMethod::IS_PUBLIC);
        /** @var \ReflectionMethod $method */
        foreach ($methods as $method) {
            $methodDescription = [];
            $methodName = $method->name;
            $docComment = $method->getDocComment();
            $docCommentLines = explode(PHP_EOL, $docComment);

            if (substr($methodName, -7) !== 'Command') {
                continue;
            }

            foreach ($docCommentLines as $currentLine) {
                $currentLine = trim($currentLine);
                if (substr($currentLine, 0, 2) === '/*') {
                    continue;
                }

                if (substr($currentLine, 0, 1) === '*') {
                    $currentLine = substr($currentLine, 1);
                }

                $currentLine = trim($currentLine);
                if (!$currentLine) {
                    continue;
                }
                if ($currentLine[0] === '@') {
                    continue;
                }
                if ($currentLine === '/') {
                    continue;
                }
                $methodDescription[] = trim($currentLine);
            }
            $commands[substr($methodName, 0, -7)] = implode(' ', $methodDescription);
        }

        return $commands;
    }
public function getAvailableCommands ( ) { $ commands = [ ] ; $ classReflection = new \ ReflectionClass ( get_class ( $ this ) ) ; $ methods = $ classReflection -> getMethods ( \ ReflectionMethod :: IS_PUBLIC ) ; /** @var \ReflectionMethod $method */ foreach ( $ methods as $ method ) { $ methodDescription = [ ] ; $ methodName = $ method -> name ; $ docComment = $ method -> getDocComment ( ) ; $ docCommentLines = explode ( PHP_EOL , $ docComment ) ; if ( substr ( $ methodName , - 7 ) !== 'Command' ) { continue ; } foreach ( $ docCommentLines as $ currentLine ) { $ currentLine = trim ( $ currentLine ) ; if ( substr ( $ currentLine , 0 , 2 ) === '/*' ) { continue ; } if ( substr ( $ currentLine , 0 , 1 ) === '*' ) { $ currentLine = substr ( $ currentLine , 1 ) ; } $ currentLine = trim ( $ currentLine ) ; if ( ! $ currentLine ) { continue ; } if ( $ currentLine [ 0 ] === '@' ) { continue ; } if ( $ currentLine === '/' ) { continue ; } $ methodDescription [ ] = trim ( $ currentLine ) ; } $ commands [ substr ( $ methodName , 0 , - 7 ) ] = implode ( ' ' , $ methodDescription ) ; } return $ commands ; }
Returns the available commands

@return array
Returns the available commands