From cb8c2c41853ef76f3d97372b6f31ad08a07ed6b8 Mon Sep 17 00:00:00 2001 From: Brian Dunne Date: Wed, 5 Mar 2025 21:48:20 -0600 Subject: [PATCH 1/2] [Doc] Cover all errors of PEAR ClassDeclaration While reviewing PR #844 for the Squiz version of this sniff, jrfnl discovered that the PEAR sniff's documentation did not cover all error conditions. This adds code examples for all missing errors that should be caught by this sniff. --- .../Docs/Classes/ClassDeclarationStandard.xml | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml b/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml index b5d53fdf07..abfd33b1d7 100644 --- a/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml +++ b/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml @@ -19,4 +19,78 @@ class Foo { ]]> + + + { +} + ]]> + + + +{ +} + ]]> + + + + + { +} + ]]> + + + public function __construct() {} +} + ]]> + + + + + + + + { + } +} + ]]> + + + { +} +} + ]]> + + + + + { +} + ]]> + + + { + } + ]]> + + From 93f570b46d740e47af226ca49d3e94a55f60ac88 Mon Sep 17 00:00:00 2001 From: Brian Dunne Date: Wed, 14 May 2025 22:54:49 -0500 Subject: [PATCH 2/2] Clean up PEAR Class Declaration sniff doc Per advice from @jrfnl, clarified some language and combined some invalid examples to tighten the docs for this sniff. --- .../Docs/Classes/ClassDeclarationStandard.xml | 58 ++++++------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml b/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml index abfd33b1d7..c6de4fecfb 100644 --- a/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml +++ b/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml @@ -1,7 +1,7 @@ - + @@ -12,24 +12,12 @@ class Foo } ]]> - + { +class BraceOnSignatureLine { } - ]]> - - - - - { -} - ]]> - - - { } @@ -44,7 +32,7 @@ class Foo } ]]> - + public function __construct() {} @@ -54,40 +42,32 @@ class Foo - + { } } - ]]> - - - { -} } ]]> - - - + { } - ]]> - - - { } ]]>