Passed
Pull Request — master (#163)
by PoUpA
02:20
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/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/js/pokemon.graph.js.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
 
32 32
 $pokemon_id = mysqli_real_escape_string($mysqli, $_GET['id']);
33 33
 
34
-$req		= "SELECT COUNT(*) as total, HOUR(CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_hour
34
+$req = "SELECT COUNT(*) as total, HOUR(CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_hour
35 35
 			FROM pokemon
36 36
 			WHERE pokemon_id = '".$pokemon_id."'
37 37
 			GROUP BY disappear_hour
38 38
 			ORDER BY disappear_hour";
39 39
 		
40
-$result		= $mysqli->query($req);
40
+$result = $mysqli->query($req);
41 41
 
42 42
 while ($data = $result->fetch_object()) {
43 43
 	if ($data->disappear_hour < 10) {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 }
49 49
 
50 50
 // Create the h24 array with associated values
51
-for ($i= 0; $i <= 23; $i++) {
51
+for ($i = 0; $i <= 23; $i++) {
52 52
 	if ($i < 10) {
53 53
 		$key = '0'.$i;
54 54
 	} else {
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 
80 80
 # Polar Graph datas
81 81
 
82
-$pokemon_file	= file_get_contents(SYS_PATH.'/core/json/pokedex.json');
83
-$pokemons		= json_decode($pokemon_file);
82
+$pokemon_file = file_get_contents(SYS_PATH.'/core/json/pokedex.json');
83
+$pokemons = json_decode($pokemon_file);
84 84
 
85 85
 $atk			= $pokemons->pokemon->$pokemon_id->atk;
86 86
 $def			= $pokemons->pokemon->$pokemon_id->def;
87
-$stam			= $pokemons->pokemon->$pokemon_id->stam;
87
+$stam = $pokemons->pokemon->$pokemon_id->stam;
88 88
 
89 89
 
90 90
 ?>
Please login to merge, or discard this patch.
pages/home.page.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -65,13 +65,13 @@
 block discarded – undo
65 65
 				if ($config->system->recents_show_iv) {
66 66
 					if ($pokemon->iv->available) { ?>
67 67
 					<div class="progress" style="height: 6px; width: 80%; margin: 5px auto 15px auto;">
68
-						<div title="Stamina IV: <?= $pokemon->iv->stamina ?>" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?= $pokemon->iv->stamina ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100/15)*$pokemon->iv->stamina)/3 ?>%">
68
+						<div title="Stamina IV: <?= $pokemon->iv->stamina ?>" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?= $pokemon->iv->stamina ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100 / 15) * $pokemon->iv->stamina) / 3 ?>%">
69 69
 							<span class="sr-only">Stamina IV: <?= $pokemon->iv->stamina ?></span>
70 70
 						</div>
71
-						<div title="Attack IV: <?= $pokemon->iv->attack ?>" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="<?= $pokemon->iv->attack ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100/15)*$pokemon->iv->attack)/3 ?>%">
71
+						<div title="Attack IV: <?= $pokemon->iv->attack ?>" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="<?= $pokemon->iv->attack ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100 / 15) * $pokemon->iv->attack) / 3 ?>%">
72 72
 							<span class="sr-only">Attack IV: <?= $pokemon->iv->attack ?></span>
73 73
 						</div>
74
-						<div title="Defense IV: <?= $pokemon->iv->defense ?>" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="<?= $pokemon->iv->defense ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100/15)*$pokemon->iv->defense)/3 ?>%">
74
+						<div title="Defense IV: <?= $pokemon->iv->defense ?>" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="<?= $pokemon->iv->defense ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100 / 15) * $pokemon->iv->defense) / 3 ?>%">
75 75
 							<span class="sr-only">Defense IV: <?= $pokemon->iv->defense ?></span>
76 76
 						</div>
77 77
 					</div>
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.