File tree Expand file tree Collapse file tree 3 files changed +28
-35
lines changed Expand file tree Collapse file tree 3 files changed +28
-35
lines changed Original file line number Diff line number Diff line change @@ -81,15 +81,18 @@ public function testMissingParameterBag()
81
81
82
82
class TestAbstractController extends AbstractController
83
83
{
84
- use TestControllerTrait;
85
-
86
84
private $ throwOnUnexpectedService ;
87
85
88
86
public function __construct ($ throwOnUnexpectedService = true )
89
87
{
90
88
$ this ->throwOnUnexpectedService = $ throwOnUnexpectedService ;
91
89
}
92
90
91
+ public function __call (string $ method , array $ arguments )
92
+ {
93
+ return $ this ->$ method (...$ arguments );
94
+ }
95
+
93
96
public function setContainer (ContainerInterface $ container )
94
97
{
95
98
if (!$ this ->throwOnUnexpectedService ) {
@@ -114,11 +117,6 @@ public function setContainer(ContainerInterface $container)
114
117
return parent ::setContainer ($ container );
115
118
}
116
119
117
- public function getParameter (string $ name )
118
- {
119
- return parent ::getParameter ($ name );
120
- }
121
-
122
120
public function fooAction ()
123
121
{
124
122
}
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Bundle \FrameworkBundle \Tests \Controller ;
13
13
14
14
use Fig \Link \Link ;
15
- use Symfony \Bundle \FrameworkBundle \Controller \ControllerTrait ;
16
15
use Symfony \Bundle \FrameworkBundle \Tests \TestCase ;
17
16
use Symfony \Component \DependencyInjection \Container ;
18
17
use Symfony \Component \Form \Form ;
@@ -550,29 +549,3 @@ public function testAddLink()
550
549
$ this ->assertContains ($ link2 , $ links );
551
550
}
552
551
}
553
-
554
- trait TestControllerTrait
555
- {
556
- use ControllerTrait {
557
- generateUrl as public ;
558
- redirect as public ;
559
- forward as public ;
560
- getUser as public ;
561
- json as public ;
562
- file as public ;
563
- isGranted as public ;
564
- denyAccessUnlessGranted as public ;
565
- redirectToRoute as public ;
566
- addFlash as public ;
567
- isCsrfTokenValid as public ;
568
- renderView as public ;
569
- render as public ;
570
- stream as public ;
571
- createNotFoundException as public ;
572
- createAccessDeniedException as public ;
573
- createForm as public ;
574
- createFormBuilder as public ;
575
- getDoctrine as public ;
576
- addLink as public ;
577
- }
578
- }
Original file line number Diff line number Diff line change 3
3
namespace Symfony \Bundle \FrameworkBundle \Tests \Controller ;
4
4
5
5
use Symfony \Bundle \FrameworkBundle \Controller \Controller ;
6
+ use Symfony \Bundle \FrameworkBundle \Controller \ControllerTrait ;
6
7
7
8
class TestController extends Controller
8
9
{
9
- use TestControllerTrait;
10
+ use ControllerTrait {
11
+ generateUrl as public ;
12
+ redirect as public ;
13
+ forward as public ;
14
+ getUser as public ;
15
+ json as public ;
16
+ file as public ;
17
+ isGranted as public ;
18
+ denyAccessUnlessGranted as public ;
19
+ redirectToRoute as public ;
20
+ addFlash as public ;
21
+ isCsrfTokenValid as public ;
22
+ renderView as public ;
23
+ render as public ;
24
+ stream as public ;
25
+ createNotFoundException as public ;
26
+ createAccessDeniedException as public ;
27
+ createForm as public ;
28
+ createFormBuilder as public ;
29
+ getDoctrine as public ;
30
+ addLink as public ;
31
+ }
10
32
}
You can’t perform that action at this time.
0 commit comments