Skip to content

Commit

Permalink
Merge pull request #402 from kcassam/main
Browse files Browse the repository at this point in the history
feat: add phpstan and correct till level 5
  • Loading branch information
Gummibeer authored Apr 17, 2024
2 parents c74dfa5 + 7043d60 commit b23afbb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"illuminate/support": "^8.0 || ^9.0 || ^10.0"
},
"require-dev": {
"larastan/larastan": "^2.0",
"laravel/legacy-factories": "^1.0.4",
"mockery/mockery": "^1.3.3",
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0",
Expand Down Expand Up @@ -65,6 +66,7 @@
},
"scripts": {
"csfix": "php-cs-fixer fix --using-cache=no",
"phpstan": "./vendor/bin/phpstan analyse",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html=build"
}
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 b23afbb

Please sign in to comment.