Passed
Pull Request — master (#245)
by Markus
14:39
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/home.page.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -76,26 +76,26 @@  discard block
 block discarded – undo
76 76
 					if ($pokemon->iv->available) {
77 77
 						if ($config->system->iv_numbers) { ?>
78 78
 							<div class="progress" style="height: 15px; margin-bottom: 0">
79
-								<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/3)  ?>%; line-height: 16px";>
79
+								<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 / 3)  ?>%; line-height: 16px";>
80 80
 									<span class="sr-only"><?= $locales->ATTACK ?> IV: <?= $pokemon->iv->attack ?></span><?= $pokemon->iv->attack ?>
81 81
 								</div>
82
-								<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/3)  ?>%; line-height: 16px";>
82
+								<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 / 3)  ?>%; line-height: 16px";>
83 83
 									<span class="sr-only"><?= $locales->DEFENSE ?> IV: <?= $pokemon->iv->defense ?></span><?= $pokemon->iv->defense ?>
84 84
 								</div>
85
-								<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/3) ?>%; line-height: 16px";>
85
+								<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 / 3) ?>%; line-height: 16px";>
86 86
 									<span class="sr-only"><?= $locales->STAMINA ?> IV: <?= $pokemon->iv->stamina ?></span><?= $pokemon->iv->stamina ?>
87 87
 								</div>
88 88
 							</div>
89 89
 						<?php 
90 90
 						} else { ?>
91 91
 							<div class="progress" style="height: 6px; width: 80%; margin: 5px auto 15px auto;">
92
-								<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 ?>%">
92
+								<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 ?>%">
93 93
 									<span class="sr-only"><?= $locales->ATTACK ?> IV: <?= $pokemon->iv->attack ?></span>
94 94
 								</div>
95
-								<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 ?>%">
95
+								<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 ?>%">
96 96
 									<span class="sr-only"><?= $locales->DEFENSE ?> IV: <?= $pokemon->iv->defense ?></span>
97 97
 								</div>
98
-								<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 ?>%">
98
+								<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 ?>%">
99 99
 									<span class="sr-only"><?= $locales->STAMINA ?> IV: <?= $pokemon->iv->stamina ?></span>
100 100
 								</div>
101 101
 							</div>
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
 					} else {
105 105
 						if ($config->system->iv_numbers) { ?>
106 106
 							<div class="progress" style="height: 15px; margin-bottom: 0">
107
-								<div title="Attack IV: not available" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="<?= $pokemon->iv->attack ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100/3)  ?>%; line-height: 16px";>
107
+								<div title="Attack IV: not available" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="<?= $pokemon->iv->attack ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3)  ?>%; line-height: 16px";>
108 108
 									<span class="sr-only"><?= $locales->ATTACK ?> IV: <?= $locales->NOT_AVAILABLE ?></span>?
109 109
 								</div>
110
-								<div title="Defense IV: not available" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="<?= $pokemon->iv->defense ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100/3)  ?>%; line-height: 16px";>
110
+								<div title="Defense IV: not available" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="<?= $pokemon->iv->defense ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3)  ?>%; line-height: 16px";>
111 111
 									<span class="sr-only"><?= $locales->DEFENSE ?> IV: <?= $locales->NOT_AVAILABLE ?></span>?
112 112
 								</div>
113
-								<div title="Stamina IV: not available" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?= $pokemon->iv->stamina ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100/3) ?>%; line-height: 16px";>
113
+								<div title="Stamina IV: not available" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?= $pokemon->iv->stamina ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3) ?>%; line-height: 16px";>
114 114
 									<span class="sr-only"><?= $locales->STAMINA ?> IV: <?= $locales->NOT_AVAILABLE ?></span>?
115 115
 								</div>
116 116
 							</div>
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/cron/pokedex.rarity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 	// Use alltime count if there was no scan last 7 days
40 40
 	$total_pokemon          = ($total_pokemon_last_week > 0) ? $total_pokemon_last_week : $total_pokemon_alltime;
41 41
 
42
-	$percent                = ($pokemon['total']*100) / $total_pokemon;
42
+	$percent                = ($pokemon['total'] * 100) / $total_pokemon;
43 43
 	$rounded                = round($percent, 4);
44 44
 	// do not round to 0 if there was a spawn. Set to min 0.0001.
45 45
 	$rounded                = ($rounded == 0.0000 && $pokemon['total'] > 0) ? $rounded = 0.0001 : $rounded;
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.