Skip to content

Commit

Permalink
[CI] Install friendsofsymfony/rest-bundle with Symfony 7 (#2257)
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Apr 6, 2024
1 parent 43519f4 commit db14c1a
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions tests/Functional/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,9 @@ public function registerBundles(): iterable
new ApiPlatformBundle(),
new NelmioApiDocBundle(),
new TestBundle(),
new FOSRestBundle(),
];

if (class_exists(FOSRestBundle::class)) {
$bundles[] = new FOSRestBundle();
}

if (self::USE_JMS === $this->flag || self::USE_BAZINGA === $this->flag) {
$bundles[] = new JMSSerializerBundle();

Expand Down Expand Up @@ -156,30 +153,28 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
]],
]);

if (class_exists(FOSRestBundle::class)) {
$c->loadFromExtension('fos_rest', [
'format_listener' => [
'rules' => [
[
'path' => '^/',
'fallback_format' => 'json',
],
$c->loadFromExtension('fos_rest', [
'format_listener' => [
'rules' => [
[
'path' => '^/',
'fallback_format' => 'json',
],
],
]);
],
]);

// If FOSRestBundle 2.8
if (class_exists(\FOS\RestBundle\EventListener\ResponseStatusCodeListener::class)) {
$c->loadFromExtension('fos_rest', [
'exception' => [
'enabled' => false,
'exception_listener' => false,
'serialize_exceptions' => false,
],
'body_listener' => false,
'routing_loader' => false,
]);
}
// If FOSRestBundle 2.8
if (class_exists(\FOS\RestBundle\EventListener\ResponseStatusCodeListener::class)) {
$c->loadFromExtension('fos_rest', [
'exception' => [
'enabled' => false,
'exception_listener' => false,
'serialize_exceptions' => false,
],
'body_listener' => false,
'routing_loader' => false,
]);
}

$models = [
Expand Down

0 comments on commit db14c1a

Please sign in to comment.