Skip to content

Commit ee37881

Browse files
authored
Port Symfony 6 support from master into 3.x branch (#48)
* Port Symfony 6 support from master with CI config changes * Add missing test CI config * Fix PhpStan
1 parent fcb8338 commit ee37881

File tree

7 files changed

+78
-32
lines changed

7 files changed

+78
-32
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
name: Test
9+
runs-on: Ubuntu-20.04
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
php: [ '7.2', '7.3', '7.4', '8.0' ]
14+
strategy: [ 'highest' ]
15+
sf_version: ['']
16+
include:
17+
- php: 7.4
18+
strategy: 'lowest'
19+
- php: 7.3
20+
sf_version: '3.*'
21+
- php: 7.3
22+
sf_version: '4.*'
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: Set up PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php }}
32+
coverage: none
33+
tools: flex
34+
35+
- name: Download dependencies
36+
uses: ramsey/composer-install@v1
37+
env:
38+
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
39+
with:
40+
dependency-versions: ${{ matrix.strategy }}
41+
composer-options: --no-interaction --prefer-dist --optimize-autoloader
42+
43+
- name: Run tests
44+
run: ./vendor/bin/phpunit

.github/workflows/static.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
on: [push, pull_request]
2-
name: Static analysis
1+
name: Static code analysis
2+
3+
on: [pull_request]
4+
35
jobs:
46
phpstan:
57
name: PHPStan
68
runs-on: ubuntu-latest
79
steps:
810
- uses: actions/checkout@master
911
- name: PHPStan
10-
uses: docker://oskarstark/phpstan-ga
12+
uses: docker://jakzal/phpqa:php7.3-alpine
1113
with:
12-
args: analyze --no-progress
14+
args: phpstan analyze
1315

1416
php-cs-fixer:
1517
name: PHP-CS-Fixer
1618
runs-on: ubuntu-latest
1719
steps:
1820
- uses: actions/checkout@master
1921
- name: PHP-CS-Fixer
20-
uses: docker://oskarstark/php-cs-fixer-ga
22+
uses: docker://jakzal/phpqa:php7.3-alpine
2123
with:
22-
args: --dry-run --diff-format udiff
24+
args: php-cs-fixer fix --dry-run --diff -vvv

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.php-cs-fixer.cache
12
/behat.yml
23
/build/
34
/composer.lock

.php-cs-fixer.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude(__DIR__.'/vendor')
5+
->name('*.php')
6+
->in(__DIR__)
7+
;
8+
9+
$config = new PhpCsFixer\Config();
10+
return $config->setRules([
11+
'@Symfony' => true,
12+
'@Symfony:risky' => true,
13+
'array_syntax' => ['syntax' => 'short'],
14+
])
15+
->setRiskyAllowed(true)
16+
->setFinder($finder)
17+
;

.php_cs

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

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
],
1111
"require": {
1212
"php": ">=7.2",
13-
"symfony/translation": " ^3.4 || ^4.3 || ^5.0"
13+
"symfony/translation": " ^3.4 || ^4.3 || ^5.0 || ^6.0"
1414
},
1515
"require-dev": {
16-
"symfony/phpunit-bridge": "^4.3 || ^5.0",
16+
"symfony/phpunit-bridge": "^4.3 || ^5.0 || ^6.0",
1717
"phpunit/phpunit": "^8.4"
1818
},
1919
"autoload": {

src/TransferableStorage.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ interface TransferableStorage
2323
/**
2424
* Get messages from the storage into the $catalogue.
2525
*
26-
* @var array a list of arbitrary options that could be used. The array SHOULD
27-
* use a format of array<string, array<mixed $value>.
28-
* Example: ['foo' => ['bar', 'baz]]
26+
* @param array $options a list of arbitrary options that could be used. The array SHOULD
27+
* use a format of array<string, array<mixed $value>.
28+
* Example: ['foo' => ['bar', 'baz]]
2929
*/
3030
public function export(MessageCatalogueInterface $catalogue, array $options = []): void;
3131

@@ -34,9 +34,9 @@ public function export(MessageCatalogueInterface $catalogue, array $options = []
3434
* should be considered as a "force merge". Existing messages in the storage
3535
* will be overwritten but no message will be removed.
3636
*
37-
* @var array a list of arbitrary options that could be used. The array SHOULD
38-
* use a format of array<string, array<mixed $value>.
39-
* Example: ['foo' => ['bar', 'baz]]
37+
* @param array $options a list of arbitrary options that could be used. The array SHOULD
38+
* use a format of array<string, array<mixed $value>.
39+
* Example: ['foo' => ['bar', 'baz]]
4040
*/
4141
public function import(MessageCatalogueInterface $catalogue, array $options = []): void;
4242
}

0 commit comments

Comments
 (0)