Skip to content

Commit

Permalink
Fix: Move parameters configuration into ergebnis scope
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 9, 2019
1 parent 1d1a91c commit 1e1ae7b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 deletions.
41 changes: 39 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

For a full diff see [`0.13.0...master`][0.13.0...master].
For a full diff see [`0.14.0...master`][0.14.0...master].

## [`0.14.0`][0.14.0]

For a full diff see [`0.13.0...0.14.0`][0.13.0...0.14.0].

### Changed

Expand Down Expand Up @@ -43,6 +47,36 @@ For a full diff see [`0.13.0...master`][0.13.0...master].

to delete backup files created in the previous step.

* Moved paramaters into `ergebnis` section to prevent conflicts with global parameters ([#158]), by [@localheinz]

Where previously `phpstan.neon` looked like the following

```neon
parameters:
allowAbstractClasses: true
classesAllowedToBeExtended: []
classesNotRequiredToBeAbstractOrFinal: []
interfacesImplementedByContainers:
- Psr\Container\ContainerInterface
```

these parameters now need to be moved into an `ergebnis` section:

```diff
parameters:
- allowAbstractClasses: true
- classesAllowedToBeExtended: []
- classesNotRequiredToBeAbstractOrFinal: []
- interfacesImplementedByContainers:
- - Psr\Container\ContainerInterface
+ ergebnis:
+ allowAbstractClasses: true
+ classesAllowedToBeExtended: []
+ classesNotRequiredToBeAbstractOrFinal: []
+ interfacesImplementedByContainers:
+ - Psr\Container\ContainerInterface
```

### Fixed

* Dropped support for PHP 7.1 ([#141], by [@localheinz]
Expand Down Expand Up @@ -243,6 +277,7 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[0.12.1]: https://github.com/ergebnis/phpstan-rules/releases/tag/0.12.1
[0.12.2]: https://github.com/ergebnis/phpstan-rules/releases/tag/0.12.2
[0.13.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/0.13.0
[0.14.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/0.14.0

[362c7ea...0.1.0]: https://github.com/ergebnis/phpstan-rules/compare/362c7ea...0.1.0
[0.1.0...0.2.0]: https://github.com/ergebnis/phpstan-rules/compare/0.1.0...0.2.0
Expand All @@ -262,7 +297,8 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[0.12.0...0.12.1]: https://github.com/ergebnis/phpstan-rules/compare/0.12.0...0.12.1
[0.12.1...0.12.2]: https://github.com/ergebnis/phpstan-rules/compare/0.12.1...0.12.2
[0.12.2...0.13.0]: https://github.com/ergebnis/phpstan-rules/compare/0.12.2...0.13.0
[0.13.0...master]: https://github.com/ergebnis/phpstan-rules/compare/0.13.0...master
[0.13.0...0.14.0]: https://github.com/ergebnis/phpstan-rules/compare/0.13.0...0.14.0
[0.14.0...master]: https://github.com/ergebnis/phpstan-rules/compare/0.14.0...master

[#1]: https://github.com/ergebnis/phpstan-rules/pull/1
[#4]: https://github.com/ergebnis/phpstan-rules/pull/4
Expand Down Expand Up @@ -306,6 +342,7 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[#141]: https://github.com/ergebnis/phpstan-rules/pull/141
[#147]: https://github.com/ergebnis/phpstan-rules/pull/147
[#157]: https://github.com/ergebnis/phpstan-rules/pull/157
[#158]: https://github.com/ergebnis/phpstan-rules/pull/158

[@ergebnis]: https://github.com/ergebnis
[@localheinz]: https://github.com/localheinz
7 changes: 4 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ includes:
- rules.neon

parameters:
classesAllowedToBeExtended:
- Ergebnis\PHPStan\Rules\Test\Integration\AbstractTestCase
- PHPStan\Testing\RuleTestCase
ergebnis:
classesAllowedToBeExtended:
- Ergebnis\PHPStan\Rules\Test\Integration\AbstractTestCase
- PHPStan\Testing\RuleTestCase
excludes_analyse:
- %currentWorkingDirectory%/test/Fixture/
inferPrivatePropertyTypeFromConstructor: true
Expand Down
18 changes: 10 additions & 8 deletions rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ parameters:
- Psr\Container\ContainerInterface

parametersSchema:
allowAbstractClasses: bool()
classesAllowedToBeExtended: listOf(string())
classesNotRequiredToBeAbstractOrFinal: listOf(string())
interfacesImplementedByContainers: listOf(string())
ergebnis: structure([
allowAbstractClasses: bool()
classesAllowedToBeExtended: listOf(string())
classesNotRequiredToBeAbstractOrFinal: listOf(string())
interfacesImplementedByContainers: listOf(string())
])

rules:
- Ergebnis\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
Expand All @@ -35,20 +37,20 @@ services:
-
class: Ergebnis\PHPStan\Rules\Classes\FinalRule
arguments:
allowAbstractClasses: %allowAbstractClasses%
classesNotRequiredToBeAbstractOrFinal: %classesNotRequiredToBeAbstractOrFinal%
allowAbstractClasses: %ergebnis.allowAbstractClasses%
classesNotRequiredToBeAbstractOrFinal: %ergebnis.classesNotRequiredToBeAbstractOrFinal%
tags:
- phpstan.rules.rule
-
class: Ergebnis\PHPStan\Rules\Classes\NoExtendsRule
arguments:
classesAllowedToBeExtended: %classesAllowedToBeExtended%
classesAllowedToBeExtended: %ergebnis.classesAllowedToBeExtended%
tags:
- phpstan.rules.rule

-
class: Ergebnis\PHPStan\Rules\Methods\NoParameterWithContainerTypeDeclarationRule
arguments:
interfacesImplementedByContainers: %interfacesImplementedByContainers%
interfacesImplementedByContainers: %ergebnis.interfacesImplementedByContainers%
tags:
- phpstan.rules.rule

0 comments on commit 1e1ae7b

Please sign in to comment.