Code Duplication    Length = 23-23 lines in 2 locations

eZ/Publish/Core/MVC/Symfony/EventListener/Tests/ContentViewTwigVariablesSubscriberTest.php 1 location

@@ 45-67 (lines=23) @@
42
        );
43
    }
44
45
    private function getProvider(string $identifier): VariableProvider
46
    {
47
        return new class($identifier) implements VariableProvider {
48
            private $identifier;
49
50
            public function __construct(string $identifier)
51
            {
52
                $this->identifier = $identifier;
53
            }
54
55
            public function getIdentifier(): string
56
            {
57
                return $this->identifier;
58
            }
59
60
            public function getTwigVariables(View $view, array $options = []): object
61
            {
62
                return (object)[
63
                    $this->identifier . '_parameter' => $this->identifier . '_value',
64
                ];
65
            }
66
        };
67
    }
68
69
    private function getContentViewMockSubscriber(): ContentViewTwigVariablesSubscriber
70
    {

eZ/Publish/Core/MVC/Symfony/View/Tests/VariableProviderRegistryTest.php 1 location

@@ 27-49 (lines=23) @@
24
        );
25
    }
26
27
    private function getProvider(string $identifier): VariableProvider
28
    {
29
        return new class($identifier) implements VariableProvider {
30
            private $identifier;
31
32
            public function __construct(string $identifier)
33
            {
34
                $this->identifier = $identifier;
35
            }
36
37
            public function getIdentifier(): string
38
            {
39
                return $this->identifier;
40
            }
41
42
            public function getTwigVariables(View $view, array $options = []): object
43
            {
44
                return (object)[
45
                    $this->identifier . '_parameter' => $this->identifier . '_value',
46
                ];
47
            }
48
        };
49
    }
50
51
    public function testParameterProviderGetter(): void
52
    {