Skip to content

Commit

Permalink
Merge pull request #36 from javer/symfony6-php81
Browse files Browse the repository at this point in the history
Add Symfony 6 and PHP 8.1 support
  • Loading branch information
mcfedr authored Dec 14, 2021
2 parents 17990f0 + 4046cc8 commit e704389
Show file tree
Hide file tree
Showing 26 changed files with 254 additions and 6,032 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.* export-ignore
/tests export-ignore
/phpunit.xml.dist export-ignore
62 changes: 62 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Test

on:
push:
pull_request:
types: [opened, synchronize, edited, reopened]

jobs:
test:
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}
runs-on: ubuntu-20.04
continue-on-error: false
strategy:
fail-fast: false
matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
symfony-version:
- '4.4.*'
- '5.4.*'
- '6.0.*'
exclude:
- php-version: '7.4'
symfony-version: '6.0.*'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
ini-values: "memory_limit=-1"
php-version: ${{ matrix.php-version }}
tools: composer:v2, flex

- name: Validate composer.json
run: composer validate --no-check-lock

- name: Remove unused PHP-CS-Fixer
run: composer remove --dev --no-update friendsofphp/php-cs-fixer
if: matrix.php != '8.0' || matrix.symfony-version != '5.4.*'

- name: Install dependencies
run: composer install --prefer-dist --no-progress
env:
SYMFONY_REQUIRE: "${{ matrix.symfony-version }}"

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
if: matrix.php == '8.0' && matrix.symfony-version == '5.4.*'

- name: PHPUnit
run: vendor/bin/phpunit
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/vendor/
/tests/cache/
/tests/logs/
/.php_cs.cache
/.php-cs-fixer.cache
/.phpunit.result.cache
/var/
/.idea/
/composer.lock
7 changes: 5 additions & 2 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
$finder = PhpCsFixer\Finder::create()
->in(['src', 'tests']);

return PhpCsFixer\Config::create()
$config = new PhpCsFixer\Config();

return $config
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => true,
'yoda_style' => false,
'declare_strict_types' => true
'declare_strict_types' => true,
'native_constant_invocation' => false,
])
->setRiskyAllowed(true)
->setFinder($finder);
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

29 changes: 15 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "A set of services to simplify using Aws to send push notifications",
"keywords": ["symfony", "push", "notification", "bundle", "gcm", "c2dm", "ios", "apns", "sns", "aws", "amazon", "fcm"],
"require": {
"php": ">=7.2.5",
"php": ">=7.4",
"ext-json": "*",
"aws/aws-sdk-php": "^3.0",
"symfony/framework-bundle": "^4|^5",
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
"symfony/polyfill-mbstring": "^1.1"
},
"suggest": {
Expand All @@ -32,19 +32,20 @@
},
"minimum-stability": "stable",
"require-dev": {
"phpunit/phpunit": "^8",
"fakerphp/faker": "^1.10",
"friendsofphp/php-cs-fixer": "^3.3",
"phpunit/phpunit": "^9.5",
"sensio/framework-extra-bundle": "^4.4|^5.0|^6.0",
"symfony/browser-kit": "^4.4|^5.0|^6.0",
"symfony/console": "^4.4|^5.0|^6.0",
"symfony/expression-language": "^4.4|^5.0|^6.0",
"symfony/monolog-bundle": "^3.0",
"fzaninotto/faker": "~1.4",
"sensio/framework-extra-bundle": "^4.0|^5.0",
"friendsofphp/php-cs-fixer": "^2.1",
"symfony/browser-kit": "^4|^5",
"symfony/security-bundle": "^4|^5",
"symfony/validator": "^4|^5",
"symfony/expression-language": "^4|^5",
"symfony/serializer": "^4|^5",
"symfony/property-info": "^4|^5",
"symfony/yaml": "^4|^5",
"symfony/phpunit-bridge": "*"
"symfony/phpunit-bridge": "^4.4|^5.0|^6.0",
"symfony/property-info": "^4.4|^5.0|^6.0",
"symfony/security-bundle": "^4.4|^5.0|^6.0",
"symfony/serializer": "^4.4|^5.0|^6.0",
"symfony/validator": "^4.4|^5.0|^6.0",
"symfony/yaml": "^4.4|^5.0|^6.0"
},
"autoload": {
"psr-4": { "Mcfedr\\AwsPushBundle\\": "src/Mcfedr/AwsPushBundle" }
Expand Down
Loading

0 comments on commit e704389

Please sign in to comment.