Skip to content

PHP 7.0: New PHPCompatibility.ParameterValues.NewAssertCustomException sniff#1029

Merged
wimg merged 1 commit intodevelopfrom
php-7.0/new-newassertcustomexception-sniff
May 20, 2020
Merged

PHP 7.0: New PHPCompatibility.ParameterValues.NewAssertCustomException sniff#1029
wimg merged 1 commit intodevelopfrom
php-7.0/new-newassertcustomexception-sniff

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented May 2, 2020

assert() is now a language construct and not a function. Assertion can now be
an expression. The second parameter is now interpreted either as an exception
(if a Throwable object is given), or as the description supported from PHP 5.4.8 onwards.

Refs:

This sniff addresses that change.

Includes unit tests.

Partially addressed #908

…tion` sniff

> assert() is now a language construct and not a function. Assertion can now be
> an expression. The second parameter is now interpreted either as an exception
> (if a Throwable object is given), or as the description supported from PHP 5.4.8 onwards.

Refs:
* https://wiki.php.net/rfc/expectations
* https://www.php.net/manual/en/function.assert.php#refsect1-function.assert-changelog

This sniff addresses that change.

Includes unit tests.

Partially addressed 908
@jrfnl jrfnl added this to the 10.0.0 milestone May 2, 2020
@jrfnl jrfnl requested a review from wimg May 2, 2020 17:08
@wimg wimg merged commit 8a4a9ec into develop May 20, 2020
@wimg wimg deleted the php-7.0/new-newassertcustomexception-sniff branch May 20, 2020 15:15
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