Passed
Pull Request — master (#145)
by PoUpA
02:23
created
pages/pokedex.page.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
 					echo 'unseen';
31 31
 } ?> "></a>
32 32
 				<p class="pkmn-name"><a href="<?= $pokemon->permalink ?>"><?= $pokemon->name ?></a></p>
33
-				<p><?php if ($pokemon->spawn ==0) {
34
-					echo $locales->UNSEEN ;
33
+				<p><?php if ($pokemon->spawn == 0) {
34
+					echo $locales->UNSEEN;
35 35
 } else {
36
-	echo $pokemon->spawn. $locales->SEEN ;
36
+	echo $pokemon->spawn.$locales->SEEN;
37 37
 } ?> </p>
38 38
 			
39 39
 			</div>
Please login to merge, or discard this patch.
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/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	= realpath(dirname(__FILE__)).'/../json/variables.json';
14
-$config		= json_decode(file_get_contents($variables));
13
+$variables = realpath(dirname(__FILE__)).'/../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/js/pokemon.maps.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 			// As the map is rendering by the client, we do recommand to keep a limit on your request.
91 91
 			// 10k is already alotof datas ;)
92 92
 			
93
-			$req 	= "SELECT latitude, longitude FROM pokemon WHERE pokemon_id = '".$pokemon_id."' ORDER BY disappear_time DESC LIMIT 0,10000";
93
+			$req = "SELECT latitude, longitude FROM pokemon WHERE pokemon_id = '".$pokemon_id."' ORDER BY disappear_time DESC LIMIT 0,10000";
94 94
 			$result = $mysqli->query($req);
95 95
 			
96 96
 			while ($data = $result->fetch_object()) {
Please login to merge, or discard this patch.
install/tester.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
 	
13 13
 	
14
-	$mysqli 	= new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
14
+	$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
15 15
 		
16 16
 	####################
17 17
 	// Database tests
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 	
20 20
 	// Pokemon Test
21 21
 
22
-	$req 		= "SELECT COUNT(*) as total FROM pokemon";
23
-	$result 	= $mysqli->query($req);
22
+	$req = "SELECT COUNT(*) as total FROM pokemon";
23
+	$result = $mysqli->query($req);
24 24
 	
25
-	$lock_msg 	= '';
25
+	$lock_msg = '';
26 26
 	
27 27
 	if (!is_object($result)) {
28 28
 		$lock_msg .= "No Pokémon database found \r";
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
 	
38 38
 	// Gym Test
39 39
 	
40
-	$req 		= "SELECT COUNT(*) as total FROM gym";
41
-	$result 	= $mysqli->query($req);
40
+	$req = "SELECT COUNT(*) as total FROM gym";
41
+	$result = $mysqli->query($req);
42 42
 	
43
-	$lock_msg 	= '';
43
+	$lock_msg = '';
44 44
 	
45 45
 	if (!is_object($result)) {
46 46
 		$lock_msg .= "No Gym database found \r";
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 	// Pokéstop Test
58 58
 	
59 59
 	
60
-	$req 		= "SELECT COUNT(*) as total FROM pokestop";
61
-	$result 	= $mysqli->query($req);
60
+	$req = "SELECT COUNT(*) as total FROM pokestop";
61
+	$result = $mysqli->query($req);
62 62
 	
63
-	$lock_msg 	= '';
63
+	$lock_msg = '';
64 64
 	
65 65
 	if (!is_object($result)) {
66 66
 		$lock_msg .= "No Pokestop database found \r";
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	} else {
100 100
 		// Can we read JSON file?
101 101
 		$json_test_file = SYS_PATH.'/core/json/pokelist_EN.json';
102
-		$lock_msg		= '';
102
+		$lock_msg = '';
103 103
 		
104 104
 		if (!is_readable($json_test_file)) {
105 105
 			$lock_msg .= "JSon files are not readable. Please fix rights \r";
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.