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 1212namespace Symfony \Bundle \FrameworkBundle \Tests \Controller ;
1313
1414use Fig \Link \Link ;
15- use Symfony \Bundle \FrameworkBundle \Controller \ControllerTrait ;
1615use Symfony \Bundle \FrameworkBundle \Tests \TestCase ;
1716use Symfony \Component \DependencyInjection \Container ;
1817use Symfony \Component \Form \Form ;
@@ -550,29 +549,3 @@ public function testAddLink()
550549 $ this ->assertContains ($ link2 , $ links );
551550 }
552551}
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 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