Skip to content

Commit

Permalink
disable cs risky
Browse files Browse the repository at this point in the history
  • Loading branch information
instabledesign committed Dec 16, 2023
1 parent e79a62f commit 5c1a27f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run CS fixer
run: make cs

- name: Run php static analyse
run: make analyse

Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'@PHP74Migration:risky' => true,
'@PHPUnit100Migration:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PhpCsFixer:risky' => false,
'yoda_style' => true,
'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
'modernize_strpos' => true, // needs PHP 8+ or polyfill
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test:
vendor/bin/phpunit

cs:
vendor/bin/php-cs-fixer fix
vendor/bin/php-cs-fixer fix -vvv

analyse:
vendor/bin/phpstan
16 changes: 8 additions & 8 deletions src/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,21 @@ protected function getType(&$value)

break;

// Recognize numeric values
// Recognize numeric values
case is_numeric($value):
if (str_contains($value, '.') || false !== stripos($value, 'e')) {
$value = (float)$value;
$value = (float) $value;
$type = self::T_FLOAT;

break;
}

$value = (int)$value;
$value = (int) $value;
$type = self::T_INTEGER;

break;

// Recognize quoted strings
// Recognize quoted strings
case '"' === $value[0]:
$value = str_replace('""', '"', substr($value, 1, \strlen($value) - 2));

Expand All @@ -218,7 +218,7 @@ protected function getType(&$value)

break;

// Comparison operator
// Comparison operator
case '=' === $value:
$type = self::T_EQUALS;

Expand Down Expand Up @@ -255,7 +255,7 @@ protected function getType(&$value)

break;

// Composite operator
// Composite operator
case '&' === $value:
$type = self::T_AND;

Expand Down Expand Up @@ -283,7 +283,7 @@ protected function getType(&$value)

break;

// Brace
// Brace
case '(' === $value:
$type = self::T_OPEN_PARENTHESIS;

Expand Down Expand Up @@ -324,7 +324,7 @@ protected function getType(&$value)

break;

// Default
// Default
default:
throw new UnknownTokenTypeException($value);
}
Expand Down

0 comments on commit 5c1a27f

Please sign in to comment.