src/Domain/Value/Identifier/Uri.php
protected static function parseAuthority(?string $authority): array
    {
        if ($authority === null) {
            return [
                'userInfo' => null,
                'host'     => null,
                'port'     => null
            ];
        }

        preg_match(static::AUTHORITY_PATTERN, $authority, $matches);

        $userInfo = isset($matches[1]) && $matches[1] ? $matches[1] : null;
        $host = isset($matches[2]) && $matches[2] ? $matches[2] : '';
        $port = isset($matches[3]) && $matches[3] ? ((int) $matches[3]) : null;

        return [
            'userInfo' => $userInfo,
            'host'     => $host,
            'port'     => $port
        ];
    }
protected static function parseAuthority(?string $authority): array
    {
        if ($authority === null) {
            return [
                'userInfo' => null,
                'host'     => null,
                'port'     => null
            ];
        }

        preg_match(static::AUTHORITY_PATTERN, $authority, $matches);

        $userInfo = isset($matches[1]) && $matches[1] ? $matches[1] : null;
        $host = isset($matches[2]) && $matches[2] ? $matches[2] : '';
        $port = isset($matches[3]) && $matches[3] ? ((int) $matches[3]) : null;

        return [
            'userInfo' => $userInfo,
            'host'     => $host,
            'port'     => $port
        ];
    }
protected static function parseAuthority ( ? string $ authority ) : array { if ( $ authority === null ) { return [ 'userInfo' => null , 'host' => null , 'port' => null ] ; } preg_match ( static :: AUTHORITY_PATTERN , $ authority , $ matches ) ; $ userInfo = isset ( $ matches [ 1 ] ) && $ matches [ 1 ] ? $ matches [ 1 ] : null ; $ host = isset ( $ matches [ 2 ] ) && $ matches [ 2 ] ? $ matches [ 2 ] : '' ; $ port = isset ( $ matches [ 3 ] ) && $ matches [ 3 ] ? ( ( int ) $ matches [ 3 ] ) : null ; return [ 'userInfo' => $ userInfo , 'host' => $ host , 'port' => $ port ] ; }
Parses authority component into parts

@param string|null $authority The authority

@return array
Parses authority component into parts