Code Duplication    Length = 16-16 lines in 2 locations

src/Controller/Admin/AdminController.php 1 location

@@ 152-167 (lines=16) @@
149
     *
150
     * @return array
151
     */
152
    protected function _buildStats(array $array)
153
    {
154
        $statistics = [];
155
156
        foreach ($array as $type => $event) {
157
            $statistics[$type] = Cache::remember($type, function () use ($event) {
158
                $this->eventManager()->attach(new Statistics());
159
                $event = new Event($event);
160
                $this->eventManager()->dispatch($event);
161
162
                return $event->result;
163
            }, 'statistics');
164
        }
165
166
        return $statistics;
167
    }
168
}
169

src/Controller/PagesController.php 1 location

@@ 101-116 (lines=16) @@
98
     *
99
     * @return array
100
     */
101
    protected function _buildStats(array $array)
102
    {
103
        $statistics = [];
104
105
        foreach ($array as $type => $event) {
106
            $statistics[$type] = Cache::remember($type, function () use ($event) {
107
                $this->eventManager()->attach(new Statistics());
108
                $event = new Event($event);
109
                $this->eventManager()->dispatch($event);
110
111
                return $event->result;
112
            }, 'statistics');
113
        }
114
115
        return $statistics;
116
    }
117
118
    /**
119
     * The user accept the use of cookies.