Failed Conditions
Pull Request — master (#275)
by Ramiro
02:40
created
install/tester.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 {
23 23
 	$lock_msg = '';
24 24
 
25
-	$mysqli 	= new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
25
+	$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
26 26
 
27 27
 	// Pokemon Test
28
-	$req 		= "SELECT COUNT(*) as total FROM pokemon";
29
-	$result 	= $mysqli->query($req);
28
+	$req = "SELECT COUNT(*) as total FROM pokemon";
29
+	$result = $mysqli->query($req);
30 30
 
31 31
 	if (!is_object($result)) {
32 32
 		$lock_msg .= "Error: No Pokémon database found<br>";
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	}
41 41
 
42 42
 	// Gym Test
43
-	$req 		= "SELECT COUNT(*) as total FROM gym";
44
-	$result 	= $mysqli->query($req);
43
+	$req = "SELECT COUNT(*) as total FROM gym";
44
+	$result = $mysqli->query($req);
45 45
 
46 46
 	if (!is_object($result)) {
47 47
 		$lock_msg .= "Error: No Gym database found<br>";
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 
57 57
 
58 58
 	// Pokéstop Test
59
-	$req 		= "SELECT COUNT(*) as total FROM pokestop";
60
-	$result 	= $mysqli->query($req);
59
+	$req = "SELECT COUNT(*) as total FROM pokestop";
60
+	$result = $mysqli->query($req);
61 61
 
62 62
 	if (!is_object($result)) {
63 63
 		$lock_msg .= "Error: No Pokestop database found<br>";
Please login to merge, or discard this patch.
pages/trainer.page.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
 <script type="text/javascript">
101 101
 <?=
102 102
 $trainerName = "";
103
-if (isset($_GET['name']) && $_GET['name']!="") {
103
+if (isset($_GET['name']) && $_GET['name'] != "") {
104 104
 	$trainerName = htmlentities($_GET['name']);
105 105
 }
106 106
 
Please login to merge, or discard this patch.
core/js/dashboard.graph.js.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 // Include & load the variables
11 11
 // ############################
12 12
 
13
-$variables	= SYS_PATH.'/core/json/variables.json';
14
-$config		= json_decode(file_get_contents($variables));
13
+$variables = SYS_PATH.'/core/json/variables.json';
14
+$config = json_decode(file_get_contents($variables));
15 15
 
16 16
 
17 17
 // Include & load locales (because it's REALLY REALLY REALLY IMPORTANT TO HAVE A FULLY TRANSLATE DASHBOARD )
@@ -24,15 +24,15 @@  discard block
 block discarded – undo
24 24
 // Check if there's a pokemon stat file
25 25
 // ####################################
26 26
 
27
-$stats_file	= SYS_PATH.'/core/json/pokemon.stats.json';
28
-$stats		= json_decode(file_get_contents($stats_file));
27
+$stats_file = SYS_PATH.'/core/json/pokemon.stats.json';
28
+$stats = json_decode(file_get_contents($stats_file));
29 29
 
30 30
 
31
-$now		= time();
32
-$yesterday	= $now-86400;
33
-$lastweek	= $now-604800;
31
+$now = time();
32
+$yesterday = $now - 86400;
33
+$lastweek = $now - 604800;
34 34
 
35
-$i=0;
35
+$i = 0;
36 36
 $labels_global = array();
37 37
 $total = array();
38 38
 $labels = array();
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 
60 60
 foreach ($stats as $data) {
61 61
 	if ($data->timestamp > $lastweek) {
62
-		$labels_global[]	= '"'.date('D H:i', $data->timestamp).'"';
63
-		$total[]		= $data->pokemon_now;
62
+		$labels_global[] = '"'.date('D H:i', $data->timestamp).'"';
63
+		$total[] = $data->pokemon_now;
64 64
 	}
65 65
 
66 66
 	if ($data->timestamp > $yesterday) {
67
-		$labels[] = '"'.date('H:i', $data->timestamp ).'"';
67
+		$labels[] = '"'.date('H:i', $data->timestamp).'"';
68 68
 
69 69
 		if (isset($data->rarity_spawn->{'Very common'})) {
70 70
 			$veco[]		= $data->rarity_spawn->{'Very common'};
@@ -93,47 +93,47 @@  discard block
 block discarded – undo
93 93
 }
94 94
 
95 95
 
96
-$stats_file	= SYS_PATH.'/core/json/gym.stats.json';
97
-$stats		= json_decode(file_get_contents($stats_file));
96
+$stats_file = SYS_PATH.'/core/json/gym.stats.json';
97
+$stats = json_decode(file_get_contents($stats_file));
98 98
 
99 99
 
100 100
 foreach ($stats as $data) {
101 101
 	if ($data->timestamp > $lastweek) {
102
-		$labels_gym[]			= '"'.date('D H:i', $data->timestamp).'"';
102
+		$labels_gym[] = '"'.date('D H:i', $data->timestamp).'"';
103 103
 
104
-		$mystic_average[]		= $data->team->mystic->average;
104
+		$mystic_average[] = $data->team->mystic->average;
105 105
 		$mystic_owned[]			= $data->team->mystic->gym_owned;
106 106
 
107 107
 		$valor_average[]		= $data->team->valor->average;
108
-		$valor_owned[]			= $data->team->valor->gym_owned;
108
+		$valor_owned[] = $data->team->valor->gym_owned;
109 109
 
110
-		$instinct_average[]		= $data->team->instinct->average;
111
-		$instinct_owned[]		= $data->team->instinct->gym_owned;
110
+		$instinct_average[] = $data->team->instinct->average;
111
+		$instinct_owned[] = $data->team->instinct->gym_owned;
112 112
 	}
113 113
 }
114 114
 
115 115
 
116
-$stats_file	= SYS_PATH.'/core/json/pokestop.stats.json';
117
-$stats		= json_decode(file_get_contents($stats_file));
116
+$stats_file = SYS_PATH.'/core/json/pokestop.stats.json';
117
+$stats = json_decode(file_get_contents($stats_file));
118 118
 
119 119
 
120 120
 foreach ($stats as $data) {
121 121
 	if ($data->timestamp > $lastweek) {
122
-		$labels_stops[]			= '"'.date('D H:i', $data->timestamp).'"';
123
-		$lure[]				= $data->lured;
122
+		$labels_stops[] = '"'.date('D H:i', $data->timestamp).'"';
123
+		$lure[] = $data->lured;
124 124
 	}
125 125
 }
126 126
 
127 127
 
128 128
 if ($config->system->captcha_support) {
129
-	$stats_file	= SYS_PATH.'/core/json/captcha.stats.json';
130
-	$stats		= json_decode(file_get_contents($stats_file));
129
+	$stats_file = SYS_PATH.'/core/json/captcha.stats.json';
130
+	$stats = json_decode(file_get_contents($stats_file));
131 131
 
132 132
 
133 133
 	foreach ($stats as $data) {
134 134
 		if ($data->timestamp > $lastweek) {
135
-			$labels_captcha[]		= '"'.date('D H:i', $data->timestamp).'"';
136
-			$captcha_accs[]			= $data->captcha_accs;
135
+			$labels_captcha[] = '"'.date('D H:i', $data->timestamp).'"';
136
+			$captcha_accs[] = $data->captcha_accs;
137 137
 		}
138 138
 	}
139 139
 }
Please login to merge, or discard this patch.
core/js/pokemon.graph.js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
 # Polar Graph datas
28 28
 
29
-$pokemon_file	= file_get_contents(SYS_PATH.'/core/json/pokedex.json');
30
-$pokemons	= json_decode($pokemon_file);
29
+$pokemon_file = file_get_contents(SYS_PATH.'/core/json/pokedex.json');
30
+$pokemons = json_decode($pokemon_file);
31 31
 
32 32
 $atk		= $pokemons->pokemon->$pokemon_id->atk;
33 33
 $def		= $pokemons->pokemon->$pokemon_id->def;
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 ?>
38 38
 
39
-var pokemon_id = '<?= (int)$pokemon_id ?>';
39
+var pokemon_id = '<?= (int) $pokemon_id ?>';
40 40
 
41 41
 Chart.defaults.global.legend.display = false;
42 42
 
Please login to merge, or discard this patch.
pages/pokemon.page.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 		<div class="col-sm-1 hidden-xs">
19 19
 
20
-				<?php if ($pokemon->id-1 > 0) { ?>
20
+				<?php if ($pokemon->id - 1 > 0) { ?>
21 21
 
22
-				<p class="nav-links"><a href="pokemon/<?= $pokemon->id-1 ?>"><i class="fa fa-chevron-left"></i></a></p>
22
+				<p class="nav-links"><a href="pokemon/<?= $pokemon->id - 1 ?>"><i class="fa fa-chevron-left"></i></a></p>
23 23
 
24 24
 				<?php }?>
25 25
 
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
 		<div class="col-sm-1 hidden-xs">
43 43
 
44
-			<?php if ($pokemon->id+1 < $config->system->max_pokemon) { ?>
44
+			<?php if ($pokemon->id + 1 < $config->system->max_pokemon) { ?>
45 45
 
46
-			<p class="nav-links"><a href="pokemon/<?= $pokemon->id+1 ?>"><i class="fa fa-chevron-right"></i></a></p>
46
+			<p class="nav-links"><a href="pokemon/<?= $pokemon->id + 1 ?>"><i class="fa fa-chevron-right"></i></a></p>
47 47
 
48 48
 			<?php } ?>
49 49
 		</div>
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
 			</tr>
117 117
 			<tr>
118 118
 				<td class="col-md-8 col-xs-8"><?php if (isset($pokemon->protected_gyms)) {
119
-					echo "<strong>" . $locales->POKEMON_GYM . $pokemon->name . "</strong> :";
119
+					echo "<strong>".$locales->POKEMON_GYM.$pokemon->name."</strong> :";
120 120
 } ?></td>
121 121
 				<td class="col-md-4 col-xs-4"><?php if (isset($pokemon->protected_gyms)) {
122
-					echo $pokemon->protected_gyms ;
122
+					echo $pokemon->protected_gyms;
123 123
 }?></td>
124 124
 			</tr>
125 125
 		</table>
Please login to merge, or discard this patch.
core/js/trainer.graph.js.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 // Include & load the variables 
11 11
 // ############################
12 12
 
13
-$variables	= SYS_PATH.'/core/json/variables.json';
14
-$config		= json_decode(file_get_contents($variables));
13
+$variables = SYS_PATH.'/core/json/variables.json';
14
+$config = json_decode(file_get_contents($variables));
15 15
 
16 16
 // Load the locale elements
17 17
 ############################
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 $trainer_lvl = [];
30 30
 # For all 3 teams
31 31
 for ($teamid = 1; $teamid <= 3; $teamid++) {
32
-	$req	= "SELECT level, count(level) AS count FROM trainer WHERE team = '".$teamid."' GROUP BY level";
32
+	$req = "SELECT level, count(level) AS count FROM trainer WHERE team = '".$teamid."' GROUP BY level";
33 33
 	if ($result = $mysqli->query($req)) {
34 34
 		# build level=>count array
35 35
 		$data = [];
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			# fill empty levels counts with 0
43 43
 			for ($i = 5; $i <= 40; $i++) {
44 44
 				if (!isset($data[$i])) {
45
-					$data[$i]=0;
45
+					$data[$i] = 0;
46 46
 				}
47 47
 			}
48 48
 			# sort array again
Please login to merge, or discard this patch.
core/process/locales.loader.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return array Sorted list of "accept" options
21 21
  */
22
-$sortAccept = function ($header) {
22
+$sortAccept = function ($header)
23
+{
23 24
 	$matches = array();
24 25
 	foreach (explode(',', $header) as $option) {
25 26
 		$option = array_map('trim', explode(';', $option));
@@ -52,7 +53,8 @@  discard block
 block discarded – undo
52 53
  *
53 54
  * @return string|NULL a matched option, or NULL if no match
54 55
  */
55
-$matchAccept = function ($header, $supported) use ($sortAccept) {
56
+$matchAccept = function ($header, $supported) use ($sortAccept)
57
+{
56 58
 	$matches = $sortAccept($header);
57 59
 	foreach ($matches as $key => $q) {
58 60
 		if (isset($supported[$key])) {
@@ -83,7 +85,8 @@  discard block
 block discarded – undo
83 85
  *
84 86
  * @return string The negotiated language result or the supplied default.
85 87
  */
86
-$negotiateLanguage = function ($supported, $default = 'en-US') use ($matchAccept) {
88
+$negotiateLanguage = function ($supported, $default = 'en-US') use ($matchAccept)
89
+{
87 90
 	$supp = array();
88 91
 	foreach ($supported as $lang => $isSupported) {
89 92
 		if ($isSupported) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return array Sorted list of "accept" options
21 21
  */
22
-$sortAccept = function ($header) {
22
+$sortAccept = function($header) {
23 23
 	$matches = array();
24 24
 	foreach (explode(',', $header) as $option) {
25 25
 		$option = array_map('trim', explode(';', $option));
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
  *
53 53
  * @return string|NULL a matched option, or NULL if no match
54 54
  */
55
-$matchAccept = function ($header, $supported) use ($sortAccept) {
55
+$matchAccept = function($header, $supported) use ($sortAccept) {
56 56
 	$matches = $sortAccept($header);
57 57
 	foreach ($matches as $key => $q) {
58 58
 		if (isset($supported[$key])) {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
  *
84 84
  * @return string The negotiated language result or the supplied default.
85 85
  */
86
-$negotiateLanguage = function ($supported, $default = 'en-US') use ($matchAccept) {
86
+$negotiateLanguage = function($supported, $default = 'en-US') use ($matchAccept) {
87 87
 	$supp = array();
88 88
 	foreach ($supported as $lang => $isSupported) {
89 89
 		if ($isSupported) {
@@ -162,22 +162,22 @@  discard block
 block discarded – undo
162 162
 // Merge the pokedex, pokemon translation and rarity file into a new array 
163 163
 ##########################################################################
164 164
 
165
-$pokedex_file 	= file_get_contents(SYS_PATH.'/core/json/pokedex.json');
166
-$pokemons 		= json_decode($pokedex_file);
165
+$pokedex_file = file_get_contents(SYS_PATH.'/core/json/pokedex.json');
166
+$pokemons = json_decode($pokedex_file);
167 167
 
168 168
 $pokedex_rarity_file = SYS_PATH.'/core/json/pokedex.rarity.json';
169 169
 $pokemons_rarity = json_decode(file_get_contents($pokedex_rarity_file));
170 170
 
171 171
 foreach ($pokemons->pokemon as $pokeid => $pokemon) {
172 172
 	// Merge name and description from translation files
173
-	$pokemon->name 			= $pokemon_trans->pokemon->$pokeid->name;
174
-	$pokemon->description 	= $pokemon_trans->pokemon->$pokeid->description;
173
+	$pokemon->name = $pokemon_trans->pokemon->$pokeid->name;
174
+	$pokemon->description = $pokemon_trans->pokemon->$pokeid->description;
175 175
 
176 176
 	// Replace quick and charge move with translation
177
-	$quick_move 			= $pokemon->quick_move;
178
-	$pokemon->quick_move 	= $pokemon_trans->quick_moves->$quick_move;
179
-	$charge_move 			= $pokemon->charge_move;
180
-	$pokemon->charge_move 	= $pokemon_trans->charge_moves->$charge_move;
177
+	$quick_move = $pokemon->quick_move;
178
+	$pokemon->quick_move = $pokemon_trans->quick_moves->$quick_move;
179
+	$charge_move = $pokemon->charge_move;
180
+	$pokemon->charge_move = $pokemon_trans->charge_moves->$charge_move;
181 181
 
182 182
 	// Replace types with translation
183 183
 	foreach ($pokemon->types as &$type) {
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 
188 188
 	// Resolve candy_id to candy_name
189 189
 	if (isset($pokemon->candy_id)) {
190
-		$candy_id 				= $pokemon->candy_id;
191
-		$pokemon->candy_name 	= $pokemon_trans->pokemon->$candy_id->name;
190
+		$candy_id = $pokemon->candy_id;
191
+		$pokemon->candy_name = $pokemon_trans->pokemon->$candy_id->name;
192 192
 		unset($pokemon->candy_id);
193 193
 	}
194 194
 	// Convert move numbers to names
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
 // Translate typecolors array keys as well
225 225
 $types_temp = new stdClass();
226 226
 foreach ($pokemons->typecolors as $type => $color) {
227
-	$type_trans 				= $pokemon_trans->types->$type;
228
-	$types_temp->$type_trans 	= $color;
227
+	$type_trans = $pokemon_trans->types->$type;
228
+	$types_temp->$type_trans = $color;
229 229
 }
230 230
 // Replace typecolors array with translated one
231 231
 $pokemons->typecolors = $types_temp;
Please login to merge, or discard this patch.
config.example.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
 if (isset($_SERVER['HTTP_HOST'])) {
40 40
 	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
41
-		define('HOST_URL', $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://'.$_SERVER['HTTP_HOST'].$subdirectory);
41
+		define('HOST_URL', $_SERVER['HTTP_X_FORWARDED_PROTO'].'://'.$_SERVER['HTTP_HOST'].$subdirectory);
42 42
 	} else if (isset($_SERVER['REQUEST_SCHEME'])) {
43 43
 		define('HOST_URL', $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$subdirectory);
44 44
 	} else {
Please login to merge, or discard this patch.
core/cron/crontabs.include.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 // This file only include other files to have only 1 entry in your crontabs. 
4 4
 // ------------------------------------------------------------------------	
5 5
 
6
-$config_file	= dirname(__FILE__).'/../../config.php';
6
+$config_file = dirname(__FILE__).'/../../config.php';
7 7
 
8 8
 include_once($config_file);
9 9
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 
25 25
 # MySQL 
26
-$mysqli		= new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
26
+$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
27 27
 
28 28
 if ($mysqli->connect_error != '') {
29 29
 	die('MySQL connect error');
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 
33 33
 // Update dashboard data
34 34
 // the following files are updated every run
35
-$gym_file	= SYS_PATH.'/core/json/gym.stats.json';
36
-$pokestop_file	= SYS_PATH.'/core/json/pokestop.stats.json';
37
-$pokemonstats_file	= SYS_PATH.'/core/json/pokemon.stats.json';
38
-$pokedex_counts_file	= SYS_PATH.'/core/json/pokedex.counts.json';
35
+$gym_file = SYS_PATH.'/core/json/gym.stats.json';
36
+$pokestop_file = SYS_PATH.'/core/json/pokestop.stats.json';
37
+$pokemonstats_file = SYS_PATH.'/core/json/pokemon.stats.json';
38
+$pokedex_counts_file = SYS_PATH.'/core/json/pokedex.counts.json';
39 39
 
40 40
 if (is_file($gym_file)) {
41 41
 	$gymsdatas	= json_decode(file_get_contents($gym_file), true);
Please login to merge, or discard this patch.