Failed Conditions
Pull Request — master (#371)
by
unknown
02:05
created

QueryManager::getTeamGuardians()

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 7 and the first side effect is on line 3.

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
include_once __DIR__.'/../../../config.php';
4
include_once __DIR__.'/QueryManagerMysql.php';
5
include_once __DIR__.'/QueryManagerPostgresql.php';
6
7
abstract class QueryManager
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

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