Skip to content

Commit

Permalink
Merge pull request #405 from Astrotomic/phpstan-5
Browse files Browse the repository at this point in the history
add phpstan and correct till level 5
  • Loading branch information
Gummibeer committed Apr 17, 2024
2 parents 990e2c1 + cd5ba70 commit 6eafff2
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ jobs:
fail-fast: false
matrix:
php: [8.0, 8.1, 8.2, 8.3]
laravel: [8.*, 9.*, 10.*, 11.*]
laravel: [9.*, 10.*, 11.*]
dependency-version: [prefer-stable]
os: [ubuntu-latest]
include:
- laravel: '8.*'
phpunit: '9.*'
- laravel: '9.*'
phpunit: '9.*'
- laravel: '10.*'
Expand All @@ -31,10 +29,6 @@ jobs:
laravel: '10.*'
- php: '8.0'
laravel: '11.*'
- php: '8.2'
laravel: '8.*'
- php: '8.3'
laravel: '8.*'
- php: '8.3'
laravel: '9.*'
- php: '8.1'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ If you discover any security related issues, please check [SECURITY](https://git

| Package | Laravel | PHP |
| :------------------ | :---------------------------- | :-------- |
| **v11.13 - v11.13** | `8.* / 9.* / 10.*` / `11.*` | `^8.0` |
| **v11.13 - v11.13** | `9.* / 10.* / 11.*` | `^8.0` |
| **v11.12 - v11.12** | `8.* / 9.* / 10.*` | `^8.0` |
| **v11.10 - v11.11** | `8.* / 9.*` | `^8.0` |
| **v11.6 - v11.9** | `5.8.* / 6.* / 7.* / 8.*` | `>=7.2` |
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@
},
"require": {
"php": "^8.0",
"illuminate/contracts": "^8.0 || ^9.0 || ^10.0 || ^11.0",
"illuminate/database": "^8.0 || ^9.0 || ^10.0 || ^11.0",
"illuminate/support": "^8.0 || ^9.0 || ^10.0 || ^11.0"
"illuminate/contracts": "^9.0 || ^10.0 || ^11.0",
"illuminate/database": "^9.0 || ^10.0 || ^11.0",
"illuminate/support": "^9.0 || ^10.0 || ^11.0"
},
"require-dev": {
"larastan/larastan": "^2.0",
"laravel/legacy-factories": "^1.0.4",
"laravel/pint": "^1.0",
"mockery/mockery": "^1.3.3",
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
"phpunit/phpunit": "^10.0"
},
"minimum-stability": "dev",
Expand All @@ -66,6 +67,7 @@
},
"scripts": {
"fix": "@php vendor/bin/pint",
"phpstan": "@php vendor/bin/phpstan analyse",
"test": "@php vendor/bin/phpunit",
"test-coverage": "@php vendor/bin/phpunit --coverage-html=build"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ echo $post->translate('fr')->title; // Mon premier post

| Package | Laravel | PHP |
| :------------------ | :---------------------------- | :-------- |
| **v11.13 - v11.13** | `8.* / 9.* / 10.*` / `11.*` | `^8.0` |
| **v11.13 - v11.13** | `9.* / 10.* / 11.*` | `^8.0` |
| **v11.12 - v11.12** | `8.* / 9.* / 10.*` | `^8.0` |
| **v11.10 - v11.11** | `8.* / 9.*` | `^8.0` |
| **v11.6 - v11.9** | `5.8.* / 6.* / 7.* / 8.*` | `>=7.2` |
Expand Down
18 changes: 18 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
includes:
- vendor/larastan/larastan/extension.neon

parameters:

paths:
- src/

# Level 9 is the highest level
level: 6

# ignoreErrors:
# - '#PHPDoc tag @var#'
#
# excludePaths:
# - ./*/*/FileToBeExcluded.php
#
# checkMissingIterableValueType: false
2 changes: 1 addition & 1 deletion src/Translatable/Exception/LocalesNotDefinedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class LocalesNotDefinedException extends \Exception
{
public static function make(): self
{
return new static('Please make sure you have run `php artisan vendor:publish --provider="Astrotomic\Translatable\TranslatableServiceProvider"` and that the locales configuration is defined.');
return new self('Please make sure you have run `php artisan vendor:publish --provider="Astrotomic\Translatable\TranslatableServiceProvider"` and that the locales configuration is defined.');
}
}

0 comments on commit 6eafff2

Please sign in to comment.