Skip to content

Commit

Permalink
🎨 PHP CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
giggsey committed Oct 4, 2024
1 parent 1234059 commit 0e9a03c
Show file tree
Hide file tree
Showing 1,184 changed files with 524,229 additions and 524,314 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: PHP CS Fixer
on:
push:
branches:
- 'main'
pull_request:
paths:
- '**.php'

concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
php-cs-fixer:
name: "PHP CS Fixer"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.3

- uses: "ramsey/composer-install@v3"
with:
dependency-versions: highest

- name: Run PHP CS Fixer
run: "composer run-script cs"

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ":art: Fix code styling"
24 changes: 24 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->in(__DIR__);

$config = new PhpCsFixer\Config();
return $config->setRules(
[
'@PER-CS' => true,
'@PHP74Migration' => true,
'single_quote' => true,
'no_unused_imports' => true,
'no_superfluous_phpdoc_tags' => [
'allow_hidden_params' => true,
'allow_mixed' => true,
'remove_inheritdoc' => true,
],
'phpdoc_trim' => true,
]
)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setFinder($finder);
17 changes: 0 additions & 17 deletions .styleci.yml

This file was deleted.

6 changes: 3 additions & 3 deletions build/BuildApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

class BuildApplication extends Application
{
const VERSION = '5';
public const VERSION = '5';

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

$this->addCommands(
array(
[
new BuildMetadataPHPFromXMLCommand(),
new GeneratePhonePrefixDataCommand(),
new GenerateTimeZonesMapDataCommand(),
)
]
);
}
}
Loading

0 comments on commit 0e9a03c

Please sign in to comment.