Skip to content

Commit

Permalink
Update spatie/http-status-check (#91)
Browse files Browse the repository at this point in the history
* - Remove support for PHP 8.0
- Update spatie/crawler
- Bump dependencies
- Fix deprecation notices related to spatie/crawler

* Fix styling

* Fix tests

---------

Co-authored-by: nlemoine <[email protected]>
Co-authored-by: Freek Van der Herten <[email protected]>
  • Loading branch information
3 people committed Jun 14, 2023
1 parent 89416a8 commit 3fbf3fe
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.1, 8.0, 7.4, 7.3]
php: [8.2, 8.1]
stability: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

## 4.0 - 2023-06-14

- Remove support for PHP 8.0
- Update spatie/crawler
- Bump dependencies
- Fix deprecation notices related to spatie/crawler

## 3.3.0 - 2020-12-01

- Add support for PHP 8
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/support-ukraine.svg?t=1" />](https://supportukrainenow.org)

# Check the HTTP status code of all links on a website

[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/http-status-check.svg?style=flat-square)](https://packagist.org/packages/spatie/http-status-check)
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
}
],
"require": {
"php": "^7.3|^8.0",
"symfony/console": "^4.0|^5.0",
"spatie/crawler": "^4.7",
"guzzlehttp/promises": "^1.4"
"php": "^8.1",
"symfony/console": "^5.4|^6.0",
"spatie/crawler": "^8.0",
"guzzlehttp/promises": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^6.4 || ^9.5.10"
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 9 additions & 9 deletions src/CrawlLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
use Spatie\Crawler\CrawlObserver;
use Spatie\Crawler\CrawlObservers\CrawlObserver;
use Symfony\Component\Console\Output\OutputInterface;

class CrawlLogger extends CrawlObserver
Expand Down Expand Up @@ -38,17 +38,15 @@ public function __construct(OutputInterface $consoleOutput)

/**
* Called when the crawl will crawl the url.
*
* @param \Psr\Http\Message\UriInterface $url
*/
public function willCrawl(UriInterface $url)
public function willCrawl(UriInterface $url, ?string $linkText): void
{
}

/**
* Called when the crawl has ended.
*/
public function finishedCrawling()
public function finishedCrawling(): void
{
$this->consoleOutput->writeln('');
$this->consoleOutput->writeln('Crawling summary');
Expand Down Expand Up @@ -116,8 +114,9 @@ public function setOutputFile($filename)
public function crawled(
UriInterface $url,
ResponseInterface $response,
?UriInterface $foundOnUrl = null
) {
?UriInterface $foundOnUrl = null,
?string $linkText = null,
): void {
if ($this->addRedirectedResult($url, $response, $foundOnUrl)) {
return;
}
Expand All @@ -134,8 +133,9 @@ public function crawled(
public function crawlFailed(
UriInterface $url,
RequestException $requestException,
?UriInterface $foundOnUrl = null
) {
?UriInterface $foundOnUrl = null,
?string $linkText = null,
): void {
if ($response = $requestException->getResponse()) {
$this->crawled($url, $response, $foundOnUrl);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/ScanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Spatie\HttpStatusCheck;

use GuzzleHttp\RequestOptions;
use Spatie\Crawler\CrawlAllUrls;
use Spatie\Crawler\Crawler;
use Spatie\Crawler\CrawlInternalUrls;
use Spatie\Crawler\CrawlProfiles\CrawlAllUrls;
use Spatie\Crawler\CrawlProfiles\CrawlInternalUrls;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down

0 comments on commit 3fbf3fe

Please sign in to comment.