Skip to content

Commit

Permalink
Add PHPStan and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
svpernova09 committed Jan 30, 2024
1 parent f406c0e commit 91b3278
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress

- name: Run PhpStan
run: vendor/bin/phpstan analyse src tests

- name: Execute tests
run: vendor/bin/phpunit --verbose
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"dms/phpunit-arraysubset-asserts": "^0.2.1"
"dms/phpunit-arraysubset-asserts": "^0.2.1",
"phpstan/phpstan": "^1.10"
},
"license": "MIT",
"authors": [
Expand Down
64 changes: 63 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions phpstan.src.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
parameters:
paths:
- src
level: 0
ignoreErrors:
- "#\\(void\\) is used#"
- "#Access to an undefined property#"
- "#Call to an undefined method#"
- "#but return statement is missing.#"
- "#Caught class [a-zA-Z0-9\\\\_]+ not found.#"
- "#Class [a-zA-Z0-9\\\\_]+ not found.#"
- "#has invalid type#"
- "#should always throw an exception or terminate script execution#"
- "#Instantiated class [a-zA-Z0-9\\\\_]+ not found.#"
- "#Unsafe usage of new static#"
excludePaths:
- "src/Illuminate/Testing/ParallelRunner.php"
2 changes: 1 addition & 1 deletion src/Settings/JsonSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Laravel\Homestead\Settings;

class JsonSettings extends HomesteadSettings
final class JsonSettings extends HomesteadSettings
{
/**
* Create an instance from a file.
Expand Down
2 changes: 1 addition & 1 deletion src/Settings/YamlSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Symfony\Component\Yaml\Yaml;

class YamlSettings extends HomesteadSettings
final class YamlSettings extends HomesteadSettings
{
/**
* Create an instance from a file.
Expand Down

0 comments on commit 91b3278

Please sign in to comment.