From 87f1d4d6d5123a7013f2b592c6162d5852daa316 Mon Sep 17 00:00:00 2001 From: Jon McPartland Date: Mon, 19 Feb 2024 15:06:48 +0000 Subject: [PATCH 1/7] Docs: add documentation for Squiz.WhiteSpace.ScopeClosingBrace --- .../WhiteSpace/ScopeClosingBraceStandard.xml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml diff --git a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml new file mode 100644 index 0000000000..b7b4ebd385 --- /dev/null +++ b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -0,0 +1,47 @@ + + + + + + + { + echo 'hi'; +} +]]> + + + } +]]> + + + + + + + + } +]]> + + + } +]]> + + + From a2ca0b82031c8f937a2f2b6331e67edd1823635f Mon Sep 17 00:00:00 2001 From: Jon McPartland Date: Fri, 23 Feb 2024 17:32:58 +0000 Subject: [PATCH 2/7] Docs: improve documentation for Squiz.WhiteSpace.ScopeClosingBrace - Fixup CDATA indentation - Improve wording in code examples - Add more varied code examples --- .../WhiteSpace/ScopeClosingBraceStandard.xml | 72 ++++++++++++++----- 1 file changed, 53 insertions(+), 19 deletions(-) diff --git a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml index b7b4ebd385..c22a87a636 100644 --- a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -1,25 +1,63 @@ - + { - echo 'hi'; -} -]]> +{ + echo 'opening brace at column 1'; + echo 'closing brace at column 1'; +} + ]]> - + } -]]> + ]]> + + + + + } + ]]> + + + } + ]]> + + + + + $b) { + echo 'conditional starts at column 1'; + echo 'closing brace at column 1'; +} + ]]> + + + $b) { + echo 'conditional starts at column 1'; + echo 'closing brace at column 5'; + } + ]]> @@ -28,20 +66,16 @@ function foo() ]]> - + } -]]> + ]]> - + } -]]> +enum Foo {} + ]]> From b0906bb50b23c15c1a31866ec1be477f40b6e09b Mon Sep 17 00:00:00 2001 From: Jon McPartland Date: Mon, 26 Feb 2024 14:13:44 +0000 Subject: [PATCH 3/7] Docs: clarify wording and code samples for Squiz.WhiteSpace.ScopeClosingBrace --- .../WhiteSpace/ScopeClosingBraceStandard.xml | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml index c22a87a636..c6314a3a36 100644 --- a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -12,6 +12,21 @@ function foo() echo 'opening brace at column 1'; echo 'closing brace at column 1'; } + +class Foo { + echo 'class keyword starts at column 1'; + echo 'closing brace at column 1'; +} + +if ($a > $b) { + echo 'conditional starts at column 1'; + echo 'closing brace at column 1'; +} + + +

conditional opening tag at column 1

+

conditional closing tag at column 1

+ ]]>
@@ -21,42 +36,21 @@ function foo() echo 'opening brace at column 1'; echo 'closing brace at column 2'; } - ]]> - - - - - } - ]]> - - - } - ]]> - - - - - $b) { - echo 'conditional starts at column 1'; - echo 'closing brace at column 1'; -} - ]]> - - - $b) { echo 'conditional starts at column 1'; echo 'closing brace at column 5'; } + + +

conditional opening tag at column 1

+

conditional closing tag at column 2

+ ]]>
@@ -66,13 +60,13 @@ if ($a > $b) { ]]> - + } ]]> - + } ]]> From daea34de03386afa057549c0b745c8972a107cfe Mon Sep 17 00:00:00 2001 From: Jon McPartland Date: Mon, 26 Feb 2024 14:35:02 +0000 Subject: [PATCH 4/7] Docs: combine code examples in Squiz.WhiteSpace.ScopeClosingBrace Better illustrates that statements can be indented, and that their closing braces still should align with the start of the statement. --- .../WhiteSpace/ScopeClosingBraceStandard.xml | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml index c6314a3a36..e2863d1b60 100644 --- a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -5,7 +5,7 @@ ]]> - + } -class Foo { - echo 'class keyword starts at column 1'; - echo 'closing brace at column 1'; -} - -if ($a > $b) { - echo 'conditional starts at column 1'; - echo 'closing brace at column 1'; +if (!class_exists('Foo')) { + class Foo { + } } @@ -29,7 +24,7 @@ if ($a > $b) { ]]> - + } -class Foo { - echo 'class keyword starts at column 1'; - echo 'closing brace at column 2'; - } - -if ($a > $b) { - echo 'conditional starts at column 1'; - echo 'closing brace at column 5'; - } +if (!class_exists('Foo')) { + class Foo { + } + }

conditional opening tag at column 1

From 20050f105576811764aa036ce3678a5415e7db70 Mon Sep 17 00:00:00 2001 From: Jon McPartland Date: Fri, 1 Mar 2024 12:23:43 +0000 Subject: [PATCH 5/7] Docs: improve examples for Squiz.WhiteSpace.ScopeClosingBrace - Reduces wordiness - Adds an example of too little whitespace --- .../WhiteSpace/ScopeClosingBraceStandard.xml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml index e2863d1b60..b9d39a371c 100644 --- a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -9,18 +9,19 @@ } + function bar() + { + } + if (!class_exists('Foo')) { class Foo { } } -

conditional opening tag at column 1

-

conditional closing tag at column 1

+

some output

]]>
@@ -28,18 +29,19 @@ if (!class_exists('Foo')) { } + function bar() + { + } + if (!class_exists('Foo')) { class Foo { } } -

conditional opening tag at column 1

-

conditional closing tag at column 2

+

some output

]]>
From 3d9c5b1fd25bceda74e6b15a85f4d7d15f7b49e0 Mon Sep 17 00:00:00 2001 From: Jon McPartland Date: Fri, 1 Mar 2024 12:30:38 +0000 Subject: [PATCH 6/7] Docs: add missing emphasis in Squiz.WhiteSpace.ScopeClosingBrace --- .../Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml index b9d39a371c..12a641a81e 100644 --- a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -22,7 +22,7 @@ if (!class_exists('Foo')) {

some output

- + ]]>
@@ -42,7 +42,7 @@ if (!class_exists('Foo')) {

some output

- + ]]>
From b5cd72fc06b3c2fc0a905f1918e3fe9b850494d1 Mon Sep 17 00:00:00 2001 From: Jon McPartland Date: Fri, 1 Mar 2024 15:21:00 +0000 Subject: [PATCH 7/7] Docs: improve code examples for Squiz.WhiteSpace.ScopeClosingBrace - Combine too little with too much whitespace - Adjust emphasis on example containing PHP tags - Change example paragraph to span for better HTML formatting --- .../WhiteSpace/ScopeClosingBraceStandard.xml | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml index 12a641a81e..3284df973c 100644 --- a/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ b/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -11,18 +11,14 @@ function foo() { } - function bar() - { - } - if (!class_exists('Foo')) { class Foo { } } -

some output

- + some output + ?> ]]>
@@ -31,18 +27,14 @@ function foo() { } - function bar() - { - } - if (!class_exists('Foo')) { class Foo { - } - } +} + } -

some output

- + some output + ?> ]]>