Code Duplication    Length = 13-13 lines in 2 locations

src/Kunstmaan/DashboardBundle/Command/GoogleAnalyticsOverviewsListCommand.php 1 location

@@ 135-147 (lines=13) @@
132
     *
133
     * @return array
134
     */
135
    private function getOverviewsOfConfig($configId)
136
    {
137
        // get specified config
138
        $configRepository = $this->em->getRepository('KunstmaanDashboardBundle:AnalyticsConfig');
139
        $config = $configRepository->find($configId);
140
141
        if (!$config) {
142
            throw new \Exception('Unkown config ID');
143
        }
144
145
        // get the overviews
146
        return $config->getOverviews();
147
    }
148
149
    /**
150
     * get all overviews

src/Kunstmaan/DashboardBundle/Command/GoogleAnalyticsSegmentsListCommand.php 1 location

@@ 99-111 (lines=13) @@
96
     *
97
     * @return array
98
     */
99
    private function getSegmentsOfConfig($configId)
100
    {
101
        // get specified config
102
        $configRepository = $this->em->getRepository('KunstmaanDashboardBundle:AnalyticsConfig');
103
        $config = $configRepository->find($configId);
104
105
        if (!$config) {
106
            throw new \Exception('Unkown config ID');
107
        }
108
109
        // get the segments
110
        return $config->getSegments();
111
    }
112
113
    /**
114
     * get all segments