Skip to content

Commit 93835bc

Browse files
authored
[TASK] Update PHP-CS-Fixer (MyIntervals#592)
Also explicitly disallow trailing comma in function call arguments (requires PHP >= 7.4) and function declaration parameters (requires PHP >= 8.0), since the default has changed.
1 parent a06d326 commit 93835bc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.phive/phars.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.50.0" installed="3.50.0" location="./.phive/php-cs-fixer" copy="false"/>
3+
<phar name="php-cs-fixer" version="^3.59.3" installed="3.59.3" location="./.phive/php-cs-fixer" copy="false"/>
44
</phive>

config/php-cs-fixer.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22

3-
if (PHP_SAPI !== 'cli') {
4-
die('This script supports command line usage only. Please check your command.');
5-
}
3+
declare(strict_types=1);
64

75
return (new \PhpCsFixer\Config())
86
->setRiskyAllowed(true)
@@ -21,6 +19,9 @@
2119
'@PHPUnit75Migration:risky' => true,
2220
'@PHPUnit84Migration:risky' => true,
2321

22+
// overwrite the PER2 defaults to restore compatibility with PHP 7.x
23+
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'match']],
24+
2425
'php_unit_construct' => true,
2526
'php_unit_dedicate_assert' => ['target' => 'newest'],
2627
'php_unit_expectation' => ['target' => 'newest'],

0 commit comments

Comments
 (0)