Skip to content

Commit

Permalink
Symfony 7.0 support and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsykun committed Oct 8, 2023
1 parent b5d318f commit d9b13e2
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.github export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
symfony.lock export-ignore
20 changes: 18 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,29 @@
"ext-pdo_sqlite": "*",
"doctrine/doctrine-bundle": "^2.6",
"doctrine/orm": "^2.7",
"phpunit/phpunit": "^8.5 || ^10.0",
"phpunit/phpunit": "^8.5 || ^9.0 || ^10.0",
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/console": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/security-bundle": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/var-dumper": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/yaml": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/flex": "^1.10 || ^2.0",
"symfony/monolog-bundle": "^3.2"
}
},
"config": {
"allow-plugins": {
"symfony/flex": true
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"symfony": {
"allow-contrib": false
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PushDatadogHandlerPass implements CompilerPassInterface
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if ('all' !== $container->getParameter('okvpn_datadog.logging') || false === $container->getParameter('okvpn_datadog.profiling')) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/CompilerPass/SqlLoggerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(array $connections)
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (false === $container->hasDefinition('okvpn_datadog.logger.sql')) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Configuration implements ConfigurationInterface
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('okvpn_datadog');
$rootNode = $treeBuilder->getRootNode();
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/OkvpnDatadogExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class OkvpnDatadogExtension extends Extension
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
Expand Down
125 changes: 125 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"doctrine/doctrine-bundle": {
"version": "2.11",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "2.10",
"ref": "e025a6cb69b195970543820b2f18ad21724473fa"
},
"files": [
"config/packages/doctrine.yaml",
"src/Entity/.gitignore",
"src/Repository/.gitignore"
]
},
"phpunit/phpunit": {
"version": "10.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "9.6",
"ref": "7364a21d87e658eb363c5020c072ecfdc12e2326"
},
"files": [
".env.test",
"phpunit.xml.dist",
"tests/bootstrap.php"
]
},
"symfony/console": {
"version": "7.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "5.3",
"ref": "da0c8be8157600ad34f10ff0c9cc91232522e047"
},
"files": [
"bin/console"
]
},
"symfony/flex": {
"version": "2.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "1.0",
"ref": "146251ae39e06a95be0fe3d13c807bcf3938b172"
},
"files": [
".env"
]
},
"symfony/framework-bundle": {
"version": "7.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "7.0",
"ref": "de6e1b3e2bbbe69e36262d72c3f3db858b1ab391"
},
"files": [
"config/packages/cache.yaml",
"config/packages/framework.yaml",
"config/preload.php",
"config/routes/framework.yaml",
"config/services.yaml",
"public/index.php",
"src/Controller/.gitignore",
"src/Kernel.php"
]
},
"symfony/monolog-bundle": {
"version": "3.9999999",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "3.7",
"ref": "213676c4ec929f046dfde5ea8e97625b81bc0578"
},
"files": [
"config/packages/monolog.yaml"
]
},
"symfony/phpunit-bridge": {
"version": "6.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.3",
"ref": "01dfaa98c58f7a7b5a9b30e6edb7074af7ed9819"
},
"files": [
".env.test",
"bin/phpunit",
"phpunit.xml.dist",
"tests/bootstrap.php"
]
},
"symfony/routing": {
"version": "7.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.2",
"ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6"
},
"files": [
"config/packages/routing.yaml",
"config/routes.yaml"
]
},
"symfony/security-bundle": {
"version": "7.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.0",
"ref": "8a5b112826f7d3d5b07027f93786ae11a1c7de48"
},
"files": [
"config/packages/security.yaml"
]
}
}
2 changes: 1 addition & 1 deletion tests/Functional/App/Entity/DatadogUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DatadogUser
*/
#[ORM\Column('id', type: 'integer')]
#[ORM\Id]
#[ORM\CustomIdGenerator]
#[ORM\GeneratedValue('IDENTITY')]
private $id;

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/App/OkvpnKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RouteCollectionBuilder;

if (Kernel::MAJOR_VERSION >= 5) {
if (Kernel::VERSION_ID >= 50000) {
trait OkvpnKernelTrait
{
public function loadRoutes()
Expand Down Expand Up @@ -81,7 +81,7 @@ public function registerContainerConfiguration(LoaderInterface $loader)
]);
});

if (Kernel::MAJOR_VERSION > 5) {
if (Kernel::VERSION_ID >= 60000) {
$loader->load(__DIR__.'/config6.yml');
} else {
$loader->load(__DIR__.'/config.yml');
Expand Down

0 comments on commit d9b13e2

Please sign in to comment.