Skip to content

Commit

Permalink
task: Add PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaswolf committed Mar 8, 2024
1 parent defe494 commit 6310bc9
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint_test_pull_requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
command: 'style:php'
- name: Composer normalize
command: 'normalize --dry-run'
- name: PHPStan
command: analyze:php
directory: ['extension-installer', 'fractor', 'fractor-xml', 'typo3-fractor']
name: ${{ matrix.composer-command.name }}/${{ matrix.directory }}
defaults:
Expand Down
2 changes: 2 additions & 0 deletions extension-installer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"require-dev": {
"composer/composer": "^2.7",
"ergebnis/composer-normalize": "^2.42",
"phpstan/phpstan": "^1.10",
"symplify/easy-coding-standard": "^12.1"
},
"autoload": {
Expand All @@ -34,6 +35,7 @@
"class": "a9f\\FractorExtensionInstaller\\InstallerPlugin"
},
"scripts": {
"analyze:php": "phpstan analyze",
"style:php": "ecs"
}
}
5 changes: 5 additions & 0 deletions extension-installer/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 8

paths:
- src/
1 change: 1 addition & 0 deletions fractor-xml/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"sort-packages": true
},
"scripts": {
"analyze:php": "phpstan analyze",
"style:php": "ecs"
}
}
6 changes: 6 additions & 0 deletions fractor-xml/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 8

paths:
- src/
- tests/
3 changes: 2 additions & 1 deletion fractor/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"require-dev": {
"ergebnis/composer-normalize": "^2.42",
"phpstan/phpstan": "1.10",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"symplify/easy-coding-standard": "^12.1"
},
Expand All @@ -44,6 +44,7 @@
"sort-packages": true
},
"scripts": {
"analyze:php": "phpstan analyze",
"style:php": "ecs"
}
}
6 changes: 6 additions & 0 deletions fractor/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 8

paths:
- src/
- tests/
7 changes: 5 additions & 2 deletions fractor/src/Configuration/FractorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

final class FractorConfig extends ContainerBuilder
{
/** @var non-empty-list<non-empty-string> */
/** @var list<non-empty-string> */
private array $paths = [];

/**
Expand All @@ -34,7 +34,7 @@ public function setPaths(array $paths): self
}

/**
* @return non-empty-list<non-empty-string>
* @return list<non-empty-string>
*/
public function getPaths(): array
{
Expand All @@ -58,6 +58,9 @@ public function getFileProcessors(): array
return $this->processors;
}

/**
* @param list<non-empty-string> $extensions
*/
public function setFileExtensions(array $extensions): self
{
$this->fileExtensions = $extensions;
Expand Down
1 change: 1 addition & 0 deletions typo3-fractor/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"sort-packages": true
},
"scripts": {
"analyze:php": "phpstan analyze",
"style:php": "ecs"
}
}
6 changes: 6 additions & 0 deletions typo3-fractor/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 8

paths:
- src/
- tests/

0 comments on commit 6310bc9

Please sign in to comment.