Skip to content

Commit

Permalink
Merge pull request #654 from giggsey/php-7.4-min
Browse files Browse the repository at this point in the history
PHP 7.4 minimum
  • Loading branch information
giggsey authored Oct 7, 2024
2 parents b75c463 + 93957d5 commit 776fdfe
Show file tree
Hide file tree
Showing 1,205 changed files with 499,585 additions and 529,660 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,14 @@ jobs:
strategy:
matrix:
php-version:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
include:
- php-version: 8.1
- php-version: 8.3
coverage: coverage
steps:
- name: Checkout
Expand Down Expand Up @@ -72,10 +65,10 @@ jobs:
- name: Test with phpunit (with coverage)
id: phpunit-coverage
if: "matrix.coverage == 'coverage'"
run: ./phpunit --verbose ${{ env.COVERAGE_FLAGS }}
run: vendor/bin/phpunit --verbose ${{ env.COVERAGE_FLAGS }}
- name: Test with phpunit (without coverage)
if: "matrix.coverage != 'coverage'"
run: ./phpunit --verbose
run: vendor/bin/phpunit --verbose
- name: Submit Coveralls
if: steps.phpunit-coverage.outcome == 'success'
uses: nick-invision/retry@v1
Expand Down
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"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.phar
composer.lock
libphonenumber-data-dir/
build/logs/
/.php-cs-fixer.cache
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ A PHP library for parsing, formatting, storing and validating international phon

## Installation

PHP versions 5.3 to PHP 8.3 are currently supported.
PHP versions 7.4 to PHP 8.4 are currently supported.

The PECL [mbstring](http://php.net/mbstring) extension is required.

It is recommended to use [composer](https://getcomposer.org) to install the library.

```bash
$ composer require giggsey/libphonenumber-for-php
composer require giggsey/libphonenumber-for-php
```

You can also use any other [PSR-4](http://www.php-fig.org/psr/psr-4/) compliant autoloader.
Expand Down Expand Up @@ -241,7 +241,7 @@ Generating the data is not normally needed, as this repository will generally al
If you do need to generate the data, the commands are provided by [Phing](https://www.phing.info). Ensure you have all the dev composer dependencies installed, then run

```bash
$ vendor/bin/phing compile
vendor/bin/phing compile
```

This compile process clones the [libphonenumber](https://github.com/google/libphonenumber) project at the version specified in [METADATA-VERSION.txt](METADATA-VERSION.txt).
Expand Down
7 changes: 6 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</target>

<target name="compile" description="Build all Data"
depends="cleanup-data,compile-test-data,build-phone-metadata,build-short-metadata,build-alternate-metadata,build-carrier-data,build-timezones-data,build-geo-data">
depends="cleanup-data,compile-test-data,build-phone-metadata,build-short-metadata,build-alternate-metadata,build-carrier-data,build-timezones-data,build-geo-data,cs-fixer">
</target>

<target name="cleanup-test-data" description="Cleanup old built test data"
Expand Down Expand Up @@ -220,4 +220,9 @@
</exec>
</target>

<target name="cs-fixer">
<exec executable="vendor/bin/php-cs-fixer" passthru="true">
<arg value="fix"/>
</exec>
</target>
</project>
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 776fdfe

Please sign in to comment.