cakephp2-php8/lib/Cake/Utility
Markus Podar d201312a0e
php-8.0-compat: fix "Error: Unknown named parameter $subject"
PHP 8 added support for named parameters however will throw an error when
a named parameter, which does not exist, will be called/appears.

In this case the code uses `array_filter(compact('subject))` to conveniently
prepend `$subject` to the callback, if it's non-null.

It's then combined with `$params` but mixing a hash wih a sequential array
and then end result is `['subject' => …, ]` which then triggers this
TypeError in PHP 8.

The solution applies `array_values()` on above array as to remove the keys
and then the error disappears.

With this change, our internal test suite (2k tests) is green on both PHP8
and PHP7.4, aka this change is expecte to be backwards compatible.
2020-11-12 17:30:04 +01:00
..
CakeNumber.php Use HTTPS for the opensource.org MIT license URL 2017-06-11 00:23:22 +02:00
CakeText.php Use random_int with PHP 7 2020-05-23 11:12:46 -05:00
CakeTime.php Change private method to protected 2019-01-31 09:49:41 +01:00
ClassRegistry.php Improve doc block 2019-05-06 14:21:24 +02:00
Debugger.php Fix some PHP 7.3 errors 2018-11-11 16:15:55 +01:00
File.php Fix: revert return 2017-10-05 00:09:51 +09:00
Folder.php php-7.4-compact: replace deprecated curly brace offset access 2020-03-20 21:10:58 +01:00
Hash.php Augment docblock for Hash::combine() 2018-09-20 22:00:03 -04:00
Inflector.php Use HTTPS for the opensource.org MIT license URL 2017-06-11 00:23:22 +02:00
ObjectCollection.php php-8.0-compat: fix "Error: Unknown named parameter $subject" 2020-11-12 17:30:04 +01:00
Sanitize.php php-7.4-compact: replace deprecated curly brace offset access 2020-03-20 21:10:58 +01:00
Security.php Remove Security::engine() 2018-02-24 12:17:51 +09:00
Set.php php-7.4-compact: replace deprecated curly brace offset access 2020-03-20 21:10:58 +01:00
String.php Use HTTPS for the opensource.org MIT license URL 2017-06-11 00:23:22 +02:00
Validation.php Force email domain lookups to work in fallback case. 2017-10-25 08:45:57 +02:00
Xml.php Use HTTPS for the opensource.org MIT license URL 2017-06-11 00:23:22 +02:00