Skip to content

Commit

Permalink
Allow Symfony 7 and fix incompatibilities
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Mar 29, 2024
1 parent e626dbc commit 4d3b51c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ jobs:
deps: stable
symfony: '^4.4'

# Test latest php/Symfony
# Test Symfony 6
- php: 8.1
deps: stable
symfony: '^6.0'

# Test latest php/Symfony
- php: 8.3
deps: stable
symfony: '^7.0'

steps:
- name: Checkout code
uses: 'actions/checkout@v2'
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
"require": {
"php": ">=7.2.9",
"ext-xml": "*",
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0",
"symfony/dependency-injection": "^4.4|^5.0|^6.0|^7.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0|^7.0",
"symfony/security-acl": "^3.0",
"symfony/security-bundle": "^4.4|^5.0|^6.0"
"symfony/security-bundle": "^4.4|^5.0|^6.0|^7.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "^1.6.12|^2.0",
"doctrine/dbal": "^2.13.1|^3.1",
"doctrine/orm": "^2.7.3",
"symfony/console": "^4.4|^5.0|^6.0",
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
"symfony/phpunit-bridge": "^5.0|^6.0",
"symfony/yaml": "^4.4|^5.0|^6.0"
"symfony/console": "^4.4|^5.0|^6.0|^7.0",
"symfony/framework-bundle": "^4.4|^5.0|^6.0|^7.0",
"symfony/phpunit-bridge": "^5.0|^6.0|^7.0",
"symfony/yaml": "^4.4|^5.0|^6.0|^7.0"
},
"suggest": {
"doctrine/doctrine-bundle": "To use the default dbal configuration"
Expand Down
6 changes: 3 additions & 3 deletions src/Command/InitAclCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Schema\SchemaException;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -23,10 +24,9 @@
*
* @author Johannes M. Schmitt <[email protected]>
*/
#[AsCommand(name: 'acl:init', description: 'Creates ACL tables in the database')]
final class InitAclCommand extends Command
{
protected static $defaultName = 'acl:init';

private $connection;
private $schema;

Expand Down Expand Up @@ -62,7 +62,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
try {
$this->schema->addToSchema($this->connection->getSchemaManager()->createSchema());
Expand Down
6 changes: 3 additions & 3 deletions src/Command/SetAclCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bundle\AclBundle\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -28,10 +29,9 @@
*
* @author Kévin Dunglas <[email protected]>
*/
#[AsCommand(name: 'acl:set', description: 'Sets ACL for objects')]
final class SetAclCommand extends Command
{
protected static $defaultName = 'acl:set';

private $provider;

public function __construct(MutableAclProviderInterface $provider)
Expand Down Expand Up @@ -80,7 +80,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
// Parse arguments
$objectIdentities = [];
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Configuration implements ConfigurationInterface
*
* @return TreeBuilder The tree builder
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$builder = new TreeBuilder('acl');
$rootNode = $builder->getRootNode();
Expand Down

0 comments on commit 4d3b51c

Please sign in to comment.