Code Duplication    Length = 18-19 lines in 2 locations

src/Http/JsonApiBaseController.php 2 locations

@@ 60-77 (lines=18) @@
57
    /**
58
     * @inheritdoc
59
     */
60
    public static function index(
61
        array $routeParams,
62
        ContainerInterface $container,
63
        ServerRequestInterface $request
64
    ): ResponseInterface {
65
        static::assertClassValueDefined(static::API_CLASS);
66
        static::assertClassValueDefined(static::SCHEMA_CLASS);
67
        static::assertClassValueDefined(static::ON_INDEX_QUERY_VALIDATION_RULES_CLASS);
68
69
        return static::defaultIndexHandler(
70
            $request->getQueryParams(),
71
            $request->getUri(),
72
            static::defaultCreateQueryParser($container, static::ON_INDEX_QUERY_VALIDATION_RULES_CLASS),
73
            static::defaultCreateParameterMapper($container, static::SCHEMA_CLASS),
74
            static::defaultCreateApi($container, static::API_CLASS),
75
            $container->get(EncoderInterface::class)
76
        );
77
    }
78
79
    /**
80
     * @inheritdoc
@@ 110-128 (lines=19) @@
107
    /**
108
     * @inheritdoc
109
     */
110
    public static function read(
111
        array $routeParams,
112
        ContainerInterface $container,
113
        ServerRequestInterface $request
114
    ): ResponseInterface {
115
        static::assertClassValueDefined(static::API_CLASS);
116
        static::assertClassValueDefined(static::SCHEMA_CLASS);
117
        static::assertClassValueDefined(static::ON_READ_QUERY_VALIDATION_RULES_CLASS);
118
119
        return static::defaultReadHandler(
120
            $routeParams[static::ROUTE_KEY_INDEX],
121
            $request->getQueryParams(),
122
            $request->getUri(),
123
            static::defaultCreateQueryParser($container, static::ON_READ_QUERY_VALIDATION_RULES_CLASS),
124
            static::defaultCreateParameterMapper($container, static::SCHEMA_CLASS),
125
            static::defaultCreateApi($container, static::API_CLASS),
126
            $container->get(EncoderInterface::class)
127
        );
128
    }
129
130
    /**
131
     * @inheritdoc