Skip to content

Commit 19e1905

Browse files
authoredMay 17, 2022
Added modern ibexa PHP-CS fixer configuration (#1620)
1 parent 90f907d commit 19e1905

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed
 

‎.php-cs-fixer.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5+
* @license For full copyright and license information view LICENSE file distributed with this source code.
6+
*/
7+
declare(strict_types=1);
8+
9+
use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory;
10+
11+
$configFactory = new InternalConfigFactory();
12+
$configFactory->withRules([
13+
'header_comment' => false,
14+
]);
15+
16+
return $configFactory
17+
->buildConfig()
18+
->setFinder(
19+
PhpCsFixer\Finder::create()
20+
->in(
21+
array_filter([
22+
__DIR__ . '/code_samples',
23+
__DIR__ . '/tests',
24+
], 'is_dir')
25+
)
26+
->files()->name('*.php')
27+
);

‎.php_cs

-14
This file was deleted.

‎composer.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"symfony/property-access": "^5.0"
1515
},
1616
"require-dev": {
17-
"ezsystems/ezplatform-code-style": "^0.1.0",
18-
"friendsofphp/php-cs-fixer": "^2.16.0"
17+
"ibexa/code-style": "^1.0"
18+
},
19+
"scripts": {
20+
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
21+
"check-cs": "@fix-cs --dry-run"
1922
}
2023
}

0 commit comments

Comments
 (0)
Please sign in to comment.