Skip to content

Commit

Permalink
Merge pull request #215 from ergebnis/feature/no-superfluous-phpdoc-tags
Browse files Browse the repository at this point in the history
Enhancement: Enable and configure no_superfluous_phpdoc_tags fixer
  • Loading branch information
ergebnis-bot committed Oct 21, 2020
2 parents de56d93 + e2ff2b3 commit 309a510
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 26 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

For a full diff see [`2.3.0...main`][2.3.0...main].
For a full diff see [`2.4.0...main`][2.4.0...main].

## [`2.4.0`][2.4.0]

For a full diff see [`2.3.0...2.4.0`][2.3.0...2.4.0].

### Changed

* Enabled `no_superfluous_phpdoc_tags` fixer ([#215]), by [@localheinz]

## [`2.3.0`][2.3.0]

Expand Down Expand Up @@ -103,6 +111,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[2.2.1]: https://github.com/ergebnis/php-cs-fixer-config/releases/tag/2.2.1
[2.2.2]: https://github.com/ergebnis/php-cs-fixer-config/releases/tag/2.2.2
[2.3.0]: https://github.com/ergebnis/php-cs-fixer-config/releases/tag/2.3.0
[2.4.0]: https://github.com/ergebnis/php-cs-fixer-config/releases/tag/2.4.0

[d899e77...1.0.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/d899e77...1.0.0
[1.0.0...1.1.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/1.0.0...1.1.0
Expand All @@ -115,7 +124,8 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[2.2.0...2.2.1]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.2.0...2.2.1
[2.2.1...2.2.2]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.2.1...2.2.2
[2.2.2...2.3.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.2.1...2.3.0
[2.3.0...main]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.3.0...main
[2.3.0...2.4.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.3.0...2.4.0
[2.4.0...main]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.4.0...main

[#3]: https://github.com/ergebnis/php-cs-fixer-config/pull/3
[#14]: https://github.com/ergebnis/php-cs-fixer-config/pull/14
Expand All @@ -127,6 +137,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[#135]: https://github.com/ergebnis/php-cs-fixer-config/pull/135
[#168]: https://github.com/ergebnis/php-cs-fixer-config/pull/168
[#200]: https://github.com/ergebnis/php-cs-fixer-config/pull/200
[#215]: https://github.com/ergebnis/php-cs-fixer-config/pull/215

[@dependabot]: https://github.com/apps/dependabot
[@linuxjuggler]: https://github.com/linuxjuggler
Expand Down
5 changes: 0 additions & 5 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ final class Factory
/**
* Creates a configuration based on a rule set.
*
* @param RuleSet $ruleSet
* @param array $overrideRules
*
* @throws \RuntimeException
*
* @return Config
*/
public static function fromRuleSet(RuleSet $ruleSet, array $overrideRules = []): Config
{
Expand Down
6 changes: 0 additions & 6 deletions src/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,18 @@ interface RuleSet
{
/**
* Returns the name of the rule set.
*
* @return string
*/
public function name(): string;

/**
* Returns an array of rules along with their configuration.
*
* @return array
*/
public function rules(): array;

/**
* Returns the minimum required PHP version (PHP_VERSION_ID).
*
* @see http://php.net/manual/en/reserved.constants.php
*
* @return int
*/
public function targetPhpVersion(): int;
}
6 changes: 5 additions & 1 deletion src/RuleSet/Php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ final class Php71 extends AbstractRuleSet
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => false,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_unused_params' => false,
'remove_inheritdoc' => false,
],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
Expand Down
6 changes: 5 additions & 1 deletion src/RuleSet/Php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ final class Php73 extends AbstractRuleSet
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => false,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_unused_params' => false,
'remove_inheritdoc' => false,
],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
Expand Down
6 changes: 5 additions & 1 deletion src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ final class Php74 extends AbstractRuleSet
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => false,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_unused_params' => false,
'remove_inheritdoc' => false,
],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
Expand Down
2 changes: 0 additions & 2 deletions test/Unit/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public function targetPhpVersion(): int

/**
* @dataProvider providerTargetPhpVersion
*
* @param int $targetPhpVersion
*/
public function testFromRuleSetCreatesConfig(int $targetPhpVersion): void
{
Expand Down
5 changes: 0 additions & 5 deletions test/Unit/RuleSet/AbstractRuleSetTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ final public function providerValidHeader(): \Generator
/**
* @dataProvider providerRuleNames
*
* @param string $source
* @param string[] $ruleNames
*/
final public function testRulesAreSortedByName(string $source, array $ruleNames): void
Expand Down Expand Up @@ -159,8 +158,6 @@ final public function providerRuleNames(): \Generator

/**
* @throws \RuntimeException
*
* @return string
*/
final protected static function className(): string
{
Expand Down Expand Up @@ -188,8 +185,6 @@ final protected static function className(): string
* @param string $header
*
* @throws \RuntimeException
*
* @return Config\RuleSet
*/
final protected static function createRuleSet($header = null): Config\RuleSet
{
Expand Down
6 changes: 5 additions & 1 deletion test/Unit/RuleSet/Php71Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ final class Php71Test extends AbstractRuleSetTestCase
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => false,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_unused_params' => false,
'remove_inheritdoc' => false,
],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
Expand Down
6 changes: 5 additions & 1 deletion test/Unit/RuleSet/Php73Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ final class Php73Test extends AbstractRuleSetTestCase
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => false,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_unused_params' => false,
'remove_inheritdoc' => false,
],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
Expand Down
6 changes: 5 additions & 1 deletion test/Unit/RuleSet/Php74Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ final class Php74Test extends AbstractRuleSetTestCase
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => false,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_unused_params' => false,
'remove_inheritdoc' => false,
],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
Expand Down

0 comments on commit 309a510

Please sign in to comment.