Passed
Pull Request — master (#173)
by PoUpA
02:20
created
core/cron/gym.cron.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -8,48 +8,48 @@
 block discarded – undo
8 8
 // -----------------------------------------------------------------------------------------------------------
9 9
 
10 10
 
11
-$gym['timestamp']	= $timestamp;
11
+$gym['timestamp'] = $timestamp;
12 12
 
13
-$req		= "SELECT count( DISTINCT(gym_id) ) as total FROM gym";
14
-$result		= $mysqli->query($req);
15
-$data		= $result->fetch_object();
13
+$req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym";
14
+$result = $mysqli->query($req);
15
+$data = $result->fetch_object();
16 16
 
17
-$gym['total'] 	= $data->total;
17
+$gym['total'] = $data->total;
18 18
 
19 19
 
20 20
 // Mystic
21 21
 
22
-$req		= "SELECT count(DISTINCT(gym_id)) as total, ROUND(AVG(gym_points),0) as average_points FROM gym WHERE team_id = '1'";
23
-$result		= $mysqli->query($req);
24
-$data		= $result->fetch_object();
22
+$req = "SELECT count(DISTINCT(gym_id)) as total, ROUND(AVG(gym_points),0) as average_points FROM gym WHERE team_id = '1'";
23
+$result = $mysqli->query($req);
24
+$data = $result->fetch_object();
25 25
 
26
-$gym['team']['mystic']['gym_owned']	= $data->total;
27
-$gym['team']['mystic']['average']	= $data->average_points;
26
+$gym['team']['mystic']['gym_owned'] = $data->total;
27
+$gym['team']['mystic']['average'] = $data->average_points;
28 28
 
29 29
 
30 30
 // Valor
31 31
 
32
-$req		= "SELECT count(DISTINCT(gym_id)) as total, ROUND(AVG(gym_points),0) as average_points FROM gym WHERE team_id = '2'";
33
-$result		= $mysqli->query($req);
34
-$data		= $result->fetch_object();
32
+$req = "SELECT count(DISTINCT(gym_id)) as total, ROUND(AVG(gym_points),0) as average_points FROM gym WHERE team_id = '2'";
33
+$result = $mysqli->query($req);
34
+$data = $result->fetch_object();
35 35
 
36
-$gym['team']['valor']['gym_owned']	= $data->total;
37
-$gym['team']['valor']['average']	= $data->average_points;
36
+$gym['team']['valor']['gym_owned'] = $data->total;
37
+$gym['team']['valor']['average'] = $data->average_points;
38 38
 
39 39
 
40 40
 // Instinct
41 41
 
42
-$req		= "SELECT count(DISTINCT(gym_id)) as total, ROUND(AVG(gym_points),0) as average_points FROM gym WHERE team_id = '3'";
43
-$result		= $mysqli->query($req);
44
-$data		= $result->fetch_object();
42
+$req = "SELECT count(DISTINCT(gym_id)) as total, ROUND(AVG(gym_points),0) as average_points FROM gym WHERE team_id = '3'";
43
+$result = $mysqli->query($req);
44
+$data = $result->fetch_object();
45 45
 
46
-$gym['team']['instinct']['gym_owned'] 	= $data->total;
47
-$gym['team']['instinct']['average'] 	= $data->average_points;
46
+$gym['team']['instinct']['gym_owned'] = $data->total;
47
+$gym['team']['instinct']['average'] = $data->average_points;
48 48
 
49 49
 
50 50
 // Add the datas in file
51 51
 
52
-$gymsdatas[]		= $gym;
53
-$json			= json_encode($gymsdatas);
52
+$gymsdatas[] = $gym;
53
+$json = json_encode($gymsdatas);
54 54
 
55 55
 file_put_contents($gym_file, $json);
Please login to merge, or discard this patch.
core/process/locales.loader.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 			$translation_file	= file_get_contents(SYS_PATH.'/core/json/locales/EN/translations.json');
38 38
 		}
39 39
 	} else {
40
-		$pokemon_file 			= file_get_contents(SYS_PATH.'/core/json/locales/EN/pokes.json');
41
-		$translation_file 		= file_get_contents(SYS_PATH.'/core/json/locales/EN/translations.json');
40
+		$pokemon_file = file_get_contents(SYS_PATH.'/core/json/locales/EN/pokes.json');
41
+		$translation_file = file_get_contents(SYS_PATH.'/core/json/locales/EN/translations.json');
42 42
 	}
43 43
 } else {
44
-	$pokemon_file			= file_get_contents(SYS_PATH.'/core/json/locales/EN/pokes.json');
45
-	$translation_file		= file_get_contents(SYS_PATH.'/core/json/locales/EN/translations.json');
44
+	$pokemon_file = file_get_contents(SYS_PATH.'/core/json/locales/EN/pokes.json');
45
+	$translation_file = file_get_contents(SYS_PATH.'/core/json/locales/EN/translations.json');
46 46
 }
47 47
 
48 48
 
@@ -52,23 +52,23 @@  discard block
 block discarded – undo
52 52
 // always overwrite english if available
53 53
 ########################################
54 54
 
55
-$locales 		= (object) array_replace(json_decode(file_get_contents(SYS_PATH.'/core/json/locales/EN/translations.json'), true), json_decode($translation_file, true));
55
+$locales = (object) array_replace(json_decode(file_get_contents(SYS_PATH.'/core/json/locales/EN/translations.json'), true), json_decode($translation_file, true));
56 56
 
57 57
 // Recursive replace because of multi level array
58
-$pokemon_trans_array 	= array_replace_recursive(json_decode(file_get_contents(SYS_PATH.'/core/json/locales/EN/pokes.json'), true), json_decode($pokemon_file, true));
58
+$pokemon_trans_array = array_replace_recursive(json_decode(file_get_contents(SYS_PATH.'/core/json/locales/EN/pokes.json'), true), json_decode($pokemon_file, true));
59 59
 
60 60
 // convert associative array back to object array (recursive)
61
-$pokemon_trans 		= json_decode(json_encode($pokemon_trans_array), false);
61
+$pokemon_trans = json_decode(json_encode($pokemon_trans_array), false);
62 62
 unset($pokemon_trans_array);
63 63
 
64 64
 
65 65
 // Merge the pokedex, pokemon translation and rarity file into a new array 
66 66
 ##########################################################################
67 67
 
68
-$pokedex_file 			= file_get_contents(SYS_PATH.'/core/json/pokedex.json');
69
-$pokemons 			= json_decode($pokedex_file);
68
+$pokedex_file = file_get_contents(SYS_PATH.'/core/json/pokedex.json');
69
+$pokemons = json_decode($pokedex_file);
70 70
 
71
-$pokedex_rarity_file 		= SYS_PATH.'/core/json/pokedex.rarity.json';
71
+$pokedex_rarity_file = SYS_PATH.'/core/json/pokedex.rarity.json';
72 72
 // initial create of pokedex.rarity.json if it doesn't exist
73 73
 if (!is_file($pokedex_rarity_file)) {
74 74
 	include_once(SYS_PATH.'/core/cron/pokemon.rarity.php');
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 
79 79
 foreach ($pokemons->pokemon as $pokeid => $pokemon) {
80 80
 	// Merge name and description from translation files
81
-	$pokemon->name 				= $pokemon_trans->pokemon->$pokeid->name;
82
-	$pokemon->description 		= $pokemon_trans->pokemon->$pokeid->description;
81
+	$pokemon->name = $pokemon_trans->pokemon->$pokeid->name;
82
+	$pokemon->description = $pokemon_trans->pokemon->$pokeid->description;
83 83
 
84 84
 	// Replace quick and charge move with translation
85
-	$quick_move 				= $pokemon->quick_move;
86
-	$pokemon->quick_move 		= $pokemon_trans->quick_moves->$quick_move;
87
-	$charge_move 				= $pokemon->charge_move;
88
-	$pokemon->charge_move 		= $pokemon_trans->charge_moves->$charge_move;
85
+	$quick_move = $pokemon->quick_move;
86
+	$pokemon->quick_move = $pokemon_trans->quick_moves->$quick_move;
87
+	$charge_move = $pokemon->charge_move;
88
+	$pokemon->charge_move = $pokemon_trans->charge_moves->$charge_move;
89 89
 
90 90
 	// Replace types with translation
91 91
 	foreach ($pokemon->types as &$type) {
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 
96 96
 	// Resolve candy_id to candy_name
97 97
 	if (isset($pokemon->candy_id)) {
98
-		$candy_id 				= $pokemon->candy_id;
99
-		$pokemon->candy_name	= $pokemon_trans->pokemon->$candy_id->name;
98
+		$candy_id = $pokemon->candy_id;
99
+		$pokemon->candy_name = $pokemon_trans->pokemon->$candy_id->name;
100 100
 		unset($pokemon->candy_id);
101 101
 	}
102 102
 
Please login to merge, or discard this patch.
core/cron/pokemon.rarity.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,26 +4,26 @@
 block discarded – undo
4 4
 // This file is loaded once every 24h by data the loader. 
5 5
 // ------------------------------------------------------
6 6
 
7
-$req 		= "SELECT pokemon_id, COUNT(1) as total FROM pokemon GROUP BY pokemon_id ORDER BY pokemon_id ASC";
8
-$result 	= $mysqli->query($req);
7
+$req = "SELECT pokemon_id, COUNT(1) as total FROM pokemon GROUP BY pokemon_id ORDER BY pokemon_id ASC";
8
+$result = $mysqli->query($req);
9 9
 
10 10
 $total_pokemons = 0;
11 11
 
12 12
 while ($data = $result->fetch_object()) {
13
-	$pokemon_id 	= $data->pokemon_id;
13
+	$pokemon_id = $data->pokemon_id;
14 14
 	$total_pokemons = $total_pokemons + $data->total;
15 15
 	
16
-	$pokelist[$pokemon_id]['id'] 		= $pokemon_id;
17
-	$pokelist[$pokemon_id]['total'] 	= $data->total;
16
+	$pokelist[$pokemon_id]['id'] = $pokemon_id;
17
+	$pokelist[$pokemon_id]['total'] = $data->total;
18 18
 }
19 19
 
20 20
 
21 21
 foreach ($pokelist as $pokemon) {
22 22
 	$key = $pokemon['id'];
23 23
 	
24
-	$pourcent 			= ($pokemon['total']*100) / $total_pokemons;
25
-	$arrondis			= round($pourcent, 4);
26
-	$pokelist[$key]['rate'] 	= $arrondis;
24
+	$pourcent = ($pokemon['total'] * 100) / $total_pokemons;
25
+	$arrondis = round($pourcent, 4);
26
+	$pokelist[$key]['rate'] = $arrondis;
27 27
 }
28 28
 
29 29
 // create new array if file doesn't exist
Please login to merge, or discard this patch.
pages/pokemon.page.php 1 patch
Spacing   +7 added lines, -7 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>
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 			<tr>
131 131
 				<td class="col-md-8 col-xs-8"><strong><?= $locales->POKEMON_EVOLUTION ?> :</strong></td>
132 132
 				<td class="col-md-4 col-xs-4"><?php if (isset($pokemon->candies)) {
133
-					echo $pokemon->candies . " ". $pokemon->candy_name . " " . $locales->POKEMON_CANDIES ;
133
+					echo $pokemon->candies." ".$pokemon->candy_name." ".$locales->POKEMON_CANDIES;
134 134
 } else {
135 135
 	echo $locales->POKEMON_FINAL;
136 136
 } ?></td>
Please login to merge, or discard this patch.
config.example.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
 	if ($root == $filePath) {
58 58
 		return ''; // installed in the root
59 59
 	} else {
60
-		$subdir_path	= explode('/', $filePath);
61
-		$subdir		= end($subdir_path);
60
+		$subdir_path = explode('/', $filePath);
61
+		$subdir = end($subdir_path);
62 62
 		return $subdir;
63 63
 	}
64 64
 }
Please login to merge, or discard this patch.
core/cron/pokemon.cron.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,19 +18,19 @@  discard block
 block discarded – undo
18 18
 $pokemon_stats['timestamp'] = $timestamp;
19 19
 
20 20
 
21
-$req 		= "SELECT COUNT(*) as total FROM pokemon WHERE disappear_time >= UTC_TIMESTAMP()";
22
-$result 	= $mysqli->query($req);
23
-$data 		= $result->fetch_object();
21
+$req = "SELECT COUNT(*) as total FROM pokemon WHERE disappear_time >= UTC_TIMESTAMP()";
22
+$result = $mysqli->query($req);
23
+$data = $result->fetch_object();
24 24
 
25
-$pokemon_stats['pokemon_now'] 	= $data->total;
25
+$pokemon_stats['pokemon_now'] = $data->total;
26 26
 
27
-$req 		= "SELECT pokemon_id FROM pokemon WHERE disappear_time >= UTC_TIMESTAMP()";
28
-$result 	= $mysqli->query($req);
27
+$req = "SELECT pokemon_id FROM pokemon WHERE disappear_time >= UTC_TIMESTAMP()";
28
+$result = $mysqli->query($req);
29 29
 
30 30
 $rarityarray = array();
31 31
 while ($data = $result->fetch_object()) {
32
-	$poke_id 	= $data->pokemon_id;
33
-	$rarity 	= $pokemons->pokemon->$poke_id->rarity;
32
+	$poke_id = $data->pokemon_id;
33
+	$rarity = $pokemons->pokemon->$poke_id->rarity;
34 34
 	
35 35
 	isset($rarityarray[$rarity]) ? $rarityarray[$rarity]++ : $rarityarray[$rarity] = 1;
36 36
 }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 // Add the datas in file
41 41
 
42
-$pokedatas[] 	= $pokemon_stats;
43
-$json 		= json_encode($pokedatas);
42
+$pokedatas[] = $pokemon_stats;
43
+$json = json_encode($pokedatas);
44 44
 
45 45
 file_put_contents($pokemonstats_file, $json);
Please login to merge, or discard this patch.
core/cron/pokestop.cron.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
 
10 10
 $pokestop['timestamp'] = $timestamp;
11 11
 
12
-$req 		= "SELECT COUNT(*) as total FROM pokestop";
13
-$result 	= $mysqli->query($req);
14
-$data 		= $result->fetch_object();
12
+$req = "SELECT COUNT(*) as total FROM pokestop";
13
+$result = $mysqli->query($req);
14
+$data = $result->fetch_object();
15 15
 
16 16
 $pokestop['total'] = $data->total;
17 17
 
18
-$req 		= "SELECT COUNT(*) as total FROM pokestop WHERE lure_expiration >= UTC_TIMESTAMP()";
19
-$result 	= $mysqli->query($req);
20
-$data 		= $result->fetch_object();
18
+$req = "SELECT COUNT(*) as total FROM pokestop WHERE lure_expiration >= UTC_TIMESTAMP()";
19
+$result = $mysqli->query($req);
20
+$data = $result->fetch_object();
21 21
 
22 22
 $pokestop['lured'] = $data->total;
23 23
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 // Add the datas in file
27 27
 
28
-$stopdatas[] 	= $pokestop;
29
-$json 		= json_encode($stopdatas);
28
+$stopdatas[] = $pokestop;
29
+$json = json_encode($stopdatas);
30 30
 
31 31
 file_put_contents($pokestop_file, $json);
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
 
17 17
 # Connect MySQL 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 $trainer_lvl = [];
26 26
 # For all 3 teams
27 27
 for ($teamid = 1; $teamid <= 3; $teamid++) {
28
-	$req	= "SELECT level, count(level) AS count FROM trainer WHERE team = '".$teamid."' GROUP BY level";
28
+	$req = "SELECT level, count(level) AS count FROM trainer WHERE team = '".$teamid."' GROUP BY level";
29 29
 	if ($result = $mysqli->query($req)) {
30 30
 		# build level=>count array
31 31
 		$data = [];
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 			# fill empty levels counts with 0
39 39
 			for ($i = 5; $i <= 40; $i++) {
40 40
 				if (!isset($data[$i])) {
41
-					$data[$i]=0;
41
+					$data[$i] = 0;
42 42
 				}
43 43
 			}
44 44
 			# sort array again
Please login to merge, or discard this patch.
core/cron/crontabs.include.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  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
-$filePath	= dirname(__FILE__);
7
-$config_file	= $filePath.'/../../config.php';
6
+$filePath = dirname(__FILE__);
7
+$config_file = $filePath.'/../../config.php';
8 8
 
9 9
 include_once($config_file);
10 10
 
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 
17 17
 # MySQL 
18
-$mysqli		= new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
18
+$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
19 19
 
20 20
 if ($mysqli->connect_error != '') {
21 21
 	die('MySQL connect error');
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 
24 24
 
25 25
 
26
-$gym_file	= SYS_PATH.'/core/json/gym.stats.json';
27
-$pokestop_file	= SYS_PATH.'/core/json/pokestop.stats.json';
28
-$pokemonstats_file	= SYS_PATH.'/core/json/pokemon.stats.json';
26
+$gym_file = SYS_PATH.'/core/json/gym.stats.json';
27
+$pokestop_file = SYS_PATH.'/core/json/pokestop.stats.json';
28
+$pokemonstats_file = SYS_PATH.'/core/json/pokemon.stats.json';
29 29
 
30 30
 
31 31
 if (is_file($gym_file)) {
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	$pokedatas	= json_decode(file_get_contents($pokemonstats_file), true);
39 39
 }
40 40
 
41
-$timestamp	= time();
41
+$timestamp = time();
42 42
 
43 43
 include_once(SYS_PATH.'/core/cron/gym.cron.php');
44 44
 include_once(SYS_PATH.'/core/cron/pokemon.cron.php');
Please login to merge, or discard this patch.