File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ All Notable changes to `League\Uri\Interfaces` will be documented in this file
4848
4949-  ` UriString::parse `  will fail if the URI contains whitespace.
5050-  ` UriString::buildUri `  allows the ` $path `  argument to be ` null ` .
51+ -  ` UriString::buildAuthority `  allows the ` $user `  argument to be ` null `  and still generate a user info component.
5152
5253### Deprecated  
5354
Original file line number Diff line number Diff line change @@ -266,18 +266,19 @@ public static function buildAuthority(array $components): ?string
266266            return  null ;
267267        }
268268
269-         $ authority $ components'host '  ] ;
270-         if  (isset ($ components'port ' ])) {
271-             $ authority ': ' .$ components'port ' ];
269+         $ userInfo $ components'user '  ] ??  null ;
270+         if  (isset ($ components'pass ' ])) {
271+             $ userInfo ': ' .$ components'pass ' ];
272272        }
273273
274-         if  (!isset ($ components'user ' ])) {
275-             return  $ authority
274+         $ authority'' ;
275+         if  (isset ($ userInfo
276+             $ authority$ userInfo'@ ' ;
276277        }
277278
278-         $ userInfo  =  self :: buildUserInfo ( $ components) ;
279-         if  (null  !==  $ userInfo 
280-             return   $ userInfo . ' @ '$ authority 
279+         $ authority  .=  $ components[ ' host ' ] ;
280+         if  (isset ( $ components [ ' port ' ]) ) {
281+             $ authority  .=  ' : '$ components [ ' port ' ] ;
281282        }
282283
283284        return  $ authority
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments