Code Duplication    Length = 3-3 lines in 2 locations

src/Hal/Serializer/CollectionNormalizer.php 1 location

@@ 108-110 (lines=3) @@
105
            $data['_links']['item'][] = $item['_links']['self'];
106
        }
107
108
        if (is_array($object) || $object instanceof \Countable) {
109
            $data['totalItems'] = $object instanceof PaginatorInterface ? (int) $object->getTotalItems() : count($object);
110
        }
111
112
        if ($isPaginator) {
113
            $data['itemsPerPage'] = (int) $itemsPerPage;

src/Hydra/Serializer/CollectionNormalizer.php 1 location

@@ 91-93 (lines=3) @@
88
            $data['hydra:member'][] = $this->normalizer->normalize($obj, $format, $context);
89
        }
90
91
        if (is_array($object) || $object instanceof \Countable) {
92
            $data['hydra:totalItems'] = $object instanceof PaginatorInterface ? $object->getTotalItems() : count($object);
93
        }
94
95
        return $data;
96
    }