Skip to content

Commit 8b58002

Browse files
authored
Merge pull request #13 from Kocal/extension-neon
2 parents 769874e + 4e96d5a commit 8b58002

File tree

14 files changed

+57
-5
lines changed

14 files changed

+57
-5
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@ To install the PHPStan rules for Symfony UX, you can use Composer:
1010
composer require --dev kocal/phpstan-symfony-ux
1111
```
1212

13-
## Configuration
13+
If you have [phpstan/extension-installer](https://github.com/phpstan/extension-installer) installed (which is the case by default), the extension will be automatically registered and you're ready to go.
14+
15+
If you don't use the extension installer, you'll need to manually add the extension to your `phpstan.neon` or `phpstan.dist.neon` configuration file:
16+
17+
```yaml
18+
includes:
19+
- vendor/kocal/phpstan-symfony-ux/extension.neon
20+
```
1421
15-
After installing the package, you need to configure PHPStan to use the rules.
22+
## Configuration
1623
17-
Each rule can be enabled individually by adding it to your `phpstan.dist.neon` configuration file.
24+
Each rule can be enabled individually by adding it to your `phpstan.neon` or `phpstan.dist.neon` configuration file.
1825

1926
## LiveComponent Rules
2027

composer.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "kocal/phpstan-symfony-ux",
33
"description": "PHPStan rules for Symfony UX",
4-
"type": "library",
4+
"type": "phpstan-extension",
55
"license": "MIT",
66
"authors": [
77
{
@@ -40,8 +40,18 @@
4040
"symfony/ux-twig-component": "^2.0",
4141
"symplify/easy-coding-standard": "^13.0"
4242
},
43+
"extra": {
44+
"phpstan": {
45+
"includes": [
46+
"extension.neon"
47+
]
48+
}
49+
},
4350
"config": {
44-
"sort-packages": true
51+
"sort-packages": true,
52+
"allow-plugins": {
53+
"phpstan/extension-installer": true
54+
}
4555
},
4656
"minimum-stability": "dev",
4757
"prefer-stable": true

extension.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This file is intentionally empty for backward compatibility purposes.
2+
# Rules must be enabled individually in your phpstan.neon configuration.
3+
# See README.md for available rules and their configuration.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
includes:
2+
- ../../../../test-extension.neon
3+
14
rules:
25
- Kocal\PHPStanSymfonyUX\Rules\LiveComponent\LiveActionMethodsShouldBePublicRule
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
includes:
2+
- ../../../../test-extension.neon
3+
14
rules:
25
- Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ClassMustBeFinalRule
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
includes:
2+
- ../../../../test-extension.neon
3+
14
rules:
25
- Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ClassNameShouldNotEndWithComponentRule
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
includes:
2+
- ../../../../test-extension.neon
3+
14
rules:
25
- Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ExposePublicPropsShouldBeFalseRule
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
includes:
2+
- ../../../../test-extension.neon
3+
14
rules:
25
- Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ForbiddenAttributesPropertyRule
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
includes:
2+
- ../../../../test-extension.neon
3+
14
rules:
25
- Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ForbiddenClassPropertyRule
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
includes:
2+
- ../../../../test-extension.neon
3+
14
rules:
25
- Kocal\PHPStanSymfonyUX\Rules\TwigComponent\MethodsShouldBePublicOrPrivateRule

0 commit comments

Comments
 (0)