Skip to content

Commit b765e9d

Browse files
committed
Added recursive code example
1 parent 1f1736c commit b765e9d

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

  • tests/clapi/functional/resources/code/php/example/src/Course
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the FOSRestBundle package.
5+
*
6+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace FOS\RestBundle\Controller;
13+
14+
use FOS\RestBundle\View\ViewHandlerInterface;
15+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
16+
17+
class Foo {}
18+
class Bar {}
19+
20+
// Does the AbstractController::getSubscribedServices() method have a return type hint?
21+
if (true) {
22+
/**
23+
* Compat class for Symfony 6.0 and newer support.
24+
*
25+
* @internal
26+
*/
27+
abstract class BaseAbstractFOSRestController extends Foo
28+
{
29+
/**
30+
* {@inheritdoc}
31+
*/
32+
public static function getSubscribedServices(): array
33+
{
34+
return []
35+
}
36+
}
37+
} else {
38+
/**
39+
* Compat class for Symfony 5.4 and older support.
40+
*
41+
* @internal
42+
*/
43+
abstract class BaseAbstractFOSRestController extends Foo
44+
{
45+
/**
46+
* @return array
47+
*/
48+
public static function getSubscribedServices()
49+
{
50+
return [];
51+
}
52+
}
53+
}
54+
55+
/**
56+
* Controllers using the View functionality of FOSRestBundle.
57+
*/
58+
abstract class AbstractFOSRestController extends BaseAbstractFOSRestController
59+
{
60+
// use ControllerTrait;
61+
62+
protected function getViewHandler(): void
63+
{
64+
}
65+
}
66+

0 commit comments

Comments
 (0)