From f121784e12c2b116e37b7a83132c66f747530179 Mon Sep 17 00:00:00 2001 From: webimpress Date: Mon, 28 Jan 2019 16:50:24 +0000 Subject: [PATCH 1/2] Disable Generic.CodeAnalysis.UselessOverridingMethod sniff Fixes #12 The sniff is not working properly in case we are overridding the method and changing default value of parameters. Please see: * https://github.com/zendframework/zend-coding-standard/issues/12 * https://github.com/squizlabs/PHP_CodeSniffer/issues/519 --- src/ZendCodingStandard/ruleset.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ZendCodingStandard/ruleset.xml b/src/ZendCodingStandard/ruleset.xml index b29cd35..16473eb 100644 --- a/src/ZendCodingStandard/ruleset.xml +++ b/src/ZendCodingStandard/ruleset.xml @@ -134,7 +134,13 @@ + From 1a856cc0ef93621f95507143256c7ecd4fdbed8a Mon Sep 17 00:00:00 2001 From: webimpress Date: Mon, 28 Jan 2019 16:52:32 +0000 Subject: [PATCH 2/2] Removed documentation as the sniff is no longer included in ruleset --- docs/book/v2/coding-style-guide.md | 1 - docs/book/v2/ruleset.md | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/docs/book/v2/coding-style-guide.md b/docs/book/v2/coding-style-guide.md index f73f5cf..777896b 100644 --- a/docs/book/v2/coding-style-guide.md +++ b/docs/book/v2/coding-style-guide.md @@ -356,7 +356,6 @@ $instance = new class extends Foo implements - The code may not contain unreachable code. [*](ruleset.md#squizphpnonexecutablecode) - The backtick operator may not be used for execution of shell commands. [*](ruleset.md#genericphpbacktickoperator) - Class and Interface names should be unique in a project and must have a unique fully qualified name. [*](ruleset.md#genericclassesduplicateclassname) -- Methods that only call the parent method should not be defined. [*](ruleset.md#genericcodeanalysisuselessoverridingmethod) - Files that contain PHP code should only have PHP code and should not have any _"inline HTML"_. [*](ruleset.md#genericfilesinlinehtml) - There must be exactly one space after a type cast. [*](ruleset.md#genericformattingspaceaftercast) - Constructors should be named `__construct`, not after the class. [*](ruleset.md#genericnamingconventionsconstructorname) diff --git a/docs/book/v2/ruleset.md b/docs/book/v2/ruleset.md index e4c5d2f..7b4b830 100644 --- a/docs/book/v2/ruleset.md +++ b/docs/book/v2/ruleset.md @@ -113,34 +113,6 @@ final class Foo } ``` -### Generic.CodeAnalysis.UselessOverridingMethod -Methods that only call the parent method should not be defined. - -*Valid: A method that extends functionality on a parent method.* -```php -doSomethingElse(); - } -} -``` - -*Invalid: An overriding method that only calls the parent.* -```php -