Skip to content

PHP 8.0: New PHPCompatibility.ParameterValues.RemovedSplAutoloadRegisterThrowFalse sniff#1181

Merged
wimg merged 1 commit intodevelopfrom
PHP-8.0/new-removedsplautoloadregisterthrowfalse-sniff
Aug 18, 2020
Merged

PHP 8.0: New PHPCompatibility.ParameterValues.RemovedSplAutoloadRegisterThrowFalse sniff#1181
wimg merged 1 commit intodevelopfrom
PHP-8.0/new-removedsplautoloadregisterthrowfalse-sniff

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Jul 19, 2020

spl_autoload_register() will now always throw a TypeError on invalid
arguments, therefore the second argument $do_throw is ignored and a
notice will be emitted if it is set to false.

Refs:

This sniff addresses that change.

Includes unit tests.

Related to #809

…gisterThrowFalse` sniff

> spl_autoload_register() will now always throw a TypeError on invalid
> arguments, therefore the second argument $do_throw is ignored and a
> notice will be emitted if it is set to false.

Refs:
* https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L393-L395
* php/php-src#5301
* php/php-src@2302b14

This sniff addresses that change.

Includes unit tests.
*
* @since 10.0.0
*/
class RemovedSplAutoloadRegisterThrowFalseSniff extends AbstractFunctionCallParameterSniff
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The classname makes it seem as if it throws false ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a suggestion for a better name which still aligns with the naming scheme of these type of ParameterValue sniffs ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tricky one... RemovedSplAutoloadRegisterThrowEqualsFalseSniff ?

*
* @since 10.0.0
*/
class RemovedSplAutoloadRegisterThrowFalseSniff extends AbstractFunctionCallParameterSniff
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tricky one... RemovedSplAutoloadRegisterThrowEqualsFalseSniff ?

@wimg wimg merged commit 8849a22 into develop Aug 18, 2020
@wimg wimg deleted the PHP-8.0/new-removedsplautoloadregisterthrowfalse-sniff branch August 18, 2020 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants