Skip to content

Commit b1e7cf9

Browse files
Remove unnecessary test and fix code style
Signed-off-by: Alexander Schranz <[email protected]>
1 parent afe8e63 commit b1e7cf9

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

src/TwigRendererFactory.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
use function is_array;
1616
use function is_object;
1717
use function sprintf;
18-
use function trigger_error;
19-
20-
use const E_USER_DEPRECATED;
2118

2219
/**
2320
* Create and return a Twig template instance.
@@ -30,8 +27,8 @@ class TwigRendererFactory
3027
*/
3128
public function __invoke(ContainerInterface $container): TwigRenderer
3229
{
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);
3532
/** @var Environment */
3633
$environment = $container->get(Environment::class);
3734

test/TwigRendererFactoryTest.php

-21
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717
use Twig\Environment;
1818

1919
use function restore_error_handler;
20-
use function set_error_handler;
2120
use function sprintf;
2221

23-
use const E_USER_DEPRECATED;
24-
2522
class TwigRendererFactoryTest extends TestCase
2623
{
2724
/** @var MockObject&ContainerInterface */
@@ -230,24 +227,6 @@ public function assertPathNamespaceContains(
230227
$this->assertContains($expected, $found, $message);
231228
}
232229

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-
251230
public function testMergeConfigRaisesExceptionForInvalidConfig(): void
252231
{
253232
$this->expectException(InvalidConfigException::class);

0 commit comments

Comments
 (0)