- Issue created by @Chris64
- Status changed to Closed: duplicate
9 months ago 12:31pm 25 February 2024 - π¦πΊAustralia dpi Perth, Australia
Seems unnecessary to have this parent issue for π Use null coalescing assignment operator: multi-lines case. Needs work and π Switch long-form single-line assign and null coalesce (= ??) to null coalesce assign operator (??=) Needs work . Lets continue in each.
- π«π·France Chris64 France
@dpi are your sure? I am not. I would like to keep this issue. I see that as a method. To have an overview on the different cases and to control them to be sure to reach the goal. You would like that I change this method? Moreover, some others do the same in the Drupal project. For example Replace π± Replace strpos/substr with PHP 8's str_starts_with() / str_contains() / str_ends_with() Active .
- π¦πΊAustralia dpi Perth, Australia
Is there an end goal to this issue, other than resolving the children?
Im sure there are formal rules to initiative tracking parents.
In any case there is no formal aggreement required which unlocks progress in the children issues. Nor are there interdepenent issues between the issues, which is why I think there is no need for an overarching issue.
- Status changed to Needs work
8 months ago 7:18pm 8 March 2024 - π«π·France Chris64 France
Some updates following #3424083-#11 π Change !isset to ??= assignment operator: generator and their generated files case. Needs review ,
There are now several issues on this topic. To help reviews and understand the scoping of the issue it will help if a meta issue is made to discuss the overall change. The issues to implement the change should be children of that meta and then they can be removed as related. Use the component 'other' for these because they are not directly related to a particular subsystem.
- π«π·France Chris64 France
A code sniffing rule exists about this topic,
slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff
but is missing in,
drupal/coder/coder_sniffer/Drupal/ruleset.xml
that is,
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator" />
- π«π·France Chris64 France
Since its message is,
Use "??=" operator instead of "=" and "??".
the rule corresponds to the case A. But not to the case B. - πΊπΈUnited States smustgrave
I posted in the #coding-standard meeting today https://drupal.slack.com/archives/C02LJCF78E8/p1711489024488359
It was advised by @larowlan to open a coding standard issue where this standard is approved first. So postponed the child issue
@Chris64 can you update #3436307: Change !isset to the null coalescing assignment operator ??= β I pretty much left the template as the default as I can't really speak on the topic probably as well as you can.