Skip to content

Commit 0e9a03c

Browse files
committed
🎨 PHP CS Fixer
1 parent 1234059 commit 0e9a03c

File tree

1,184 files changed

+524229
-524314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,184 files changed

+524229
-524314
lines changed

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PHP CS Fixer
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
pull_request:
7+
paths:
8+
- '**.php'
9+
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
php-cs-fixer:
17+
name: "PHP CS Fixer"
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.head_ref }}
23+
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup PHP, with composer and extensions
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: 8.3
31+
32+
- uses: "ramsey/composer-install@v3"
33+
with:
34+
dependency-versions: highest
35+
36+
- name: Run PHP CS Fixer
37+
run: "composer run-script cs"
38+
39+
- name: Commit changes
40+
uses: stefanzweifel/git-auto-commit-action@v5
41+
with:
42+
commit_message: ":art: Fix code styling"

.php-cs-fixer.dist.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
$finder = PhpCsFixer\Finder::create()
6+
->in(__DIR__);
7+
8+
$config = new PhpCsFixer\Config();
9+
return $config->setRules(
10+
[
11+
'@PER-CS' => true,
12+
'@PHP74Migration' => true,
13+
'single_quote' => true,
14+
'no_unused_imports' => true,
15+
'no_superfluous_phpdoc_tags' => [
16+
'allow_hidden_params' => true,
17+
'allow_mixed' => true,
18+
'remove_inheritdoc' => true,
19+
],
20+
'phpdoc_trim' => true,
21+
]
22+
)
23+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
24+
->setFinder($finder);

.styleci.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

build/BuildApplication.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99

1010
class BuildApplication extends Application
1111
{
12-
const VERSION = '5';
12+
public const VERSION = '5';
1313

1414
public function __construct()
1515
{
1616
parent::__construct('libphonenumber Data Builder', self::VERSION);
1717

1818
$this->addCommands(
19-
array(
19+
[
2020
new BuildMetadataPHPFromXMLCommand(),
2121
new GeneratePhonePrefixDataCommand(),
2222
new GenerateTimeZonesMapDataCommand(),
23-
)
23+
]
2424
);
2525
}
2626
}

0 commit comments

Comments
 (0)