- 🇮🇹Italy apaderno Brescia, 🇮🇹
In a directory containing Drupal 11 files,
grep -irn "=&" ./ --include=*.module --include=*.php --include=*.inc --include=*.install --include=*.theme| wc -l
returned 93, whilegrep -irn "=&" ./ --include=*.module --include=*.php --include=*.inc --include=*.install --include=*.theme| wc -l
returned 328.Truly, the first command also count lines like the following ones.
./core/modules/ckeditor5/tests/src/Kernel/SmartDefaultSettingsTest.php:1357: 'To maintain the capabilities of this text for mat, <a target="_blank" href="/admin/help/ckeditor5#migration-settings">the CKEditor 5 migration</a> did the following: Enabled thes e plugins: (<em class="placeholder">Link, Block quote, Code, List</em>). Added these tags/attributes to the Source Editing Plugin\'s <a target="_blank" href="/admin/help/ckeditor5#source-editing">Manually editable HTML tags</a> setting: <cite> <dl> <dt> <dd> <a hreflang> <blockquote cite> <ul type> <ol type="1 A I"> <h2 id="jump-*"> <h3 id> <h4 id> <h5 id> <h6 id>. Additional details are available in your logs.', ./core/modules/ckeditor5/tests/src/Kernel/SmartDefaultSettingsTest.php:1401: 'As part of migrating to CKEditor 5, it was found that the <em class="placeholder">A CKEditor 4 configured to have span styles</em> text format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <span class="llama">. The text format must be saved to make these changes active.', ./core/modules/ckeditor5/tests/src/Kernel/SmartDefaultSettingsTest.php:1406: 'To maintain the capabilities of this text format, <a target="_blank" href="/admin/help/ckeditor5#migration-settings">the CKEditor 5 migration</a> did the following: Added these tags/attributes to the Source Editing Plugin\'s <a target="_blank" href="/admin/help/ckeditor5#source-editing">Manually editable HTML tags</a> setting: <span class="llama">. Additional details are available in your logs.', ./core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php:553: 'The following tag is not valid HTML: <em class="placeholder"><blockquote class=""></em>.',
- 🇳🇿New Zealand quietone
This was discussed at coding standards meetings, #3456119: Coding Standards Meeting Tuesday 2024-06-18 2100 UTC → .
The existing text does cover this case but there was a question if the text should make clear that 'operator' does not mean any combination of operators.
And a sniff will be needed to ensure the agreed format is enforced.
- 🇬🇧United Kingdom catch
Yeah I think it's implicit in the existing coding standard but we should make it explicit.
- Status changed to Needs review
about 1 year ago 8:40am 3 July 2024 - 🇳🇿New Zealand quietone
Just for info:
In addition to the basic assignment operator, there are "combined operators" for all of the binary arithmetic, array union and string operators that allow you to use a value in an expression and then set its value to the result of that expression. For example:
and
Assignment by reference is also supported, using the "$var = &$othervar;" syntax. Assignment by reference means that both variables end up pointing at the same data, and nothing is copied anywhere.
I updated the issue summary with a proposed text. It add an example, removes the two related 'instead of' examples and moved the 'unary to a separate paragraph. I removed the 'instead of' because I find pointing out what not to do isn't helpful.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
In the following sentence, I would use a different operator as example.
Unary operators (operators that operate on only one value), such as
++
, should not have a space between the operator and the variable or number they are operating on.$var = 1++;
contains a syntax error, likeecho 1++, "\n";
.I am not sure how to make that sentence better, considering that even
new
is a unary operator, for which there must be a space between the operator and its argument.