Merge pull request #179 from javer/symfony6
Add Symfony 6 support and bump PHP to 7.4
This commit is contained in:
70
.github/workflows/build.yml
vendored
70
.github/workflows/build.yml
vendored
@@ -1,56 +1,56 @@
|
|||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push: ~
|
push:
|
||||||
pull_request: ~
|
pull_request:
|
||||||
release:
|
types: [opened, synchronize, edited, reopened]
|
||||||
types: [created]
|
|
||||||
schedule:
|
|
||||||
-
|
|
||||||
cron: "0 1 * * 6" # Run at 1am every Saturday
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
test:
|
||||||
runs-on: ubuntu-latest
|
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}
|
||||||
name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}"
|
runs-on: ubuntu-20.04
|
||||||
|
continue-on-error: false
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
php: ["7.3", "7.4", "8.0", "8.1"]
|
php-version:
|
||||||
symfony: ["4.4.*", "5.1.*"]
|
- '7.4'
|
||||||
|
- '8.0'
|
||||||
|
- '8.1'
|
||||||
|
symfony-version:
|
||||||
|
- '4.4.*'
|
||||||
|
- '5.4.*'
|
||||||
|
- '6.0.*'
|
||||||
|
exclude:
|
||||||
|
- php-version: '7.4'
|
||||||
|
symfony-version: '6.0.*'
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
-
|
- name: Setup PHP
|
||||||
name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: "${{ matrix.php }}"
|
|
||||||
coverage: none
|
coverage: none
|
||||||
|
ini-values: "memory_limit=-1"
|
||||||
|
php-version: ${{ matrix.php-version }}
|
||||||
|
tools: composer:v2, flex
|
||||||
|
|
||||||
-
|
- name: Validate composer.json
|
||||||
name: Update Symfony version
|
run: composer validate --no-check-lock
|
||||||
if: matrix.symfony != ''
|
|
||||||
run: |
|
|
||||||
composer require symfony/dependency-injection:${{ matrix.symfony }} --no-update --no-scripts
|
|
||||||
composer require symfony/http-kernel:${{ matrix.symfony }} --no-update --no-scripts
|
|
||||||
composer require symfony/proxy-manager-bridge:${{ matrix.symfony }} --no-update --no-scripts
|
|
||||||
|
|
||||||
composer require --dev symfony/browser-kit:${{ matrix.symfony }} --no-update --no-scripts
|
- name: Remove analysis dependencies
|
||||||
composer require --dev symfony/framework-bundle:${{ matrix.symfony }} --no-update --no-scripts
|
run: composer remove --dev --no-update sylius-labs/coding-standard vimeo/psalm
|
||||||
composer require --dev symfony/process:${{ matrix.symfony }} --no-update --no-scripts
|
if: matrix.symfony-version == '6.0.*'
|
||||||
composer require --dev symfony/yaml:${{ matrix.symfony }} --no-update --no-scripts
|
|
||||||
|
|
||||||
-
|
- name: Install dependencies
|
||||||
name: Install dependencies
|
run: composer install --prefer-dist --no-progress
|
||||||
run: composer update
|
env:
|
||||||
|
SYMFONY_REQUIRE: "${{ matrix.symfony-version }}"
|
||||||
|
|
||||||
-
|
- name: Run analysis
|
||||||
name: Run analysis
|
|
||||||
run: composer analyse
|
run: composer analyse
|
||||||
|
if: matrix.symfony-version != '6.0.*'
|
||||||
|
|
||||||
-
|
- name: Run tests
|
||||||
name: Run tests
|
|
||||||
run: composer test
|
run: composer test
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.3 || ^8.0",
|
"php": "^7.4 || ^8.0",
|
||||||
"behat/behat": "^3.6.1",
|
"behat/behat": "^3.6.1",
|
||||||
"symfony/dependency-injection": "^4.4 || ^5.1",
|
"symfony/dependency-injection": "^4.4 || ^5.1 || ^6.0",
|
||||||
"symfony/http-kernel": "^4.4 || ^5.1",
|
"symfony/http-kernel": "^4.4 || ^5.1 || ^6.0",
|
||||||
"symfony/proxy-manager-bridge": "^4.4 || ^5.1"
|
"symfony/proxy-manager-bridge": "^4.4 || ^5.1 || ^6.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"behat/mink-selenium2-driver": "^1.3",
|
"behat/mink-selenium2-driver": "^1.3",
|
||||||
@@ -25,10 +25,10 @@
|
|||||||
"friends-of-behat/page-object-extension": "^0.3.2",
|
"friends-of-behat/page-object-extension": "^0.3.2",
|
||||||
"friends-of-behat/service-container-extension": "^1.1",
|
"friends-of-behat/service-container-extension": "^1.1",
|
||||||
"sylius-labs/coding-standard": "^3.2",
|
"sylius-labs/coding-standard": "^3.2",
|
||||||
"symfony/browser-kit": "^4.4 || ^5.1",
|
"symfony/browser-kit": "^4.4 || ^5.1 || ^6.0",
|
||||||
"symfony/framework-bundle": "^4.4 || ^5.1",
|
"symfony/framework-bundle": "^4.4 || ^5.1 || ^6.0",
|
||||||
"symfony/process": "^4.4 || ^5.1",
|
"symfony/process": "^4.4 || ^5.1 || ^6.0",
|
||||||
"symfony/yaml": "^4.4 || ^5.1",
|
"symfony/yaml": "^4.4 || ^5.1 || ^6.0",
|
||||||
"vimeo/psalm": "4.4.1"
|
"vimeo/psalm": "4.4.1"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ Feature: Autodiscovering the application kernel
|
|||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
||||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
|
||||||
|
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
{
|
{
|
||||||
@@ -85,7 +84,7 @@ Feature: Autodiscovering the application kernel
|
|||||||
$loader->load(__DIR__ . '/../config/services.yaml');
|
$loader->load(__DIR__ . '/../config/services.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureRoutes(RouteCollectionBuilder $routes): void {}
|
protected function configureRoutes($routes): void {}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
When I run Behat
|
When I run Behat
|
||||||
@@ -101,7 +100,6 @@ Feature: Autodiscovering the application kernel
|
|||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
||||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
|
||||||
|
|
||||||
class AppKernel extends HttpKernel
|
class AppKernel extends HttpKernel
|
||||||
{
|
{
|
||||||
@@ -125,7 +123,7 @@ Feature: Autodiscovering the application kernel
|
|||||||
$loader->load(__DIR__ . '/../config/services.yaml');
|
$loader->load(__DIR__ . '/../config/services.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureRoutes(RouteCollectionBuilder $routes): void {}
|
protected function configureRoutes($routes): void {}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
When I run Behat
|
When I run Behat
|
||||||
@@ -147,7 +145,6 @@ Feature: Autodiscovering the application kernel
|
|||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
||||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
|
||||||
|
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
{
|
{
|
||||||
@@ -171,7 +168,7 @@ Feature: Autodiscovering the application kernel
|
|||||||
$loader->load(__DIR__ . '/../config/services.yaml');
|
$loader->load(__DIR__ . '/../config/services.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureRoutes(RouteCollectionBuilder $routes): void {}
|
protected function configureRoutes($routes): void {}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
And a kernel file "app/AppKernel.php" containing:
|
And a kernel file "app/AppKernel.php" containing:
|
||||||
@@ -183,7 +180,6 @@ Feature: Autodiscovering the application kernel
|
|||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
||||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
|
||||||
|
|
||||||
class AppKernel extends HttpKernel
|
class AppKernel extends HttpKernel
|
||||||
{
|
{
|
||||||
@@ -207,7 +203,7 @@ Feature: Autodiscovering the application kernel
|
|||||||
$loader->load(__DIR__ . '/../config/services.yaml');
|
$loader->load(__DIR__ . '/../config/services.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureRoutes(RouteCollectionBuilder $routes): void {}
|
protected function configureRoutes($routes): void {}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
When I run Behat
|
When I run Behat
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ Feature: Loading configured application kernel
|
|||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
||||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
|
||||||
|
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
{
|
{
|
||||||
@@ -90,7 +89,7 @@ Feature: Loading configured application kernel
|
|||||||
$loader->load(__DIR__ . '/../../config/services.yaml');
|
$loader->load(__DIR__ . '/../../config/services.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureRoutes(RouteCollectionBuilder $routes): void {}
|
protected function configureRoutes($routes): void {}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
When I run Behat
|
When I run Behat
|
||||||
@@ -115,7 +114,6 @@ Feature: Loading configured application kernel
|
|||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
||||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
|
||||||
|
|
||||||
class AppKernel extends HttpKernel
|
class AppKernel extends HttpKernel
|
||||||
{
|
{
|
||||||
@@ -139,7 +137,7 @@ Feature: Loading configured application kernel
|
|||||||
$loader->load(__DIR__ . '/../../config/services.yaml');
|
$loader->load(__DIR__ . '/../../config/services.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureRoutes(RouteCollectionBuilder $routes): void {}
|
protected function configureRoutes($routes): void {}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
When I run Behat
|
When I run Behat
|
||||||
|
|||||||
@@ -19,7 +19,13 @@
|
|||||||
<errorLevel type="suppress">
|
<errorLevel type="suppress">
|
||||||
<referencedClass name="Symfony\Component\BrowserKit\AbstractBrowser" />
|
<referencedClass name="Symfony\Component\BrowserKit\AbstractBrowser" />
|
||||||
<referencedClass name="Symfony\Component\BrowserKit\Client" />
|
<referencedClass name="Symfony\Component\BrowserKit\Client" />
|
||||||
|
<referencedClass name="Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator" />
|
||||||
</errorLevel>
|
</errorLevel>
|
||||||
</UndefinedClass>
|
</UndefinedClass>
|
||||||
|
<InvalidAttribute>
|
||||||
|
<errorLevel type="suppress">
|
||||||
|
<file name="src/Mink/MinkParameters.php" />
|
||||||
|
</errorLevel>
|
||||||
|
</InvalidAttribute>
|
||||||
</issueHandlers>
|
</issueHandlers>
|
||||||
</psalm>
|
</psalm>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
|||||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
||||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||||
|
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,18 @@ class Kernel extends HttpKernel
|
|||||||
$loader->load(__DIR__ . '/../config/services.yaml');
|
$loader->load(__DIR__ . '/../config/services.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureRoutes(RouteCollectionBuilder $routes): void
|
protected function configureRoutes($routes): void
|
||||||
{
|
{
|
||||||
|
if ($routes instanceof RoutingConfigurator) { // available since Symfony 5.1
|
||||||
|
$routes
|
||||||
|
->add('app_hello', '/hello-world')
|
||||||
|
->controller('App\Controller::helloWorld')
|
||||||
|
;
|
||||||
|
} else { // support Symfony 4.4
|
||||||
$routes->add('/hello-world', 'App\Controller:helloWorld');
|
$routes->add('/hello-world', 'App\Controller:helloWorld');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
CON
|
CON
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user