From 920b2708a513ec325023f4df647f8538b6add8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=BDoljom?= Date: Sat, 20 Aug 2022 15:27:12 +0200 Subject: [PATCH] Add arithmetic to the spacing list and update code examples Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- wordpress-coding-standards/php.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wordpress-coding-standards/php.md b/wordpress-coding-standards/php.md index b5e5838..8452095 100644 --- a/wordpress-coding-standards/php.md +++ b/wordpress-coding-standards/php.md @@ -143,7 +143,7 @@ Where possible, dynamic values in tag names should also be as succinct and to th ### Space Usage -Always put spaces after commas, and on both sides of logical, comparison, string and assignment operators. +Always put spaces after commas, and on both sides of logical, arithmetic, comparison, string and assignment operators. ```php SOME_CONST === 23; @@ -152,6 +152,8 @@ foo() && bar(); array( 1, 2, 3 ); $baz . '-5'; $term .= 'X'; +if( $object instanceof Post_Type_Interface ) { [...] }; +$result = 2 ** 3; // 8. ``` Put spaces on both sides of the opening and closing parentheses of control structure blocks.