Code Duplication    Length = 18-19 lines in 2 locations

src/Http/JsonApiBaseController.php 2 locations

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