source/Scaffolder/Commands/RequestCommand.php
private function parseField(string $field): array
    {
        $source = static::DEFAULT_SOURCE;
        $type = static::DEFAULT_TYPE;
        $origin = null;

        if (strpos($field, '(') !== false) {
            $source = substr($field, strpos($field, '(') + 1, -1);
            $field = substr($field, 0, strpos($field, '('));

            if (strpos($source, ':') !== false) {
                list($source, $origin) = explode(':', $source);
            }
        }

        if (strpos($field, ':') !== false) {
            list($field, $type) = explode(':', $field);
        }

        return [$field, $type, $source, $origin];
    }
private function parseField(string $field): array
    {
        $source = static::DEFAULT_SOURCE;
        $type = static::DEFAULT_TYPE;
        $origin = null;

        if (strpos($field, '(') !== false) {
            $source = substr($field, strpos($field, '(') + 1, -1);
            $field = substr($field, 0, strpos($field, '('));

            if (strpos($source, ':') !== false) {
                list($source, $origin) = explode(':', $source);
            }
        }

        if (strpos($field, ':') !== false) {
            list($field, $type) = explode(':', $field);
        }

        return [$field, $type, $source, $origin];
    }
private function parseField ( string $ field ) : array { $ source = static :: DEFAULT_SOURCE ; $ type = static :: DEFAULT_TYPE ; $ origin = null ; if ( strpos ( $ field , '(' ) !== false ) { $ source = substr ( $ field , strpos ( $ field , '(' ) + 1 , - 1 ) ; $ field = substr ( $ field , 0 , strpos ( $ field , '(' ) ) ; if ( strpos ( $ source , ':' ) !== false ) { list ( $ source , $ origin ) = explode ( ':' , $ source ) ; } } if ( strpos ( $ field , ':' ) !== false ) { list ( $ field , $ type ) = explode ( ':' , $ field ) ; } return [ $ field , $ type , $ source , $ origin ] ; }
Parse field to fetch source, origin and type.

@param string $field

@return array
Parse field to fetch source origin and type .