protected function extractGeneric($type)
    {
        if (empty($type)) {
            return null;
        }

        $generic = null;

        if (substr($type, -2) === '[]') {
            $generic = substr($type, 0, -2);
        }
        elseif (strtolower(substr($type, 0, 6)) === 'array<' && substr($type, -1) === '>') {
            $generic = substr($type, 6, -1);
        }

        return $generic;
    }
protected function extractGeneric($type)
    {
        if (empty($type)) {
            return null;
        }

        $generic = null;

        if (substr($type, -2) === '[]') {
            $generic = substr($type, 0, -2);
        }
        elseif (strtolower(substr($type, 0, 6)) === 'array<' && substr($type, -1) === '>') {
            $generic = substr($type, 6, -1);
        }

        return $generic;
    }
protected function extractGeneric ( $ type ) { if ( empty ( $ type ) ) { return null ; } $ generic = null ; if ( substr ( $ type , - 2 ) === '[]' ) { $ generic = substr ( $ type , 0 , - 2 ) ; } elseif ( strtolower ( substr ( $ type , 0 , 6 ) ) === 'array<' && substr ( $ type , - 1 ) === '>' ) { $ generic = substr ( $ type , 6 , - 1 ) ; } return $ generic ; }
Extract the generic subtype from the specified type if there is one.

@param   string $type

@return  string|null
Extract the generic subtype from the specified type if there is one .