Code Duplication    Length = 19-19 lines in 2 locations

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Service/RaCandidateService.php 1 location

@@ 57-75 (lines=19) @@
54
     * @param RaCandidateQuery $query
55
     * @return array
56
     */
57
    public function getFilterOptions(RaCandidateQuery $query)
58
    {
59
        $doctrineQuery = $this->raCandidateRepository->createOptionsQuery($query);
60
61
        $filters = [];
62
        $results = $doctrineQuery->getArrayResult();
63
        foreach ($results as $options) {
64
            foreach ($options as $key => $value) {
65
                $val = (string)$value;
66
                $filters[$key][$val] = (string)$val;
67
            }
68
        }
69
70
        foreach ($filters as $key => $values) {
71
            $filters[$key] = array_values($values);
72
        }
73
74
        return $filters;
75
    }
76
77
    /**
78
     * @param string $identityId

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Service/RaListingService.php 1 location

@@ 72-90 (lines=19) @@
69
     * @param RaListingQuery $query
70
     * @return array
71
     */
72
    public function getFilterOptions(RaListingQuery $query)
73
    {
74
        $doctrineQuery = $this->raListingRepository->createOptionsQuery($query);
75
76
        $filters = [];
77
        $results = $doctrineQuery->getArrayResult();
78
        foreach ($results as $options) {
79
            foreach ($options as $key => $value) {
80
                $val = (string)$value;
81
                $filters[$key][$val] = (string)$val;
82
            }
83
        }
84
85
        foreach ($filters as $key => $values) {
86
            $filters[$key] = array_values($values);
87
        }
88
89
        return $filters;
90
    }
91
92
    /**
93
     * @param Institution $institution