src/Service.php
public static function determineTypeOfWord(string $word): string
    {
        $word = ltrim(rtrim(trim($word), '}'), '{');

        /* Is Option Type */
        if (substr($word, 0, 2) == '--') {
            return self::OPTION_TYPE;
        }

        /* Is Argument Type */
        elseif (substr($word, 0, 1) == ':') {
            return self::ARGUMENT_TYPE;
        }

        /* Is Command Type */
        return self::COMMAND_TYPE;
    }
public static function determineTypeOfWord(string $word): string
    {
        $word = ltrim(rtrim(trim($word), '}'), '{');

        /* Is Option Type */
        if (substr($word, 0, 2) == '--') {
            return self::OPTION_TYPE;
        }

        /* Is Argument Type */
        elseif (substr($word, 0, 1) == ':') {
            return self::ARGUMENT_TYPE;
        }

        /* Is Command Type */
        return self::COMMAND_TYPE;
    }
Determine the type of a string
Option: --option
Argument: :argument
Command: command

@param string $word
@return string