Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze authored and github-actions[bot] committed Jul 19, 2023
1 parent 2af8b93 commit ec58bd1
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/CrawlObservers/CrawlObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function willCrawl(UriInterface $url, ?string $linkText): void
abstract public function crawled(
UriInterface $url,
ResponseInterface $response,
?UriInterface $foundOnUrl = null,
?string $linkText = null,
UriInterface $foundOnUrl = null,
string $linkText = null,
): void;

/*
Expand All @@ -31,8 +31,8 @@ abstract public function crawled(
abstract public function crawlFailed(
UriInterface $url,
RequestException $requestException,
?UriInterface $foundOnUrl = null,
?string $linkText = null,
UriInterface $foundOnUrl = null,
string $linkText = null,
): void;

/*
Expand Down
4 changes: 2 additions & 2 deletions src/CrawlUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class CrawlUrl

public static function create(
UriInterface $url,
?UriInterface $foundOnUrl = null,
UriInterface $foundOnUrl = null,
$id = null,
string|null $linkText = null,
string $linkText = null,
): static {
$static = new static($url, $foundOnUrl, linkText: $linkText);

Expand Down
2 changes: 1 addition & 1 deletion src/ResponseWithCachedBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function fromGuzzlePsr7Response(ResponseInterface $response): stat
);
}

public function setCachedBody(?string $body = null): void
public function setCachedBody(string $body = null): void
{
$this->cachedBody = $body;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class Url extends Uri
{
public function __construct(
protected string $link,
protected string|null $linkText,
protected ?string $linkText,
) {
parent::__construct($link);
}

public function linkText(): string|null
public function linkText(): ?string
{
return $this->linkText;
}
Expand Down
8 changes: 4 additions & 4 deletions tests/CrawlObserverCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
public function crawled(
UriInterface $url,
ResponseInterface $response,
?UriInterface $foundOnUrl = null,
?string $linkText = null,
UriInterface $foundOnUrl = null,
string $linkText = null,
): void {
$this->crawled = true;
}

public function crawlFailed(
UriInterface $url,
RequestException $requestException,
?UriInterface $foundOnUrl = null,
?string $linkText = null,
UriInterface $foundOnUrl = null,
string $linkText = null,
): void {
$this->failed = true;
}
Expand Down
10 changes: 5 additions & 5 deletions tests/TestClasses/CrawlLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ public function willCrawl(UriInterface $url, ?string $linkText): void
public function crawled(
UriInterface $url,
ResponseInterface $response,
?UriInterface $foundOnUrl = null,
?string $linkText = null,
UriInterface $foundOnUrl = null,
string $linkText = null,
): void {
$this->logCrawl($url, $foundOnUrl, $linkText);
}

public function crawlFailed(
UriInterface $url,
RequestException $requestException,
?UriInterface $foundOnUrl = null,
?string $linkText = null,
UriInterface $foundOnUrl = null,
string $linkText = null,
): void {
$this->logCrawl($url, $foundOnUrl, $linkText);
}

protected function logCrawl(UriInterface $url, ?UriInterface $foundOnUrl, ?string $linkText = null)
protected function logCrawl(UriInterface $url, ?UriInterface $foundOnUrl, string $linkText = null)
{
$logText = "{$this->observerId}hasBeenCrawled: {$url}";

Expand Down

0 comments on commit ec58bd1

Please sign in to comment.