src/Valkyrja/Console/Annotations/NativeCommandAnnotations.php
public function getCommands(string ...$classes): array
    {
        $annotations = [];

        // Iterate through all the classes
        foreach ($classes as $class) {
            // Get all the annotations for each class and iterate through them
            /** @var \Valkyrja\Console\Annotations\Command $annotation */
            foreach ($this->classAnnotationsType(
                'Command',
                $class
            ) as $annotation) {
                $this->setCommandProperties($annotation);
                // Set the annotation in the annotations list
                $annotations[] = $this->getCommandFromAnnotation($annotation);
            }

            // Get all the annotations for each class and iterate through them
            /** @var \Valkyrja\Console\Annotations\Command $annotation */
            foreach ($this->methodsAnnotationsType(
                'Command',
                $class
            ) as $annotation) {
                $this->setCommandProperties($annotation);
                // Set the annotation in the annotations list
                $annotations[] = $this->getCommandFromAnnotation($annotation);
            }
        }

        return $annotations;
    }
public function getCommands(string ...$classes): array
    {
        $annotations = [];

        // Iterate through all the classes
        foreach ($classes as $class) {
            // Get all the annotations for each class and iterate through them
            /** @var \Valkyrja\Console\Annotations\Command $annotation */
            foreach ($this->classAnnotationsType(
                'Command',
                $class
            ) as $annotation) {
                $this->setCommandProperties($annotation);
                // Set the annotation in the annotations list
                $annotations[] = $this->getCommandFromAnnotation($annotation);
            }

            // Get all the annotations for each class and iterate through them
            /** @var \Valkyrja\Console\Annotations\Command $annotation */
            foreach ($this->methodsAnnotationsType(
                'Command',
                $class
            ) as $annotation) {
                $this->setCommandProperties($annotation);
                // Set the annotation in the annotations list
                $annotations[] = $this->getCommandFromAnnotation($annotation);
            }
        }

        return $annotations;
    }
Get the commands.

@param string[] $classes The classes

@throws \ReflectionException

@return \Valkyrja\Console\Command[]