Skip to content

Commit

Permalink
feat: drop support of php 7.4 and introduce php 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroTroller committed Jan 5, 2023
1 parent 6dd15c6 commit 8376adf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ tests: &tests
run: |
composer test -vvv
bin/doc
composer run php-cs-fixer || (echo "Coding standards are not respected. Run 'composer run php-cs-fixer'" && exit 1)
PHP_CS_FIXER_IGNORE_ENV=1 composer run php-cs-fixer || (echo "Coding standards are not respected. Run 'composer run php-cs-fixer'" && exit 1)
tests_with_future_mode: &tests_with_future_mode
run: |
PHP_CS_FIXER_FUTURE_MODE=1 composer test -vvv
bin/doc
composer run php-cs-fixer || (echo "Coding standards are not respected. Run 'composer run php-cs-fixer'" && exit 1)
PHP_CS_FIXER_IGNORE_ENV=1 composer run php-cs-fixer || (echo "Coding standards are not respected. Run 'composer run php-cs-fixer'" && exit 1)
jobs:
tests:
Expand Down Expand Up @@ -106,19 +106,19 @@ workflows:
- documentation:
matrix:
parameters:
php-version: ["8.1"]
php-version: ["8.2"]
- tests:
matrix:
parameters:
php-version: ["7.4", "8.0", "8.1"]
php-version: ["8.0", "8.1", "8.2"]
- tests-with-future-mode:
matrix:
parameters:
php-version: ["7.4", "8.0", "8.1"]
php-version: ["8.0", "8.1", "8.2"]
- tests-with-lowest-dependencies:
matrix:
parameters:
php-version: ["7.4", "8.0", "8.1"]
php-version: ["8.0", "8.1", "8.2"]
- release-test
- release:
requires:
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 @@ -10,7 +10,7 @@
->setRules(
RuleSetFactory::create()
->phpCsFixer(true)
->php(7.4, true)
->php(8.0, true)
->pedrotroller(true)
->enable('align_multiline_comment')
->enable('array_indentation')
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "PHP-CS-FIXER : my custom fixers",
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"friendsofphp/php-cs-fixer": "^3.13.1"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/PedroTroller/CS/Fixer/PhpspecFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private function removeReturn(SplFileInfo $file, Tokens $tokens): void

$tokens->clearRange($closeBraceIndex + 1, $openCurlyBracket - 1);

if ($tokens[$closeBraceIndex - 1]->isWhitespace() && false !== strpos($tokens[$closeBraceIndex - 1]->getContent(), "\n")) {
if ($tokens[$closeBraceIndex - 1]->isWhitespace() && str_contains($tokens[$closeBraceIndex - 1]->getContent(), "\n")) {
$tokens->ensureWhitespaceAtIndex($openCurlyBracket, 0, ' ');
} else {
$tokens->ensureWhitespaceAtIndex($openCurlyBracket, 0, "\n".$this->analyze($tokens)->getLineIndentation($openBraceIndex));
Expand Down

0 comments on commit 8376adf

Please sign in to comment.