Skip to content

Commit afd2291

Browse files
authored
Merge pull request #132 from gndk/php-cs-fixer
Update php-cs-fixer config
2 parents 8bcbd4f + 0caef37 commit afd2291

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

.gitattributes

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
33

44
# Ignore all test and documentation with "export-ignore".
5-
/.editorconfig export-ignore
6-
/.gitattributes export-ignore
7-
/.github export-ignore
8-
/.gitignore export-ignore
9-
/.php_cs.dist export-ignore
10-
/example export-ignore
11-
/phpunit.xml.dist export-ignore
12-
/tests export-ignore
5+
/.editorconfig export-ignore
6+
/.gitattributes export-ignore
7+
/.github export-ignore
8+
/.gitignore export-ignore
9+
/.php-cs-fixer.dist.php export-ignore
10+
/example export-ignore
11+
/phpunit.xml.dist export-ignore
12+
/tests export-ignore
1313

1414
# All test snapshots and text stubs must have LF line endings
1515
tests/**/__snapshots__/** text eol=lf

.github/workflows/php-cs-fixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Run PHP CS Fixer
1616
uses: docker://oskarstark/php-cs-fixer-ga
1717
with:
18-
args: --config=.php_cs.dist --allow-risky=yes
18+
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
1919

2020
- name: Commit changes
2121
uses: stefanzweifel/git-auto-commit-action@v4

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.idea
2-
.php_cs
3-
.php_cs.cache
2+
.php-cs-fixer.cache
43
.phpunit.result.cache
54
build
65
composer.lock

.php_cs.dist renamed to .php-cs-fixer.dist.php

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

3-
$finder = Symfony\Component\Finder\Finder::create()
3+
$finder = PhpCsFixer\Finder::create()
44
->in([
55
__DIR__ . '/src',
66
__DIR__ . '/tests',
@@ -10,14 +10,14 @@
1010
->ignoreDotFiles(true)
1111
->ignoreVCS(true);
1212

13-
return PhpCsFixer\Config::create()
13+
return (new PhpCsFixer\Config())
1414
->setRules([
1515
'@PSR2' => true,
1616
'array_syntax' => ['syntax' => 'short'],
17-
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
17+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
1818
'no_unused_imports' => true,
1919
'not_operator_with_successor_space' => true,
20-
'trailing_comma_in_multiline_array' => true,
20+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
2121
'phpdoc_scalar' => true,
2222
'unary_operator_spaces' => true,
2323
'binary_operator_spaces' => true,
@@ -28,7 +28,7 @@
2828
'phpdoc_var_without_name' => true,
2929
'class_attributes_separation' => [
3030
'elements' => [
31-
'method',
31+
'method' => 'one',
3232
],
3333
],
3434
'method_argument_space' => [

src/Filename.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class Filename
66
{
7-
static public function cleanFilename(string $raw): string
7+
public static function cleanFilename(string $raw): string
88
{
99
// Remove anything which isn't a word, whitespace, number
1010
// or any of the following caracters -_~,;[]().

0 commit comments

Comments
 (0)