src/Url.php
public function setScheme( ?string $scheme = null ) : Url
   {

      if ( null === $scheme || ! \preg_match( '~^[a-z]{3,7}$~i', $scheme ) )
      {
         $this->scheme = 'http';
         return $this;
      }

      $this->scheme = $scheme;

      return $this;

   }
public function setScheme( ?string $scheme = null ) : Url
   {

      if ( null === $scheme || ! \preg_match( '~^[a-z]{3,7}$~i', $scheme ) )
      {
         $this->scheme = 'http';
         return $this;
      }

      $this->scheme = $scheme;

      return $this;

   }
public function setScheme ( ? string $ scheme = null ) : Url { if ( null === $ scheme || ! \ preg_match ( '~^[a-z]{3,7}$~i' , $ scheme ) ) { $ this -> scheme = 'http' ; return $ this ; } $ this -> scheme = $ scheme ; return $ this ; }
Sets the URL scheme. Default is 'http' if none is defined

@param string|null $scheme
@return \Niirrty\Web\Url
Sets the URL scheme . Default is http if none is defined