Code Duplication    Length = 15-15 lines in 3 locations

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

@@ 57-71 (lines=15) @@
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
        return $filters;
71
    }
72
73
    /**
74
     * @param string $identityId

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

@@ 72-86 (lines=15) @@
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
        return $filters;
86
    }
87
88
    /**
89
     * @param Institution $institution

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

@@ 56-70 (lines=15) @@
53
     * @param RaSecondFactorQuery $query
54
     * @return array
55
     */
56
    public function getFilterOptions(RaSecondFactorQuery $query)
57
    {
58
        $doctrineQuery = $this->repository->createOptionsQuery($query);
59
60
        $filters = [];
61
        $results = $doctrineQuery->getArrayResult();
62
        foreach ($results as $options) {
63
            foreach ($options as $key => $value) {
64
                $val = (string)$value;
65
                $filters[$key][$val] = (string)$val;
66
            }
67
        }
68
69
        return $filters;
70
    }
71
72
    /**
73
     * @param RaSecondFactorQuery $query