Skip to content

Commit

Permalink
Update crawler (#41)
Browse files Browse the repository at this point in the history
* Update crawler

* Apply fixes from StyleCI
  • Loading branch information
brendt authored and freekmurze committed Dec 24, 2017
1 parent c71aca5 commit c58fb2f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@

All notable changes to `spatie/http-status-check` will be documented in this file.

## 3.0.0 -

- PHP 7.1 required
- update `spatie/crawler` to `^3.0`

## 2.5.0 - 2017-12-22
- added support for Symfony 4

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -21,9 +21,9 @@
}
],
"require": {
"php": "^7.0",
"php": "^7.1",
"symfony/console": "^3.0|^4.0",
"spatie/crawler": "^2.0.2"
"spatie/crawler": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
Expand Down
12 changes: 6 additions & 6 deletions src/CrawlLogger.php
Expand Up @@ -2,8 +2,8 @@

namespace Spatie\HttpStatusCheck;

use Spatie\Crawler\Url;
use Spatie\Crawler\CrawlObserver;
use Psr\Http\Message\UriInterface;
use Symfony\Component\Console\Output\OutputInterface;

class CrawlLogger implements CrawlObserver
Expand Down Expand Up @@ -36,20 +36,20 @@ public function __construct(OutputInterface $consoleOutput)
/**
* Called when the crawl will crawl the url.
*
* @param \Spatie\Crawler\Url $url
* @param \Psr\Http\Message\UriInterface $url
*/
public function willCrawl(Url $url)
public function willCrawl(UriInterface $url)
{
}

/**
* Called when the crawler has crawled the given url.
*
* @param \Spatie\Crawler\Url $url
* @param \Psr\Http\Message\UriInterface $url
* @param \Psr\Http\Message\ResponseInterface|null $response
* @param \Spatie\Crawler\Url $foundOn
* @param \Psr\Http\Message\UriInterface $foundOn
*/
public function hasBeenCrawled(Url $url, $response, Url $foundOn = null)
public function hasBeenCrawled(UriInterface $url, $response, ?UriInterface $foundOn = null)
{
$statusCode = $response ? $response->getStatusCode() : self::UNRESPONSIVE_HOST;

Expand Down

0 comments on commit c58fb2f

Please sign in to comment.