Code Duplication    Length = 10-10 lines in 3 locations

src/Hal/Serializer/CollectionNormalizer.php 1 location

@@ 74-83 (lines=10) @@
71
        $parsed = IriHelper::parseIri($context['request_uri'] ?? '/', $this->pageParameterName);
72
73
        $currentPage = $lastPage = $itemsPerPage = $pageTotalItems = null;
74
        if ($paginated = $isPaginator = $object instanceof PartialPaginatorInterface) {
75
            if ($object instanceof PaginatorInterface) {
76
                $paginated = 1. !== $lastPage = $object->getLastPage();
77
            } else {
78
                $pageTotalItems = (float) count($object);
79
            }
80
81
            $currentPage = $object->getCurrentPage();
82
            $itemsPerPage = $object->getItemsPerPage();
83
        }
84
85
        $data = [
86
            '_links' => [

src/Hydra/Serializer/PartialCollectionViewNormalizer.php 1 location

@@ 55-64 (lines=10) @@
52
        }
53
54
        $currentPage = $lastPage = $itemsPerPage = $pageTotalItems = null;
55
        if ($paginated = $object instanceof PartialPaginatorInterface) {
56
            if ($object instanceof PaginatorInterface) {
57
                $paginated = 1. !== $lastPage = $object->getLastPage();
58
            } else {
59
                $itemsPerPage = $object->getItemsPerPage();
60
                $pageTotalItems = (float) count($object);
61
            }
62
63
            $currentPage = $object->getCurrentPage();
64
        }
65
66
        $parsed = IriHelper::parseIri($context['request_uri'] ?? '/', $this->pageParameterName);
67
        $appliedFilters = $parsed['parameters'];

src/JsonApi/Serializer/CollectionNormalizer.php 1 location

@@ 76-85 (lines=10) @@
73
        $parsed = IriHelper::parseIri($context['request_uri'] ?? '/', $this->pageParameterName);
74
75
        $currentPage = $lastPage = $itemsPerPage = $pageTotalItems = null;
76
        if ($paginated = $isPaginator = $object instanceof PartialPaginatorInterface) {
77
            if ($object instanceof PaginatorInterface) {
78
                $paginated = 1. !== $lastPage = $object->getLastPage();
79
            } else {
80
                $pageTotalItems = (float) count($object);
81
            }
82
83
            $currentPage = $object->getCurrentPage();
84
            $itemsPerPage = $object->getItemsPerPage();
85
        }
86
87
        $data = [
88
            'data' => [],