src/AbstractUrl.php
protected static function formatAuthComponent(array $components)
    {
        if (!is_null($components['scheme'])
            && is_null($components['host'])
            && !empty($components['path'])
            && strpos($components['path'], '@') !== false
        ) {
            $tmp = explode('@', $components['path'], 2);
            $components['user'] = $components['scheme'];
            $components['pass'] = $tmp[0];
            $components['path'] = $tmp[1];
            $components['scheme'] = null;
        }

        return $components;
    }
protected static function formatAuthComponent(array $components)
    {
        if (!is_null($components['scheme'])
            && is_null($components['host'])
            && !empty($components['path'])
            && strpos($components['path'], '@') !== false
        ) {
            $tmp = explode('@', $components['path'], 2);
            $components['user'] = $components['scheme'];
            $components['pass'] = $tmp[0];
            $components['path'] = $tmp[1];
            $components['scheme'] = null;
        }

        return $components;
    }
protected static function formatAuthComponent ( array $ components ) { if ( ! is_null ( $ components [ 'scheme' ] ) && is_null ( $ components [ 'host' ] ) && ! empty ( $ components [ 'path' ] ) && strpos ( $ components [ 'path' ] , '@' ) !== false ) { $ tmp = explode ( '@' , $ components [ 'path' ] , 2 ) ; $ components [ 'user' ] = $ components [ 'scheme' ] ; $ components [ 'pass' ] = $ tmp [ 0 ] ; $ components [ 'path' ] = $ tmp [ 1 ] ; $ components [ 'scheme' ] = null ; } return $ components ; }
Reformat the component according to the auth content

@param array $components the result from parse_url

@return array
Reformat the component according to the auth content