DrawMyAttention\ResourceGenerator\Commands\ResourceMakeCommand::parseAttributesFromInputString PHP Method

parseAttributesFromInputString() public method

Convert a pipe-separated list of attributes to an array.
public parseAttributesFromInputString ( string $text ) : array
$text string The Pipe separated attributes
return array
    public function parseAttributesFromInputString($text)
    {
        $parts = explode('|', $text);
        $attributes = [];
        foreach ($parts as $part) {
            $components = explode(':', $part);
            $attributes[$components[0]] = isset($components[1]) ? explode(',', $components[1]) : [];
        }
        return $attributes;
    }