From ac45798ad4fa71b38932987da93d9e62b57f2e39 Mon Sep 17 00:00:00 2001 From: Rafael Funchal Date: Tue, 17 Sep 2024 11:58:29 -0700 Subject: [PATCH 1/5] Adding documentation for WordPress.Arrays.ArrayDeclarationSpacing --- .../ArrayDeclarationSpacingStandard.xml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml diff --git a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml new file mode 100644 index 0000000000..f70bbac505 --- /dev/null +++ b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml @@ -0,0 +1,51 @@ + + + + + + + + 'post_id' => 22, + 'category' => 1 +); + ]]> + + + 'post_id' => 22, 'category' => 1 +); + ]]> + + + + + + + + 'post_id', + 'comment_count', + 'post_type' +); + ]]> + + + 'post_id', 'comment_count', 'post_type' +); + ]]> + + + From f676769f25615de7e1a3e39b8b605f638696ac2b Mon Sep 17 00:00:00 2001 From: Matt Galdino Date: Tue, 26 Aug 2025 15:19:21 -0700 Subject: [PATCH 2/5] docs: Use individual tags per line for better clarity --- .../Docs/Arrays/ArrayDeclarationSpacingStandard.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml index f70bbac505..43ec3d3cef 100644 --- a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml +++ b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml @@ -12,8 +12,8 @@ 'post_id' => 22, - 'category' => 1 + 'post_id' => 22, + 'category' => 1 ); ]]> @@ -34,9 +34,9 @@ $args = array( 'post_id', - 'comment_count', - 'post_type' + 'post_id', + 'comment_count', + 'post_type' ); ]]> From 16949aa62f2a3ea43a7647ce058cc179368207ee Mon Sep 17 00:00:00 2001 From: Matt Galdino Date: Tue, 26 Aug 2025 15:20:17 -0700 Subject: [PATCH 3/5] docs: Change 'associative keys' to 'keys' for clearer terminology and Update terminology from 'pair of key and value' to 'key/value pair' --- WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml index 43ec3d3cef..1b43b159f9 100644 --- a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml +++ b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml @@ -5,11 +5,11 @@ > - + 'post_id' => 22, @@ -17,7 +17,7 @@ $args = array( ); ]]> - + 'post_id' => 22, 'category' => 1 From 6bd80ec1fe237198a753acec221a7b61c52aef9b Mon Sep 17 00:00:00 2001 From: Matt Galdino Date: Tue, 26 Aug 2025 15:21:03 -0700 Subject: [PATCH 4/5] docs: Add associative array example and clarify multi-line array rule --- .../ArrayDeclarationSpacingStandard.xml | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml index 1b43b159f9..fcc22e8468 100644 --- a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml +++ b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml @@ -40,10 +40,34 @@ $args = array( ); ]]> - + 'post_id', 'comment_count', 'post_type' +); + ]]> + + + + + + + + 'width' => 300, + 'height' => 200, + 'color' => 'blue' +); + ]]> + + + 'width' => 300, 'height' => 200, + 'color' => 'blue' ); ]]> From c2b316cfc4b0e51d7761ed5ce5822016a5ea5b14 Mon Sep 17 00:00:00 2001 From: Matt Galdino Date: Tue, 26 Aug 2025 15:27:18 -0700 Subject: [PATCH 5/5] docs: Fix code examples to follow WordPress Coding Standards - Add trailing commas after last array items - Align double arrows for better readability --- .../Arrays/ArrayDeclarationSpacingStandard.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml index fcc22e8468..6ee64b3fab 100644 --- a/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml +++ b/WordPress/Docs/Arrays/ArrayDeclarationSpacingStandard.xml @@ -12,15 +12,15 @@ 'post_id' => 22, - 'category' => 1 + 'post_id' => 22, + 'category' => 1, ); ]]> 'post_id' => 22, 'category' => 1 + 'post_id' => 22, 'category' => 1, ); ]]> @@ -36,14 +36,14 @@ $args = array( $args = array( 'post_id', 'comment_count', - 'post_type' + 'post_type', ); ]]> 'post_id', 'comment_count', 'post_type' + 'post_id', 'comment_count', 'post_type', ); ]]> @@ -57,9 +57,9 @@ $args = array( 'width' => 300, + 'width' => 300, 'height' => 200, - 'color' => 'blue' + 'color' => 'blue', ); ]]> @@ -67,7 +67,7 @@ $settings = array( 'width' => 300, 'height' => 200, - 'color' => 'blue' + 'color' => 'blue', ); ]]>