Skip to content

Commit 40955c3

Browse files
authored
feature: support symfony/dependency-injection 7.x (#1127)
1 parent e7a7ab4 commit 40955c3

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace APY\DataGridBundle\Grid\Export;
4+
5+
use Symfony\Component\DependencyInjection\ContainerAwareInterface as SymfonyContainerAwareInterface;
6+
use Symfony\Component\DependencyInjection\ContainerInterface;
7+
8+
if (interface_exists(SymfonyContainerAwareInterface::class)) {
9+
interface ContainerAwareInterface extends SymfonyContainerAwareInterface
10+
{
11+
}
12+
} else {
13+
interface ContainerAwareInterface
14+
{
15+
public function setContainer(?ContainerInterface $container);
16+
}
17+
}

Grid/Export/Export.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
use APY\DataGridBundle\Grid\Column\ArrayColumn;
1616
use APY\DataGridBundle\Grid\Grid;
17-
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
1817
use Symfony\Component\DependencyInjection\ContainerInterface;
1918
use Symfony\Component\HttpFoundation\Response;
2019
use Twig\TemplateWrapper;

Grid/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
use APY\DataGridBundle\Grid\Column\ActionsColumn;
1919
use APY\DataGridBundle\Grid\Column\Column;
2020
use APY\DataGridBundle\Grid\Column\MassActionColumn;
21+
use APY\DataGridBundle\Grid\Export\ContainerAwareInterface;
2122
use APY\DataGridBundle\Grid\Export\Export;
2223
use APY\DataGridBundle\Grid\Export\ExportInterface;
2324
use APY\DataGridBundle\Grid\Source\Entity;
2425
use APY\DataGridBundle\Grid\Source\Source;
2526
use Symfony\Component\DependencyInjection\Container;
26-
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
2727
use Symfony\Component\HttpFoundation\RedirectResponse;
2828
use Symfony\Component\HttpFoundation\Request;
2929
use Symfony\Component\HttpFoundation\Response;

Translation/ColumnTitleAnnotationTranslationExtractor.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,13 @@
99
use JMS\TranslationBundle\Model\Message;
1010
use JMS\TranslationBundle\Model\MessageCatalogue;
1111
use JMS\TranslationBundle\Translation\Extractor\FileVisitorInterface;
12-
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
13-
use Symfony\Component\DependencyInjection\ContainerInterface;
1412

15-
class ColumnTitleAnnotationTranslationExtractor implements FileVisitorInterface, \PHPParser_NodeVisitor, ContainerAwareInterface
13+
class ColumnTitleAnnotationTranslationExtractor implements FileVisitorInterface, \PHPParser_NodeVisitor
1614
{
1715
private $annotated;
1816
private $catalogue;
1917
private $parsedClassName;
2018

21-
/**
22-
* @var ContainerInterface
23-
*/
24-
private $container;
25-
2619
public function beforeTraverse(array $nodes)
2720
{
2821
$this->annotated = false;
@@ -68,7 +61,7 @@ public function visitPhpFile(\SplFileInfo $file, MessageCatalogue $catalogue, ar
6861
if ($this->annotated) {
6962
// Get annotations for the class
7063
$annotationDriver = new Annotation(new DoctrineAnnotationReader());
71-
$manager = new Manager($this->container);
64+
$manager = new Manager();
7265
$manager->addDriver($annotationDriver, -1);
7366
$metadata = $manager->getMetadata($this->parsedClassName);
7467

@@ -87,12 +80,4 @@ public function visitPhpFile(\SplFileInfo $file, MessageCatalogue $catalogue, ar
8780
public function visitTwigFile(\SplFileInfo $file, MessageCatalogue $catalogue, \Twig_Node $node)
8881
{
8982
}
90-
91-
/**
92-
* {@inheritdoc}
93-
*/
94-
public function setContainer(ContainerInterface $container = null)
95-
{
96-
$this->container = $container;
97-
}
9883
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"require": {
2727
"php": "^7.4 || ^8.0",
2828
"symfony/form": "^3.0 || ^4.0 || ^5.0 || ^6.0",
29-
"symfony/dependency-injection": "^3.0 || ^4.0 || ^5.0 || ^6.0",
29+
"symfony/dependency-injection": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
3030
"symfony/config": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
3131
"symfony/http-foundation": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
3232
"symfony/http-kernel": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",

0 commit comments

Comments
 (0)