app/Statistics/Repository/PlaceRepository.php
private function getTop10Places(array $places): array
    {
        $top10 = [];
        $i     = 0;

        arsort($places);

        foreach ($places as $place => $count) {
            $tmp     = new Place($place, $this->tree);
            $top10[] = [
                'place' => $tmp,
                'count' => $count,
            ];

            ++$i;

            if ($i === 10) {
                break;
            }
        }

        return $top10;
    }
private function getTop10Places(array $places): array
    {
        $top10 = [];
        $i     = 0;

        arsort($places);

        foreach ($places as $place => $count) {
            $tmp     = new Place($place, $this->tree);
            $top10[] = [
                'place' => $tmp,
                'count' => $count,
            ];

            ++$i;

            if ($i === 10) {
                break;
            }
        }

        return $top10;
    }
private function getTop10Places ( array $ places ) : array { $ top10 = [ ] ; $ i = 0 ; arsort ( $ places ) ; foreach ( $ places as $ place => $ count ) { $ tmp = new Place ( $ place , $ this -> tree ) ; $ top10 [ ] = [ 'place' => $ tmp , 'count' => $ count , ] ; ++ $ i ; if ( $ i === 10 ) { break ; } } return $ top10 ; }
Get the top 10 places list.

@param array $places

@return array
Get the top 10 places list .