Skip to content

Commit

Permalink
bot: fix cs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Feb 1, 2024
1 parent 9004306 commit a8c0f93
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/Uri/Part/Authority.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class Authority extends Part
{
private string $string;

public function __construct(private Part\Host $host, private ?string $username, private ?string $password, private ?int $port)
public function __construct(private Host $host, private ?string $username, private ?string $password, private ?int $port)
{
}

Expand All @@ -31,21 +31,21 @@ public function __clone()
unset($this->string);
}

public function host(): Part\Host
public function host(): Host
{
return $this->host;
}

/**
* @return Part\string|null "urldecoded"
* @return string|null "urldecoded"
*/
public function username(): ?string
{
return null !== $this->username ? \rawurldecode($this->username) : null;
}

/**
* @return Part\string|null "urldecoded"
* @return string|null "urldecoded"
*/
public function password(): ?string
{
Expand Down Expand Up @@ -75,7 +75,7 @@ public function userInfo(): ?string
public function withHost(?string $host): self
{
$authority = clone $this;
$authority->host = new Part\Host($host);
$authority->host = new Host($host);

if ($authority->host->isEmpty()) {
$authority->username = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Uri/Part/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function has(string $param): bool
*
* @param T|\Throwable $default
*
* @return Part\T
* @return T
*
* @throws \Throwable If passed as default and no match
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Uri/Signed/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class Builder implements \Stringable
private ?\DateTimeImmutable $expiresAt = null;
private ?string $singleUseToken = null;

public function __construct(private Uri $uri, private string|Uri\Signed\SymfonySigner $secret)
public function __construct(private Uri $uri, private string|SymfonySigner $secret)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Uri/SignedUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* @author Kevin Bond <[email protected]>
*/
final class SignedUri extends Uri\WrappedUri
final class SignedUri extends WrappedUri
{
private function __construct(private Uri $uri, private ?\DateTimeImmutable $expiresAt, private bool $singleUse)
{
Expand All @@ -32,7 +32,7 @@ public static function sign(string|Uri $uri, string|SymfonySigner $secret, ?\Dat
}

/**
* @param Uri\string|null $singleUseToken If passed, this value MUST change once the URL is considered "used"
* @param string|null $singleUseToken If passed, this value MUST change once the URL is considered "used"
*
* @throws Expired if the URI has expired
* @throws AlreadyUsed if the URI has already been used
Expand Down
18 changes: 9 additions & 9 deletions src/Uri/TemplateUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
*
* @immutable
*/
final class TemplateUri extends Uri\WrappedUri
final class TemplateUri extends WrappedUri
{
private UriTemplate $parser;
private Uri $uri;
private Uri\Parameters $parameters;
private Parameters $parameters;

private function __construct(private string $template)
{
Expand All @@ -35,9 +35,9 @@ private function __construct(private string $template)
/**
* @param array<string,mixed>|Parameters $parameters
*/
public static function expand(string $template, array|Uri\Parameters $parameters): self
public static function expand(string $template, array|Parameters $parameters): self
{
if ($parameters instanceof Uri\Parameters) {
if ($parameters instanceof Parameters) {
$parameters = $parameters->all();
}

Expand All @@ -50,7 +50,7 @@ public static function expand(string $template, array|Uri\Parameters $parameters
public static function extract(string $template, string|Uri $uri): self
{
$ret = new self($template);
$ret->uri = Uri\ParsedUri::wrap($uri);
$ret->uri = ParsedUri::wrap($uri);

return $ret;
}
Expand All @@ -60,7 +60,7 @@ public function template(): string
return $this->template;
}

public function parameters(): Uri\Parameters
public function parameters(): Parameters
{
return $this->parameters ??= self::filterParameters($this->parser()->extract($this->template, $this->uri) ?? throw new \LogicException());
}
Expand Down Expand Up @@ -106,15 +106,15 @@ public function mergeParameters(...$arrays): self

protected function inner(): Uri
{
return $this->uri ??= Uri\ParsedUri::wrap($this->parser()->expand($this->template, $this->parameters->all()));
return $this->uri ??= ParsedUri::wrap($this->parser()->expand($this->template, $this->parameters->all()));
}

/**
* @param mixed[] $values
*/
private static function filterParameters(array $values): Uri\Parameters
private static function filterParameters(array $values): Parameters
{
return new Uri\Parameters(\array_filter($values, static fn($v) => '' !== $v && null !== $v));
return new Parameters(\array_filter($values, static fn($v) => '' !== $v && null !== $v));
}

private function parser(): UriTemplate
Expand Down
2 changes: 1 addition & 1 deletion src/Uri/WrappedUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* @author Kevin Bond <[email protected]>
*/
abstract class WrappedUri extends Uri\BaseUri
abstract class WrappedUri extends BaseUri
{
final public function scheme(): Scheme
{
Expand Down

0 comments on commit a8c0f93

Please sign in to comment.