Skip to content

Commit

Permalink
Merge pull request #179 from dave-redfern/support-sf6
Browse files Browse the repository at this point in the history
Add support for Symfony 6
  • Loading branch information
andig authored Jan 10, 2022
2 parents d9037fd + e11c14a commit 1125ab4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/.idea/
/vendor/
composer.lock
tests/Fixtures/Symfony/cache
tests/Fixtures/Symfony/logs
tests/Fixtures/Symfony/var
tests/Fixtures/Symfony/var
.phpunit.result.cache
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"license": "MIT",
"require": {
"php-pm/php-pm": "^2.0",
"symfony/http-foundation": "^3.4|^4.2.12|^5.0",
"symfony/http-kernel": "^3.4|^4.0|^5.0",
"symfony/http-foundation": "^4.2.12|^5.0|^6.0",
"symfony/http-kernel": "^4.0|^5.0|^6.0",
"guzzlehttp/psr7": "^1.5"
},
"require-dev": {
"phpunit/phpunit": "^7.0",
"symfony/framework-bundle": "^3.4|^4.1.12|^5.0",
"symfony/yaml": "^3.4|^4.0|^5.0",
"phpunit/phpunit": "^9.5",
"symfony/framework-bundle": "^4.1.12|^5.0|^6.0",
"symfony/yaml": "^4.0|^5.0|^6.0",
"doctrine/annotations": "^1.6"
},
"autoload": {
Expand Down
10 changes: 5 additions & 5 deletions tests/Fixtures/Symfony/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

class Kernel extends \Symfony\Component\HttpKernel\Kernel
{
use MicroKernelTrait;

const CONFIG_EXTS = '.{php,xml,yaml,yml}';

public function registerBundles()
public function registerBundles(): iterable
{
$contents = require $this->getProjectDir() . '/config/bundles.php';
foreach ($contents as $class => $envs) {
Expand All @@ -36,14 +36,14 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
$loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob');
}

protected function configureRoutes(RouteCollectionBuilder $routes)
protected function configureRoutes(RoutingConfigurator $routes)
{
$confDir = $this->getProjectDir() . '/config';

$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS);
}

public function getProjectDir()
public function getProjectDir(): string
{
return __DIR__;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/SymfonyBootstrapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

class SymfonyBootstrapTest extends TestCase
{
public function setUp()
public function setUp(): void
{
ProcessSlave::$slave = new ProcessSlaveDouble();
}

public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
$fs = new Filesystem();
$fs->remove(__DIR__.'/Fixtures/Symfony/var');
Expand Down

0 comments on commit 1125ab4

Please sign in to comment.