Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fenric committed Oct 30, 2018
1 parent c309e1b commit fc22df5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __construct(string $uri = '')
{
$this->payload = new Collection();

if (!('' === $uri))
if (! ('' === $uri))
{
$this->parse($uri);
}
Expand All @@ -122,7 +122,7 @@ public function setScheme(string $scheme) : UriInterface
{
$regex = '/^(?:[A-Za-z][0-9A-Za-z\+\-\.]*)?$/';

if (!\preg_match($regex, $scheme))
if (! \preg_match($regex, $scheme))
{
throw new InvalidUriComponentException('Invalid URI component "scheme"');
}
Expand Down Expand Up @@ -220,7 +220,7 @@ public function setPort(?int $port) : UriInterface
$min = 1;
$max = 2 ** 16;

if (!($port === null || ($port >= $min && $port <= $max)))
if (! ($port === null || ($port >= $min && $port <= $max)))
{
throw new InvalidUriComponentException('Invalid URI component "port"');
}
Expand Down Expand Up @@ -405,11 +405,11 @@ public function getUserInfo() : string
{
$result = '';

if (!($this->getUsername() === ''))
if (! ($this->getUsername() === ''))
{
$result .= $this->getUsername();

if (!($this->getPassword() === ''))
if (! ($this->getPassword() === ''))
{
$result .= ':' . $this->getPassword();
}
Expand All @@ -427,11 +427,11 @@ public function getHostPort() : string
{
$result = '';

if (!($this->getHost() === ''))
if (! ($this->getHost() === ''))
{
$result .= $this->getHost();

if (!($this->getPort() === null))
if (! ($this->getPort() === null))
{
$result .= ':' . $this->getPort();
}
Expand All @@ -451,11 +451,11 @@ public function getAuthority() : string

$hostport = $this->getHostPort();

if (!($hostport === ''))
if (! ($hostport === ''))
{
$userinfo = $this->getUserInfo();

if (!($userinfo === ''))
if (! ($userinfo === ''))
{
$result .= $userinfo . '@';
}
Expand All @@ -475,26 +475,26 @@ public function toString() : string
{
$result = '';

if (!($this->getScheme() === ''))
if (! ($this->getScheme() === ''))
{
$result .= $this->getScheme() . ':';
}

$authority = $this->getAuthority();

if (!($authority === ''))
if (! ($authority === ''))
{
$result .= '//' . $authority;
}

$result .= $this->getPath();

if (!($this->getQuery() === ''))
if (! ($this->getQuery() === ''))
{
$result .= '?' . $this->getQuery();
}

if (!($this->getFragment() === ''))
if (! ($this->getFragment() === ''))
{
$result .= '#' . $this->getFragment();
}
Expand Down Expand Up @@ -523,7 +523,7 @@ public function withUserInfo($username, $password = null) : UriInterface

$clone->setUsername($username);

if (!(null === $password))
if (! (null === $password))
{
$clone->setPassword($password);
}
Expand Down

0 comments on commit fc22df5

Please sign in to comment.