Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jan 22, 2020

Utils\Operators: add new isUnaryPlusMinus() utility method

This adds a new utility method:

  • isUnaryPlusMinus() - to check whether a plus/minus sign is a unary or an arithmetic operator. Returns boolean.

Includes extensive dedicated unit tests.

Operators::isUnaryPlusMinus(): fix compatibility with PHPCS < 3.1.0

The PHP 5.5 T_YIELD token was not backfilled in PHPCS until version 3.1.0.

This commit adds work-arounds to the utility method to handle the situation correctly.

Refs:

jrfnl added 2 commits January 22, 2020 23:15
This adds a new utility method: * `isUnaryPlusMinus()` - to check whether a plus/minus sign is a unary or an arithmetic operator. Returns boolean. Includes extensive dedicated unit tests.
The PHP 5.5 `T_YIELD` token was not backfilled in PHPCS until version 3.1.0. This commit adds work-arounds to the utility method to handle the situation correctly. Refs: * squizlabs/PHP_CodeSniffer 1513 * squizlabs/PHP_CodeSniffer 1524
@jrfnl jrfnl added this to the 1.0.0 milestone Jan 22, 2020
@jrfnl jrfnl merged commit 72a6c3c into develop Jan 22, 2020
@jrfnl jrfnl deleted the feature/operators-new-isunaryplusminus-utility branch January 22, 2020 22:38
@jrfnl jrfnl modified the milestones: 1.0.0, 1.0.0-alpha1 May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment