Skip to content

Commit 6eafff2

Browse files
authored
Merge pull request #405 from Astrotomic/phpstan-5
add phpstan and correct till level 5
2 parents 990e2c1 + cd5ba70 commit 6eafff2

File tree

6 files changed

+28
-14
lines changed

6 files changed

+28
-14
lines changed

.github/workflows/phpunit.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
php: [8.0, 8.1, 8.2, 8.3]
17-
laravel: [8.*, 9.*, 10.*, 11.*]
17+
laravel: [9.*, 10.*, 11.*]
1818
dependency-version: [prefer-stable]
1919
os: [ubuntu-latest]
2020
include:
21-
- laravel: '8.*'
22-
phpunit: '9.*'
2321
- laravel: '9.*'
2422
phpunit: '9.*'
2523
- laravel: '10.*'
@@ -31,10 +29,6 @@ jobs:
3129
laravel: '10.*'
3230
- php: '8.0'
3331
laravel: '11.*'
34-
- php: '8.2'
35-
laravel: '8.*'
36-
- php: '8.3'
37-
laravel: '8.*'
3832
- php: '8.3'
3933
laravel: '9.*'
4034
- php: '8.1'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ If you discover any security related issues, please check [SECURITY](https://git
9898

9999
| Package | Laravel | PHP |
100100
| :------------------ | :---------------------------- | :-------- |
101-
| **v11.13 - v11.13** | `8.* / 9.* / 10.*` / `11.*` | `^8.0` |
101+
| **v11.13 - v11.13** | `9.* / 10.* / 11.*` | `^8.0` |
102102
| **v11.12 - v11.12** | `8.* / 9.* / 10.*` | `^8.0` |
103103
| **v11.10 - v11.11** | `8.* / 9.*` | `^8.0` |
104104
| **v11.6 - v11.9** | `5.8.* / 6.* / 7.* / 8.*` | `>=7.2` |

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@
3131
},
3232
"require": {
3333
"php": "^8.0",
34-
"illuminate/contracts": "^8.0 || ^9.0 || ^10.0 || ^11.0",
35-
"illuminate/database": "^8.0 || ^9.0 || ^10.0 || ^11.0",
36-
"illuminate/support": "^8.0 || ^9.0 || ^10.0 || ^11.0"
34+
"illuminate/contracts": "^9.0 || ^10.0 || ^11.0",
35+
"illuminate/database": "^9.0 || ^10.0 || ^11.0",
36+
"illuminate/support": "^9.0 || ^10.0 || ^11.0"
3737
},
3838
"require-dev": {
39+
"larastan/larastan": "^2.0",
3940
"laravel/legacy-factories": "^1.0.4",
4041
"laravel/pint": "^1.0",
4142
"mockery/mockery": "^1.3.3",
42-
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0 || ^9.0",
43+
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
4344
"phpunit/phpunit": "^10.0"
4445
},
4546
"minimum-stability": "dev",
@@ -66,6 +67,7 @@
6667
},
6768
"scripts": {
6869
"fix": "@php vendor/bin/pint",
70+
"phpstan": "@php vendor/bin/phpstan analyse",
6971
"test": "@php vendor/bin/phpunit",
7072
"test-coverage": "@php vendor/bin/phpunit --coverage-html=build"
7173
}

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ echo $post->translate('fr')->title; // Mon premier post
7575

7676
| Package | Laravel | PHP |
7777
| :------------------ | :---------------------------- | :-------- |
78-
| **v11.13 - v11.13** | `8.* / 9.* / 10.*` / `11.*` | `^8.0` |
78+
| **v11.13 - v11.13** | `9.* / 10.* / 11.*` | `^8.0` |
7979
| **v11.12 - v11.12** | `8.* / 9.* / 10.*` | `^8.0` |
8080
| **v11.10 - v11.11** | `8.* / 9.*` | `^8.0` |
8181
| **v11.6 - v11.9** | `5.8.* / 6.* / 7.* / 8.*` | `>=7.2` |

phpstan.neon

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
includes:
2+
- vendor/larastan/larastan/extension.neon
3+
4+
parameters:
5+
6+
paths:
7+
- src/
8+
9+
# Level 9 is the highest level
10+
level: 6
11+
12+
# ignoreErrors:
13+
# - '#PHPDoc tag @var#'
14+
#
15+
# excludePaths:
16+
# - ./*/*/FileToBeExcluded.php
17+
#
18+
# checkMissingIterableValueType: false

src/Translatable/Exception/LocalesNotDefinedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class LocalesNotDefinedException extends \Exception
66
{
77
public static function make(): self
88
{
9-
return new static('Please make sure you have run `php artisan vendor:publish --provider="Astrotomic\Translatable\TranslatableServiceProvider"` and that the locales configuration is defined.');
9+
return new self('Please make sure you have run `php artisan vendor:publish --provider="Astrotomic\Translatable\TranslatableServiceProvider"` and that the locales configuration is defined.');
1010
}
1111
}

0 commit comments

Comments
 (0)