Code Duplication    Length = 18-18 lines in 3 locations

src/Controller/Resource/CreateController.php 1 location

@@ 40-57 (lines=18) @@
37
    private $format;
38
    private $headerBuilder;
39
40
    public function __construct(
41
        MapInterface $gateways,
42
        SerializerInterface $serializer,
43
        Format $format,
44
        CreateBuilderInterface $headerBuilder
45
    ) {
46
        if (
47
            (string) $gateways->keyType() !== 'string' ||
48
            (string) $gateways->valueType() !== GatewayInterface::class
49
        ) {
50
            throw new InvalidArgumentException;
51
        }
52
53
        $this->gateways = $gateways;
54
        $this->serializer = $serializer;
55
        $this->format = $format;
56
        $this->headerBuilder = $headerBuilder;
57
    }
58
59
    public function defaultAction(Request $request): ResponseInterface
60
    {

src/Controller/Resource/GetController.php 1 location

@@ 36-53 (lines=18) @@
33
    private $gateways;
34
    private $headerBuilder;
35
36
    public function __construct(
37
        Format $format,
38
        SerializerInterface $serializer,
39
        MapInterface $gateways,
40
        GetBuilderInterface $headerBuilder
41
    ) {
42
        if (
43
            (string) $gateways->keyType() !== 'string' ||
44
            (string) $gateways->valueType() !== GatewayInterface::class
45
        ) {
46
            throw new InvalidArgumentException;
47
        }
48
49
        $this->format = $format;
50
        $this->serializer = $serializer;
51
        $this->gateways = $gateways;
52
        $this->headerBuilder = $headerBuilder;
53
    }
54
55
    public function defaultAction(Request $request, $identity): ResponseInterface
56
    {

src/Controller/Resource/UpdateController.php 1 location

@@ 41-58 (lines=18) @@
38
    private $format;
39
    private $headerBuilder;
40
41
    public function __construct(
42
        MapInterface $gateways,
43
        SerializerInterface $serializer,
44
        Format $format,
45
        UpdateBuilderInterface $headerBuilder
46
    ) {
47
        if (
48
            (string) $gateways->keyType() !== 'string' ||
49
            (string) $gateways->valueType() !== GatewayInterface::class
50
        ) {
51
            throw new InvalidArgumentException;
52
        }
53
54
        $this->gateways = $gateways;
55
        $this->serializer = $serializer;
56
        $this->format = $format;
57
        $this->headerBuilder = $headerBuilder;
58
    }
59
60
    public function defaultAction(Request $request, $identity): ResponseInterface
61
    {