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()
8181
8282class TestAbstractController extends AbstractController
8383{
84- use TestControllerTrait;
85-
8684 private $ throwOnUnexpectedService ;
8785
8886 public function __construct ($ throwOnUnexpectedService = true )
8987 {
9088 $ this ->throwOnUnexpectedService = $ throwOnUnexpectedService ;
9189 }
9290
91+ public function __call (string $ method , array $ arguments )
92+ {
93+ return $ this ->$ method (...$ arguments );
94+ }
95+
9396 public function setContainer (ContainerInterface $ container )
9497 {
9598 if (!$ this ->throwOnUnexpectedService ) {
@@ -114,11 +117,6 @@ public function setContainer(ContainerInterface $container)
114117 return parent ::setContainer ($ container );
115118 }
116119
117- public function getParameter (string $ name )
118- {
119- return parent ::getParameter ($ name );
120- }
121-
122120 public function fooAction ()
123121 {
124122 }
Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Bundle \FrameworkBundle \Tests \Controller ;
1313
14- use Symfony \Bundle \FrameworkBundle \Controller \ControllerTrait ;
1514use Symfony \Bundle \FrameworkBundle \Tests \TestCase ;
1615use Symfony \Component \DependencyInjection \Container ;
1716use Symfony \Component \Form \Form ;
@@ -545,29 +544,3 @@ public function testAddLink()
545544 $ this ->assertContains ($ link2 , $ links );
546545 }
547546}
548-
549- trait TestControllerTrait
550- {
551- use ControllerTrait {
552- generateUrl as public ;
553- redirect as public ;
554- forward as public ;
555- getUser as public ;
556- json as public ;
557- file as public ;
558- isGranted as public ;
559- denyAccessUnlessGranted as public ;
560- redirectToRoute as public ;
561- addFlash as public ;
562- isCsrfTokenValid as public ;
563- renderView as public ;
564- render as public ;
565- stream as public ;
566- createNotFoundException as public ;
567- createAccessDeniedException as public ;
568- createForm as public ;
569- createFormBuilder as public ;
570- getDoctrine as public ;
571- addLink as public ;
572- }
573- }
Original file line number Diff line number Diff line change 33namespace Symfony \Bundle \FrameworkBundle \Tests \Controller ;
44
55use Symfony \Bundle \FrameworkBundle \Controller \Controller ;
6+ use Symfony \Bundle \FrameworkBundle \Controller \ControllerTrait ;
67
78class TestController extends Controller
89{
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+ }
1032}
You can’t perform that action at this time.
0 commit comments