joomla / coding-standards

Joomla Coding Standards Definition
https://developer.joomla.org/coding-standards/basic-guidelines.html
GNU General Public License v2.0
128 stars 129 forks source link

[PHP8] Document named arguments BC policy #270

Closed PhilETaylor closed 2 years ago

PhilETaylor commented 3 years ago

Cross posting https://github.com/joomla/joomla-cms/issues/31424

Is your feature request related to a problem? Please describe.

PHP 8 brings with it a lot of new features.

One that is important is "named arguments"

Describe the solution you'd like

A document describing the Joomla projects commitment to, or against, Backward Compatibility when it comes to "named arguments"

A commitment that any change of a named argument is actually Backward Compatibility break and cannot be allowed to happen or a statement the opposite

For example: #Symfony, one of the projects that has considerable compatibility between versions, and has a strict B/c promise, have gone (so far) with the total opposite of what I was expecting, and excluded "named arguments" from their Backward Compatibility Promise! Gulp!

Parameter names are not part of the compatibility promise. 
Using PHP 8's named arguments feature might break your code 
when upgrading to newer Symfony versions

Additional context

-- https://stitcher.io/blog/php-8-named-arguments -- https://wiki.php.net/rfc/named_params

The only statement I can find for Joomla so far is "That is assuming we do want to add this feature to our B/C promise." in #30988

HLeithner commented 3 years ago

We already prepared some/all/most of the function signatures in the upcoming 3.9.23 release.

But I don't See a b/c promise for named parameters till 4.1 or later.

It's a big handicap for refactoring or optimizing functions. So our codebase have to be cleaned up before we think about adding it to the b/c promise.