File tree 2 files changed +2
-26
lines changed
2 files changed +2
-26
lines changed Original file line number Diff line number Diff line change 15
15
use function is_array ;
16
16
use function is_object ;
17
17
use function sprintf ;
18
- use function trigger_error ;
19
-
20
- use const E_USER_DEPRECATED ;
21
18
22
19
/**
23
20
* Create and return a Twig template instance.
@@ -30,8 +27,8 @@ class TwigRendererFactory
30
27
*/
31
28
public function __invoke (ContainerInterface $ container ): TwigRenderer
32
29
{
33
- $ config = $ container ->has ('config ' ) ? $ container ->get ('config ' ) : [];
34
- $ config = self ::mergeConfig ($ config );
30
+ $ config = $ container ->has ('config ' ) ? $ container ->get ('config ' ) : [];
31
+ $ config = self ::mergeConfig ($ config );
35
32
/** @var Environment */
36
33
$ environment = $ container ->get (Environment::class);
37
34
Original file line number Diff line number Diff line change 17
17
use Twig \Environment ;
18
18
19
19
use function restore_error_handler ;
20
- use function set_error_handler ;
21
20
use function sprintf ;
22
21
23
- use const E_USER_DEPRECATED ;
24
-
25
22
class TwigRendererFactoryTest extends TestCase
26
23
{
27
24
/** @var MockObject&ContainerInterface */
@@ -230,24 +227,6 @@ public function assertPathNamespaceContains(
230
227
$ this ->assertContains ($ expected , $ found , $ message );
231
228
}
232
229
233
- public function testCallingFactoryWithoutTwigEnvironmentServiceEmitsDeprecationNotice (): void
234
- {
235
- $ this ->container ->expects (self ::exactly (4 ))->method ('has ' )->willReturn (false );
236
-
237
- $ factory = new TwigRendererFactory ();
238
-
239
- $ this ->errorHandler = set_error_handler (
240
- function ($ errno , $ errstr ): bool {
241
- $ this ->assertStringContainsString (Environment::class, $ errstr );
242
- return true ;
243
- },
244
- E_USER_DEPRECATED
245
- );
246
-
247
- $ twig = $ factory ($ this ->container );
248
- $ this ->assertInstanceOf (TwigRenderer::class, $ twig );
249
- }
250
-
251
230
public function testMergeConfigRaisesExceptionForInvalidConfig (): void
252
231
{
253
232
$ this ->expectException (InvalidConfigException::class);
You can’t perform that action at this time.
0 commit comments