Code Duplication    Length = 17-18 lines in 2 locations

src/Generation/Provider/AnnotationProvider.php 2 locations

@@ 374-390 (lines=17) @@
371
     *
372
     * @return array|null
373
     */
374
    public function getSerializationContext()
375
    {
376
        if (!$this->annotations->exists(SerializationContext::NAME)) {
377
            return null;
378
        }
379
380
        /** @var SerializationContext $contextAnnotation */
381
        $contextAnnotation = $this->annotations->get(SerializationContext::NAME);
382
383
        return [
384
            'groups' => $contextAnnotation->getGroups(),
385
            'version' => $contextAnnotation->getVersion(),
386
            'serializeNull' => $contextAnnotation->getSerializeNull(),
387
            'enableMaxDepthChecks' => $contextAnnotation->getEnableMaxDepthChecks(),
388
            'attributes' => $contextAnnotation->getAttributes(),
389
        ];
390
    }
391
392
    /**
393
     * Get JMS Deserialization context
@@ 397-414 (lines=18) @@
394
     *
395
     * @return array|null
396
     */
397
    public function getDeserializationContext()
398
    {
399
        if (!$this->annotations->exists(DeserializationContext::NAME)) {
400
            return null;
401
        }
402
403
        /** @var DeserializationContext $contextAnnotation */
404
        $contextAnnotation = $this->annotations->get(DeserializationContext::NAME);
405
406
        return [
407
            'groups' => $contextAnnotation->getGroups(),
408
            'version' => $contextAnnotation->getVersion(),
409
            'serializeNull' => $contextAnnotation->getSerializeNull(),
410
            'enableMaxDepthChecks' => $contextAnnotation->getEnableMaxDepthChecks(),
411
            'attributes' => $contextAnnotation->getAttributes(),
412
            'depth' => $contextAnnotation->getDepth(),
413
        ];
414
    }
415
416
    /**
417
     * Get the expected return