Skip to content

Commit b1ec7e1

Browse files
committed
Fixing Symfony 6 support
1 parent ccbe55a commit b1ec7e1

16 files changed

+30
-20
lines changed

src/Chartjs/Tests/Kernel/AppKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
trait AppKernelTrait
2020
{
21-
public function getCacheDir()
21+
public function getCacheDir(): string
2222
{
2323
return $this->createTmpDir('cache');
2424
}
2525

26-
public function getLogDir()
26+
public function getLogDir(): string
2727
{
2828
return $this->createTmpDir('logs');
2929
}

src/Chartjs/Tests/Kernel/EmptyAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EmptyAppKernel extends Kernel
2424
{
2525
use AppKernelTrait;
2626

27-
public function registerBundles()
27+
public function registerBundles(): iterable
2828
{
2929
return [new ChartjsBundle()];
3030
}

src/Chartjs/Tests/Kernel/FrameworkAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FrameworkAppKernel extends Kernel
2626
{
2727
use AppKernelTrait;
2828

29-
public function registerBundles()
29+
public function registerBundles(): iterable
3030
{
3131
return [new FrameworkBundle(), new ChartjsBundle()];
3232
}

src/Chartjs/Tests/Kernel/TwigAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TwigAppKernel extends Kernel
2727
{
2828
use AppKernelTrait;
2929

30-
public function registerBundles()
30+
public function registerBundles(): iterable
3131
{
3232
return [new FrameworkBundle(), new TwigBundle(), new ChartjsBundle()];
3333
}

src/Cropperjs/Tests/Kernel/AppKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
trait AppKernelTrait
2020
{
21-
public function getCacheDir()
21+
public function getCacheDir(): string
2222
{
2323
return $this->createTmpDir('cache');
2424
}
2525

26-
public function getLogDir()
26+
public function getLogDir(): string
2727
{
2828
return $this->createTmpDir('logs');
2929
}

src/Cropperjs/Tests/Kernel/EmptyAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EmptyAppKernel extends Kernel
2424
{
2525
use AppKernelTrait;
2626

27-
public function registerBundles()
27+
public function registerBundles(): iterable
2828
{
2929
return [new CropperjsBundle()];
3030
}

src/Cropperjs/Tests/Kernel/FrameworkAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FrameworkAppKernel extends Kernel
2626
{
2727
use AppKernelTrait;
2828

29-
public function registerBundles()
29+
public function registerBundles(): iterable
3030
{
3131
return [new FrameworkBundle(), new CropperjsBundle()];
3232
}

src/Cropperjs/Tests/Kernel/TwigAppKernel.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1515
use Symfony\Bundle\TwigBundle\TwigBundle;
1616
use Symfony\Component\Config\Loader\LoaderInterface;
17+
use Symfony\Component\DependencyInjection\Alias;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
19+
use Symfony\Component\Form\FormFactoryInterface;
1820
use Symfony\Component\HttpKernel\Kernel;
1921
use Symfony\UX\Cropperjs\CropperjsBundle;
2022

@@ -27,7 +29,7 @@ class TwigAppKernel extends Kernel
2729
{
2830
use AppKernelTrait;
2931

30-
public function registerBundles()
32+
public function registerBundles(): iterable
3133
{
3234
return [new FrameworkBundle(), new TwigBundle(), new CropperjsBundle()];
3335
}
@@ -37,6 +39,9 @@ public function registerContainerConfiguration(LoaderInterface $loader)
3739
$loader->load(function (ContainerBuilder $container) {
3840
$container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true]);
3941
$container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]);
42+
43+
// create a public alias - FormFactoryInterface is removed otherwise
44+
$container->setAlias('public_form_factory', new Alias(FormFactoryInterface::class, true));
4045
});
4146
}
4247
}

src/Dropzone/Tests/Kernel/AppKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
trait AppKernelTrait
2020
{
21-
public function getCacheDir()
21+
public function getCacheDir(): string
2222
{
2323
return $this->createTmpDir('cache');
2424
}
2525

26-
public function getLogDir()
26+
public function getLogDir(): string
2727
{
2828
return $this->createTmpDir('logs');
2929
}

src/Dropzone/Tests/Kernel/EmptyAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EmptyAppKernel extends Kernel
2424
{
2525
use AppKernelTrait;
2626

27-
public function registerBundles()
27+
public function registerBundles(): iterable
2828
{
2929
return [new DropzoneBundle()];
3030
}

src/Dropzone/Tests/Kernel/FrameworkAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FrameworkAppKernel extends Kernel
2626
{
2727
use AppKernelTrait;
2828

29-
public function registerBundles()
29+
public function registerBundles(): iterable
3030
{
3131
return [new FrameworkBundle(), new DropzoneBundle()];
3232
}

src/Dropzone/Tests/Kernel/TwigAppKernel.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1515
use Symfony\Bundle\TwigBundle\TwigBundle;
1616
use Symfony\Component\Config\Loader\LoaderInterface;
17+
use Symfony\Component\DependencyInjection\Alias;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
19+
use Symfony\Component\Form\FormFactoryInterface;
1820
use Symfony\Component\HttpKernel\Kernel;
1921
use Symfony\UX\Dropzone\DropzoneBundle;
2022

@@ -27,7 +29,7 @@ class TwigAppKernel extends Kernel
2729
{
2830
use AppKernelTrait;
2931

30-
public function registerBundles()
32+
public function registerBundles(): iterable
3133
{
3234
return [new FrameworkBundle(), new TwigBundle(), new DropzoneBundle()];
3335
}
@@ -45,6 +47,9 @@ public function registerContainerConfiguration(LoaderInterface $loader)
4547
'exception_controller' => null,
4648
'debug' => '%kernel.debug%',
4749
]);
50+
51+
// create a public alias - FormFactoryInterface is removed otherwise
52+
$container->setAlias('public_form_factory', new Alias(FormFactoryInterface::class, true));
4853
});
4954
}
5055
}

src/LazyImage/Tests/Kernel/AppKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
trait AppKernelTrait
2020
{
21-
public function getCacheDir()
21+
public function getCacheDir(): string
2222
{
2323
return $this->createTmpDir('cache');
2424
}
2525

26-
public function getLogDir()
26+
public function getLogDir(): string
2727
{
2828
return $this->createTmpDir('logs');
2929
}

src/LazyImage/Tests/Kernel/EmptyAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EmptyAppKernel extends Kernel
2424
{
2525
use AppKernelTrait;
2626

27-
public function registerBundles()
27+
public function registerBundles(): iterable
2828
{
2929
return [new LazyImageBundle()];
3030
}

src/LazyImage/Tests/Kernel/FrameworkAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FrameworkAppKernel extends Kernel
2626
{
2727
use AppKernelTrait;
2828

29-
public function registerBundles()
29+
public function registerBundles(): iterable
3030
{
3131
return [new FrameworkBundle(), new LazyImageBundle()];
3232
}

src/LazyImage/Tests/Kernel/TwigAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TwigAppKernel extends Kernel
2727
{
2828
use AppKernelTrait;
2929

30-
public function registerBundles()
30+
public function registerBundles(): iterable
3131
{
3232
return [new FrameworkBundle(), new TwigBundle(), new LazyImageBundle()];
3333
}

0 commit comments

Comments
 (0)