Neos\Flow\Cli\CommandManager::commandMatchesIdentifier PHP 메소드

commandMatchesIdentifier() 보호된 메소드

This is the case, if - the identifiers are the same - if at least the last two command parts match (case sensitive) or - if only the package key is specified and matches the commands package key The first part (package key) can be reduced to the last subpackage, as long as the result is unambiguous.
protected commandMatchesIdentifier ( Command $command, string $commandIdentifier ) : boolean
$command Command
$commandIdentifier string command identifier in the format foo:bar:baz (all lower case)
리턴 boolean TRUE if the specified command identifier matches this commands identifier
    protected function commandMatchesIdentifier(Command $command, $commandIdentifier)
    {
        $commandIdentifierParts = explode(':', $command->getCommandIdentifier());
        $searchedCommandIdentifierParts = explode(':', $commandIdentifier);
        $packageKey = array_shift($commandIdentifierParts);
        $searchedCommandIdentifierPartsCount = count($searchedCommandIdentifierParts);
        if ($searchedCommandIdentifierPartsCount === 3 || $searchedCommandIdentifierPartsCount === 1) {
            $searchedPackageKey = array_shift($searchedCommandIdentifierParts);
            if ($searchedPackageKey !== $packageKey && substr($packageKey, -(strlen($searchedPackageKey) + 1)) !== '.' . $searchedPackageKey) {
                return false;
            }
        }
        if ($searchedCommandIdentifierPartsCount === 1) {
            return true;
        } elseif (count($searchedCommandIdentifierParts) !== 2) {
            return false;
        }
        return $searchedCommandIdentifierParts === $commandIdentifierParts;
    }