Completed
Push — master ( 551eca...962f7f )
by Angus
02:37
created
application/controllers/Ajax/Userscript.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 	public function report_bug() : void {
79 79
 		$this->load->library('user_agent');
80 80
 		if($this->output->is_custom_header_set()) { $this->output->reset_status_header(); return; }
81
-		$this->form_validation->set_rules('bug[url]',  'Bug [URL]',  'required');
81
+		$this->form_validation->set_rules('bug[url]', 'Bug [URL]', 'required');
82 82
 		$this->form_validation->set_rules('bug[text]', 'Bug [Text]', 'required');
83 83
 
84 84
 		if($this->form_validation->run() === TRUE) {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@
 block discarded – undo
53 53
 				];
54 54
 
55 55
 				$this->output
56
-				     ->set_status_header('200')
57
-				     ->set_content_type('application/json', 'utf-8')
58
-				     ->set_output(json_encode($json));
56
+					 ->set_status_header('200')
57
+					 ->set_content_type('application/json', 'utf-8')
58
+					 ->set_output(json_encode($json));
59 59
 			} else {
60 60
 				//TODO: We should probably try and have more verbose errors here. Return via JSON or something.
61 61
 				$this->output->set_status_header('400', 'Unable to update?');
Please login to merge, or discard this patch.
application/controllers/User/PublicList.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,9 @@
 block discarded – undo
60 60
 			$show_404 = TRUE;
61 61
 		}
62 62
 
63
-		if($show_404) show_404();
63
+		if($show_404) {
64
+			show_404();
65
+		}
64 66
 	}
65 67
 
66 68
 	private function _walk_recursive_remove (array $array, callable $callback) : array {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,12 +63,12 @@
 block discarded – undo
63 63
 		if($show_404) show_404();
64 64
 	}
65 65
 
66
-	private function _walk_recursive_remove (array $array, callable $callback) : array {
67
-		foreach ($array as $k => $v) {
68
-			if (is_array($v)) {
66
+	private function _walk_recursive_remove(array $array, callable $callback) : array {
67
+		foreach($array as $k => $v) {
68
+			if(is_array($v)) {
69 69
 				$array[$k] = $this->_walk_recursive_remove($v, $callback);
70 70
 			} else {
71
-				if ($callback($v, $k)) {
71
+				if($callback($v, $k)) {
72 72
 					unset($array[$k]);
73 73
 				}
74 74
 			}
Please login to merge, or discard this patch.
application/controllers/User/Favourites.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@  discard block
 block discarded – undo
6 6
 	}
7 7
 
8 8
 	public function index(int $page = 1) : void {
9
-		if($page === 0) redirect('user/favourites/1');
9
+		if($page === 0) {
10
+			redirect('user/favourites/1');
11
+		}
10 12
 
11 13
 		$this->header_data['title'] = "Favourites";
12 14
 		$this->header_data['page']  = "favourites";
@@ -16,7 +18,9 @@  discard block
 block discarded – undo
16 18
 		$this->body_data['currentPage'] = $page;
17 19
 		$this->body_data['totalPages']  = $favouriteData['totalPages'];
18 20
 
19
-		if($page > $this->body_data['totalPages'] && $page <= 1) redirect('user/favourites/1');
21
+		if($page > $this->body_data['totalPages'] && $page <= 1) {
22
+			redirect('user/favourites/1');
23
+		}
20 24
 
21 25
 		$this->_render_page('User/Favourites');
22 26
 	}
Please login to merge, or discard this patch.
application/helpers/generic_helper.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 /**
4 4
  * Checks if view file exists.
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @return bool
7 7
  */
8 8
 function view_exists(string $path) : bool {
9
-	return file_exists(APPPATH . "/views/{$path}.php");
9
+	return file_exists(APPPATH."/views/{$path}.php");
10 10
 }
11 11
 
12 12
 function get_time_class(string $time_string) : string {
@@ -32,19 +32,19 @@  discard block
 block discarded – undo
32 32
 	return $time_string;
33 33
 }
34 34
 
35
-if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
36
-	function http_parse_headers (string $raw_headers) : array {
35
+if(!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
36
+	function http_parse_headers(string $raw_headers) : array {
37 37
 		$headers = array(); // $headers = [];
38
-		foreach (explode("\n", $raw_headers) as $i => $h) {
38
+		foreach(explode("\n", $raw_headers) as $i => $h) {
39 39
 			$h = explode(':', $h, 2);
40
-			if (isset($h[1])){
41
-				if(!isset($headers[$h[0]])){
40
+			if(isset($h[1])) {
41
+				if(!isset($headers[$h[0]])) {
42 42
 					$headers[$h[0]] = trim($h[1]);
43
-				}else if(is_array($headers[$h[0]])){
44
-					$tmp = array_merge($headers[$h[0]],array(trim($h[1])));
43
+				} else if(is_array($headers[$h[0]])) {
44
+					$tmp = array_merge($headers[$h[0]], array(trim($h[1])));
45 45
 					$headers[$h[0]] = $tmp;
46
-				}else{
47
-					$tmp = array_merge(array($headers[$h[0]]),array(trim($h[1])));
46
+				} else {
47
+					$tmp = array_merge(array($headers[$h[0]]), array(trim($h[1])));
48 48
 					$headers[$h[0]] = $tmp;
49 49
 				}
50 50
 			}
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,18 +32,19 @@
 block discarded – undo
32 32
 	return $time_string;
33 33
 }
34 34
 
35
-if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
35
+if (!function_exists('http_parse_headers')) {
36
+#http://www.php.net/manual/en/function.http-parse-headers.php#112917
36 37
 	function http_parse_headers (string $raw_headers) : array {
37 38
 		$headers = array(); // $headers = [];
38 39
 		foreach (explode("\n", $raw_headers) as $i => $h) {
39 40
 			$h = explode(':', $h, 2);
40
-			if (isset($h[1])){
41
-				if(!isset($headers[$h[0]])){
41
+			if (isset($h[1])) {
42
+				if(!isset($headers[$h[0]])) {
42 43
 					$headers[$h[0]] = trim($h[1]);
43
-				}else if(is_array($headers[$h[0]])){
44
+				} else if(is_array($headers[$h[0]])) {
44 45
 					$tmp = array_merge($headers[$h[0]],array(trim($h[1])));
45 46
 					$headers[$h[0]] = $tmp;
46
-				}else{
47
+				} else {
47 48
 					$tmp = array_merge(array($headers[$h[0]]),array(trim($h[1])));
48 49
 					$headers[$h[0]] = $tmp;
49 50
 				}
Please login to merge, or discard this patch.
application/models/Tracker/Sites/MangaCow.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 class MangaCow extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-zA-Z0-9_-]+$/';
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 class MangaCow extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-zA-Z0-9_-]+$/';
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		];
16 16
 	}
17 17
 
18
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
18
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
19 19
 		$titleData = [];
20 20
 
21 21
 		$fullURL = $this->getFullTitleURL($title_url);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9\.]+)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
38 38
 
39
-			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) substr($data['nodes_latest']->getAttribute('title'), 13)));
39
+			$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) substr($data['nodes_latest']->getAttribute('title'), 13)));
40 40
 		}
41 41
 
42 42
 		return (!empty($titleData) ? $titleData : NULL);
Please login to merge, or discard this patch.
application/models/Tracker/Sites/ReadMangaToday.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 class ReadMangaToday extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-zA-Z0-9_-]+$/';
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 class ReadMangaToday extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-zA-Z0-9_-]+$/';
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 		];
17 17
 	}
18 18
 
19
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
19
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
20 20
 		$titleData = [];
21 21
 
22 22
 		$fullURL = $this->getFullTitleURL($title_url);
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9\.]+)$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
39 39
 
40 40
 			$dateString = $data['nodes_latest']->nodeValue;
41
-			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime(preg_replace('/ (-|\[A\]).*$/', '', $dateString)));
41
+			$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(preg_replace('/ (-|\[A\]).*$/', '', $dateString)));
42 42
 		}
43 43
 
44 44
 		return (!empty($titleData) ? $titleData : NULL);
Please login to merge, or discard this patch.
_scripts/generate_spritesheet.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 if(!extension_loaded('gd')) die('GD ext is required to run this!');
4 4
 
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 		imagealphablending($sheetImage, FALSE);
24 24
 		imagesavealpha($sheetImage, TRUE);
25 25
 
26
-		imagefill($sheetImage,0,0,0x7fff0000);
26
+		imagefill($sheetImage, 0, 0, 0x7fff0000);
27 27
 
28 28
 		$x = 0;
29
-		foreach ($this->fileList as $filename) {
30
-			$siteImage = imagecreatefrompng(ICON_FOLDER. "/{$filename}");
29
+		foreach($this->fileList as $filename) {
30
+			$siteImage = imagecreatefrompng(ICON_FOLDER."/{$filename}");
31 31
 			imagealphablending($siteImage, TRUE);
32 32
 
33 33
 			$dst_x = ((16 + 2) * $x);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		if(preg_match('/\.sprite-site.*\@cache-version: ([0-9]+);/s', $oldLESS, $cvMatches)) {
58 58
 			$cacheVersion = ((int) $cvMatches[1]) + 1;
59 59
 
60
-			$newLESS = preg_replace('/\.sprite-site.*/s', '',$oldLESS);
60
+			$newLESS = preg_replace('/\.sprite-site.*/s', '', $oldLESS);
61 61
 			$newLESS .= ''.
62 62
 				".sprite-site {\n".
63 63
 				"	.sprite();\n".
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3
-if(!extension_loaded('gd')) die('GD ext is required to run this!');
3
+if(!extension_loaded('gd')) {
4
+	die('GD ext is required to run this!');
5
+}
4 6
 
5 7
 chdir(dirname(__FILE__).'/../'); //Just to make things easier, change dir to project root.
6 8
 const ASSET_FOLDER = 'public/assets';
Please login to merge, or discard this patch.
application/models/Tracker/Sites/FallenAngelsScans.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 class FallenAngelsScans extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-zA-Z0-9_-]+$/';
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 class FallenAngelsScans extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-zA-Z0-9_-]+$/';
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		];
16 16
 	}
17 17
 
18
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
18
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
19 19
 		$titleData = [];
20 20
 
21 21
 		$fullURL = $this->getFullTitleURL($title_url);
Please login to merge, or discard this patch.
application/models/Tracker/Sites/LHTranslation.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 class LHTranslation extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-zA-Z0-9_\-.]+$/';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 		$data = $content['body'];
25 25
 		$xml = simplexml_load_string($data) or die("Error: Cannot create object");
26
-		if(((string) $xml->{'channel'}->title) !== 'Comments on: '){
26
+		if(((string) $xml->{'channel'}->title) !== 'Comments on: ') {
27 27
 			if(isset($xml->{'channel'}->item[0])) {
28 28
 				$titleData['title'] = trim(substr((string) $xml->{'channel'}->title, 0, -33));
29 29
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 class LHTranslation extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-zA-Z0-9_\-.]+$/';
5 5
 	public $chapterFormat = '/^[0-9\.]+$/';
6 6
 
7 7
 	public function getFullTitleURL(string $title_url) : string {
8
-		$title_url = str_replace('.','', $title_url);
8
+		$title_url = str_replace('.', '', $title_url);
9 9
 		return "http://lhtranslation.com/{$title_url}";
10 10
 	}
11 11
 
@@ -16,21 +16,21 @@  discard block
 block discarded – undo
16 16
 		];
17 17
 	}
18 18
 
19
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
19
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
20 20
 		$titleData = [];
21 21
 
22
-		$title_url = str_replace('.','', $title_url);
22
+		$title_url = str_replace('.', '', $title_url);
23 23
 		$fullURL = "http://lhtranslation.com/{$title_url}/feed/";
24 24
 		$content = $this->get_content($fullURL);
25 25
 
26 26
 		$data = $content['body'];
27 27
 		$xml = simplexml_load_string($data) or die("Error: Cannot create object");
28
-		if(((string) $xml->{'channel'}->title) !== 'Comments on: '){
28
+		if(((string) $xml->{'channel'}->title) !== 'Comments on: ') {
29 29
 			if(isset($xml->{'channel'}->item[0])) {
30 30
 				$titleData['title'] = trim(substr((string) $xml->{'channel'}->title, 0, -33));
31 31
 
32 32
 				$titleData['latest_chapter'] = str_replace('-', '.', preg_replace('/^.*?-(?:.*?)chapter-(.*?)\/$/', '$1', (string) $xml->{'channel'}->item[0]->link));
33
-				$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) $xml->{'channel'}->item[0]->pubDate));
33
+				$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $xml->{'channel'}->item[0]->pubDate));
34 34
 			}
35 35
 		} else {
36 36
 			log_message('error', "Series missing? (LHTranslation): {$title_url}");
Please login to merge, or discard this patch.