Code Duplication    Length = 16-17 lines in 2 locations

Tests/NimoTestCase.php 2 locations

@@ 42-57 (lines=16) @@
39
        return $this->getMockForAbstractClass(ResponseInterface::class);
40
    }
41
42
    protected function assertedHandler(ServerRequestInterface $expectedRequest, ResponseInterface $response)
43
    {
44
        return new class($expectedRequest, $response) extends AbstractHandler
45
        {
46
            use RememberConstructorParamTrait;
47
48
            protected function main(): ResponseInterface
49
            {
50
                /** @noinspection PhpUndefinedFieldInspection */
51
                list($expectedRequest, $response) = $this->params;
52
                Assert::assertSame($expectedRequest, $this->request);
53
                return $response;
54
            }
55
        };
56
57
    }
58
59
    protected function assertedNoopMiddleware(
60
        ServerRequestInterface $expectedRequest,
@@ 59-75 (lines=17) @@
56
57
    }
58
59
    protected function assertedNoopMiddleware(
60
        ServerRequestInterface $expectedRequest,
61
        ServerRequestInterface $passedRequest = null
62
    ) {
63
        return new class($expectedRequest, $passedRequest) extends AbstractMiddleware
64
        {
65
            use RememberConstructorParamTrait;
66
67
            protected function main(): ResponseInterface
68
            {
69
                /** @noinspection PhpUndefinedFieldInspection */
70
                list($expectedRequest, $passedRequest) = $this->params;
71
                Assert::assertSame($expectedRequest, $this->request);
72
                return $this->delegate($passedRequest);
73
            }
74
        };
75
    }
76
77
    protected function assertedMiddleware(
78
        ServerRequestInterface $expectedRequest,