Code Duplication    Length = 13-13 lines in 2 locations

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

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

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

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