Code Duplication    Length = 8-8 lines in 5 locations

src/Validation/Execution/JsonApiRuleSerializer.php 5 locations

@@ 177-184 (lines=8) @@
174
     *
175
     * @return array
176
     */
177
    public static function getIdRule(array $ruleSet): array
178
    {
179
        assert(array_key_exists(static::ID_SERIALIZED, $ruleSet));
180
        $rule = $ruleSet[static::ID_SERIALIZED];
181
        assert(is_array($rule));
182
183
        return $rule;
184
    }
185
186
    /**
187
     * @param array $ruleSet
@@ 191-198 (lines=8) @@
188
     *
189
     * @return array
190
     */
191
    public static function getTypeRule(array $ruleSet): array
192
    {
193
        assert(array_key_exists(static::TYPE_SERIALIZED, $ruleSet));
194
        $rule = $ruleSet[static::TYPE_SERIALIZED];
195
        assert(is_array($rule));
196
197
        return $rule;
198
    }
199
200
    /**
201
     * @param array $ruleSet
@@ 205-212 (lines=8) @@
202
     *
203
     * @return array
204
     */
205
    public static function getAttributeRules(array $ruleSet): array
206
    {
207
        assert(array_key_exists(static::ATTRIBUTES_SERIALIZED, $ruleSet));
208
        $rules = $ruleSet[static::ATTRIBUTES_SERIALIZED];
209
        assert(is_array($rules));
210
211
        return $rules;
212
    }
213
214
    /**
215
     * @param array $ruleSet
@@ 219-226 (lines=8) @@
216
     *
217
     * @return array
218
     */
219
    public static function getToOneRules(array $ruleSet): array
220
    {
221
        assert(array_key_exists(static::TO_ONE_SERIALIZED, $ruleSet));
222
        $rules = $ruleSet[static::TO_ONE_SERIALIZED];
223
        assert(is_array($rules));
224
225
        return $rules;
226
    }
227
228
    /**
229
     * @param array $ruleSet
@@ 233-240 (lines=8) @@
230
     *
231
     * @return array
232
     */
233
    public static function getToManyRules(array $ruleSet): array
234
    {
235
        assert(array_key_exists(static::TO_MANY_SERIALIZED, $ruleSet));
236
        $rules = $ruleSet[static::TO_MANY_SERIALIZED];
237
        assert(is_array($rules));
238
239
        return $rules;
240
    }
241
242
    /**
243
     * @param array $serializedRule