Skip to content

Commit 5559a30

Browse files
authored
php 8.3 and 8.4 support, phpstan fixes (#84)
1 parent 5a311e6 commit 5559a30

File tree

10 files changed

+51
-42
lines changed

10 files changed

+51
-42
lines changed

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup PHP
1313
uses: shivammathur/setup-php@v2
1414
with:
15-
php-version: "8.1"
15+
php-version: "8.4"
1616

1717
- name: Cache composer dependencies
1818
uses: actions/cache@v4

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.1, 8.2]
16+
php: [8.1, 8.2, 8.3, 8.4]
1717
laravel: [10.*, 11.*, 12.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:

CHANGELOG.md

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to `laravel-seo` will be documented in this file.
44

5+
## v3.2.0 - 2024-12-19
6+
7+
### What's Changed
8+
9+
- Add support for PHP 8.3 and 8.4
10+
- Ensure full Laravel 12.x compatibility
11+
- Update GitHub Actions workflows to test against new PHP versions
12+
13+
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v3.1.0...v3.2.0
14+
515
## v3.1.0 - 2023-08-17
616

717
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v3.0.0...v3.1.0
@@ -10,32 +20,32 @@ All notable changes to `laravel-seo` will be documented in this file.
1020

1121
### What's Changed
1222

13-
- Crawl Javascript pages (SPA) by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/39
23+
- Crawl Javascript pages (SPA) by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/39
1424

1525
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v2.6.1...v3.0.0
1626

1727
## v2.6.1 - 2023-08-04
1828

1929
### What's Changed
2030

21-
- Keyword checks by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/36
31+
- Keyword checks by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/36
2232

2333
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v2.5.0...v2.6.1
2434

2535
## v2.5.0 - 2023-08-03
2636

2737
### What's Changed
2838

29-
- Remove title check by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/35
39+
- Remove title check by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/35
3040

3141
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v2.4.0...v2.5.0
3242

3343
## v2.4.0 - 2023-08-03
3444

3545
### What's Changed
3646

37-
- Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/34
38-
- Replace cURL with HTTP by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/33
47+
- Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/34
48+
- Replace cURL with HTTP by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/33
3949

4050
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v2.3.0...v2.4.0
4151

@@ -49,21 +59,21 @@ Broken image check now also saves the status in the database.
4959

5060
### What's Changed
5161

52-
- Bump dependabot/fetch-metadata from 1.4.0 to 1.5.1 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/31
53-
- Bump aglipanci/laravel-pint-action from 2.2.0 to 2.3.0 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/32
54-
- [Feature] Domain custom resolve by @markvaneijk in https://github.com/backstagephp/laravel-seo-scanner/pull/22
62+
- Bump dependabot/fetch-metadata from 1.4.0 to 1.5.1 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/31
63+
- Bump aglipanci/laravel-pint-action from 2.2.0 to 2.3.0 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/32
64+
- [Feature] Domain custom resolve by @markvaneijk in https://github.com/backstagephp/laravel-seo-scanner/pull/22
5565

5666
### New Contributors
5767

58-
- @markvaneijk made their first contribution in https://github.com/backstagephp/laravel-seo-scanner/pull/22
68+
- @markvaneijk made their first contribution in https://github.com/backstagephp/laravel-seo-scanner/pull/22
5969

6070
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v2.1.0...v2.2.0
6171

6272
## v2.1.0 - 2023-05-29
6373

6474
### What's Changed
6575

66-
- Prunable scans by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/30
76+
- Prunable scans by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/30
6777

6878
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v2.0.0...v2.1.0
6979

@@ -73,49 +83,49 @@ Broken image check now also saves the status in the database.
7383

7484
The following changes have been made to classnames with abbreviations in the checks:
7585

76-
- `CCSSizeCheck` has been changed to `CssSizeCheck`
77-
- `TTFBSizeCheck` has been changed to `TtfbSizeCheck`
78-
- `HTMLSizeCheck` has been changed to `HtmlSizeCheck`
86+
- `CCSSizeCheck` has been changed to `CssSizeCheck`
87+
- `TTFBSizeCheck` has been changed to `TtfbSizeCheck`
88+
- `HTMLSizeCheck` has been changed to `HtmlSizeCheck`
7989

8090
If you have scans saved in the database, please ensure you update the failed_checks column in the seo_scans table. The previous namespaces used in this column are no longer compatible.
8191

8292
### What's Changed
8393

84-
- Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/27
85-
- Save broken link status code by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/28
86-
- Reformat to abbrevation to lowercase by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/29
94+
- Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/27
95+
- Save broken link status code by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/28
96+
- Reformat to abbrevation to lowercase by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/29
8797

8898
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v1.3.0...v2.0.0
8999

90100
## v1.3.0 - 2023-05-05
91101

92102
### What's Changed
93103

94-
- Bump aglipanci/laravel-pint-action from 2.1.0 to 2.2.0 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/25
95-
- Run scan with queued job by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/26
104+
- Bump aglipanci/laravel-pint-action from 2.1.0 to 2.2.0 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/25
105+
- Run scan with queued job by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/26
96106

97107
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v1.2.0...v1.3.0
98108

99109
## v1.2.0 - 2023-03-09
100110

101111
### What's Changed
102112

103-
- Adding a new config to disable SSL certificate integrity check by @MuriloChianfa in https://github.com/backstagephp/laravel-seo-scanner/pull/18
104-
- Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/20
105-
- [Feature] Laravel 10 compatibility by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/24
113+
- Adding a new config to disable SSL certificate integrity check by @MuriloChianfa in https://github.com/backstagephp/laravel-seo-scanner/pull/18
114+
- Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/backstagephp/laravel-seo-scanner/pull/20
115+
- [Feature] Laravel 10 compatibility by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/24
106116

107117
### New Contributors
108118

109-
- @MuriloChianfa made their first contribution in https://github.com/backstagephp/laravel-seo-scanner/pull/18
119+
- @MuriloChianfa made their first contribution in https://github.com/backstagephp/laravel-seo-scanner/pull/18
110120

111121
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v1.1.0...v1.2.0
112122

113123
## v1.1.0 - 2023-01-13
114124

115125
### What's Changed
116126

117-
- Fix Windows tests by removing SSL validation when using `curl()` by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/16
118-
- Check if a relative url is used when performing broken link checks by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/17
127+
- Fix Windows tests by removing SSL validation when using `curl()` by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/16
128+
- Check if a relative url is used when performing broken link checks by @Baspa in https://github.com/backstagephp/laravel-seo-scanner/pull/17
119129

120130
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/compare/v1.0.1...v1.1.0
121131

@@ -127,11 +137,11 @@ If you have scans saved in the database, please ensure you update the failed_che
127137

128138
#### Features
129139

130-
- Total of 21 checks
131-
- Extensive config file where you can configure how the package behaves.
132-
- Command to check all configured routes
133-
- Command to check a single url
134-
- Possibility to save results into the database
135-
- Corresponding models to easily retrieve the data
140+
- Total of 21 checks
141+
- Extensive config file where you can configure how the package behaves.
142+
- Command to check all configured routes
143+
- Command to check a single url
144+
- Possibility to save results into the database
145+
- Corresponding models to easily retrieve the data
136146

137147
**Full Changelog**: https://github.com/backstagephp/laravel-seo-scanner/commits/v1.0.0

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Easily configure which routes to scan, exclude or include specific checks or eve
4949

5050
## Minimum requirements
5151

52-
- PHP 8.1 or higher
53-
- Laravel 9.0 or higher
52+
- PHP 8.1 or higher (8.1, 8.2, 8.3, 8.4)
53+
- Laravel 9.0 or higher (9.x, 10.x, 11.x, 12.x)
5454

5555
## Installation
5656

@@ -62,7 +62,7 @@ composer require backstage/laravel-seo-scanner
6262

6363
If you want to scan pages that are rendered using Javascript, for example Vue or React, you need to install Puppeteer. You can install it using the following command:
6464

65-
> If you want to know how to scan Javascript rendered pages, check out [Scanning routes in an SPA application](#scanning-routes-in-an-spa-application). Want to know more about Puppeteer? Check out the [Puppeteer documentation](https://pptr.dev/).
65+
> If you want to know how to scan Javascript rendered pages, check out [Scanning routes in an SPA application](#scanning-routes-in-an-spa-application). Want to know more about Puppeteer? Check out the [Puppeteer documentation](https://pptr.dev/).
6666
6767
```bash
6868
npm install puppeteer
@@ -283,6 +283,7 @@ When you want to save the SEO score to the database, you need to set the `save`
283283
Optionally you can specify the database connection in the config file. If you want to save the SEO score to a model, you need to add the model to the `models` array in the config file. More information about this can be found in the [Check the SEO score of a model](#check-the-seo-score-of-a-model) section.
284284

285285
#### Pruning the database
286+
286287
Per default the package will prune the database from old scans. You can specify the number of days you want to keep the scans in the database. The default is 30 days.
287288

288289
If you want to prune the database, you need to add the prune command to your `App\Console\Kernel`:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.1",
19+
"php": "^8.1|^8.2|^8.3|^8.4",
2020
"guzzlehttp/guzzle": "^7.5",
2121
"illuminate/contracts": "^9.0|^10.0|^11.0|^12.0",
2222
"j0k3r/php-readability": "^2.0",

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ parameters:
99
tmpDir: build/phpstan
1010
checkOctaneCompatibility: true
1111
checkModelProperties: true
12-
checkMissingIterableValueType: false
1312

src/Checks/Content/MultipleHeadingCheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function validateContent(Crawler $crawler): bool
5252
return false;
5353
}
5454

55-
if (is_array($content) && count($content) > 1) {
55+
if (count($content) > 1) {
5656
$this->actualValue = $content;
5757

5858
$this->failureReason = __('failed.content.multiple_h1', [

src/Checks/Meta/DescriptionCheck.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public function check(Response $response, Crawler $crawler): bool
4444

4545
public function getDescriptionContent(Crawler $crawler): ?string
4646
{
47-
/** @var \DOMElement $node */
47+
/** @var \DOMElement|null $node */
4848
$node = $crawler->filterXPath('//meta[@name="description"]')->getNode(0);
4949

50-
if ($node instanceof \DOMElement && $node->hasAttribute('content')) {
50+
if ($node && $node->hasAttribute('content')) {
5151
return $node->getAttribute('content');
5252
}
5353

src/Checks/Performance/ResponseCheck.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ class ResponseCheck implements Check
3333

3434
public function check(Response $response, Crawler $crawler): bool
3535
{
36-
/** @phpstan-ignore-next-line */
3736
$this->actualValue = $response->getStatusCode();
3837

39-
/** @phpstan-ignore-next-line */
4038
if ($response->getStatusCode() === 200) {
4139
return true;
4240
}

src/Traits/HasSeoScore.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Illuminate\Contracts\Database\Eloquent\Builder;
99
use Illuminate\Database\Eloquent\Relations\MorphMany;
1010

11+
/** @phpstan-ignore-next-line */
1112
trait HasSeoScore
1213
{
1314
public function seoScore(): SeoScore

0 commit comments

Comments
 (0)