QueryManager::getGymHistories()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 1
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 9 and the first side effect is on line 5.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace Worldopole;
4
5
include_once __DIR__.'/../../../config.php';
6
include_once __DIR__.'/QueryManagerMysql.php';
7
include_once __DIR__.'/QueryManagerPostgresql.php';
8
9
abstract class QueryManager
10
{
11
    protected static $time_offset;
12
    protected static $config;
13
14
    private static $current;
15
16
    public static function current()
17
    {
18
        global $time_offset;
19
20
        if (null == self::$current) {
21
            $variables = realpath(dirname(__FILE__)).'/../../json/variables.json';
22
            self::$config = json_decode(file_get_contents($variables));
23
24
            include_once SYS_PATH.'/core/process/timezone.loader.php';
25
            self::$time_offset = $time_offset;
26
27
            switch (strtolower(SYS_DB_TYPE)) {
28
                case 'rdm':
29
                case 'realdevicemap':
30
                    self::$current = new QueryManagerMysqlRealDeviceMap();
31
                    break;
32
                case 'monocle-alt':
33
                case 'monocle-alt-mysql':
34
                    self::$current = new QueryManagerMysqlMonocleAlternate();
35
                    break;
36
                case 'monocle-alt-pgsql':
37
                    self::$current = new QueryManagerPostgresqlMonocleAlternate();
38
                    break;
39
                default: //rocketmap
40
                    self::$current = new QueryManagerMysqlRocketmap();
41
                    break;
42
            }
43
        }
44
45
        return self::$current;
46
    }
47
48
    private function __construct()
0 ignored issues
show
introduced by
Something seems to be off here. Are you sure you want to declare the constructor as private, and the class as abstract?
Loading history...
49
    {
50
    }
51
52
    // Misc
53
    abstract public function getEcapedString($string);
54
55
    // Tester
56
    abstract public function testTotalPokemon();
57
58
    abstract public function testTotalGyms();
59
60
    abstract public function testTotalPokestops();
61
62
    // Homepage
63
    abstract public function getTotalPokemon();
64
65
    abstract public function getTotalLures();
66
67
    abstract public function getTotalGyms();
68
69
    abstract public function getTotalRaids();
70
71
    abstract public function getTotalGymsForTeam($team_id);
72
73
    abstract public function getRecentAll();
74
75
    abstract public function getRecentMythic($mythic_pokemon);
76
77
    // Single Pokemon
78
    abstract public function getGymsProtectedByPokemon($pokemon_id);
79
80
    abstract public function getPokemonLastSeen($pokemon_id);
81
82
    abstract public function getTop50Pokemon($pokemon_id, $top_order_by, $top_direction);
83
84
    abstract public function getTop50Trainers($pokemon_id, $best_order_by, $best_direction);
85
86
    abstract public function getPokemonHeatmap($pokemon_id, $start, $end);
87
88
    abstract public function getPokemonGraph($pokemon_id);
89
90
    abstract public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons);
91
92
    abstract public function getPokemonSliderMinMax();
93
94
    abstract public function getMapsCoords();
95
96
    abstract public function getPokemonCount($pokemon_id);
97
98
    abstract public function getPokemonCountAll();
99
100
    abstract public function getRaidCount($pokemon_id);
101
102
    abstract public function getRaidCountAll();
103
104
    // Pokestops
105
    abstract public function getTotalPokestops();
106
107
    abstract public function getAllPokestops();
108
109
    // Gyms
110
    abstract public function getTeamGuardians($team_id);
111
112
    abstract public function getOwnedAndPoints($team_id);
113
114
    abstract public function getAllGyms();
115
116
    abstract public function getGymData($gym_id);
117
118
    abstract public function getGymDefenders($gym_id);
119
120
    // Gym History
121
    abstract public function getGymHistories($gym_name, $team, $page, $ranking);
122
123
    abstract public function getGymHistoriesPokemon($gym_id);
124
125
    abstract public function getHistoryForGym($page, $gym_id);
126
127
    // Raids
128
    abstract public function getAllRaids($page);
129
130
    // Trainers
131
    abstract public function getTrainers($trainer_name, $team, $page, $ranking);
132
133
    abstract public function getTrainerLevelCount($team_id);
134
135
    // Cron
136
    abstract public function getPokemonCountsActive();
137
138
    abstract public function getTotalPokemonIV();
139
140
    abstract public function getPokemonCountsLastDay();
141
142
    abstract public function getCaptchaCount();
143
144
    abstract public function getNestData($time, $minLatitude, $maxLatitude, $minLongitude, $maxLongitude);
145
146
    abstract public function getSpawnpointCount($minLatitude, $maxLatitude, $minLongitude, $maxLongitude);
147
}
148