@@ -1,4 +1,4 @@ discard block |
||
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 User_Options_Model extends CI_Model { |
4 | 4 | public $options = array( |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $query = $this->db->select('value_str, value_int') |
201 | 201 | ->from('user_options') |
202 | 202 | ->where('user_id', $userID) |
203 | - ->where('name', $option) |
|
203 | + ->where('name', $option) |
|
204 | 204 | ->limit(1); |
205 | 205 | $data = $query->get()->row_array(); |
206 | 206 | } else { |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $query = $this->db->select('value_str, value_int') |
209 | 209 | ->from('user_options') |
210 | 210 | ->where('user_id', $userID) |
211 | - ->where('name', $option) |
|
211 | + ->where('name', $option) |
|
212 | 212 | ->limit(1); |
213 | 213 | $data = $query->get()->row_array(); |
214 | 214 | $this->session->set_tempdata("option_{$option}", $data, 3600); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | ); |
262 | 262 | //FIXME: Get a better solution than str_replace for removing special characters |
263 | 263 | $elements = array(); |
264 | - foreach (array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
264 | + foreach(array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
265 | 265 | $elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array( |
266 | 266 | 'value' => $valid_option |
267 | 267 | )); |
@@ -1,4 +1,4 @@ discard block |
||
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 Tracker_Base_Model extends CI_Model { |
4 | 4 | public $sites; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->enabledCategories['custom3'] = $this->User_Options->get('category_custom_3_text'); |
27 | 27 | } |
28 | 28 | |
29 | - foreach (glob(APPPATH.'models/Tracker/Sites/*.php') as $filename) { |
|
29 | + foreach(glob(APPPATH.'models/Tracker/Sites/*.php') as $filename) { |
|
30 | 30 | /** @noinspection PhpIncludeInspection */ |
31 | 31 | include_once $filename; |
32 | 32 | } |
@@ -1,11 +1,11 @@ |
||
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 | //Because we can't autoload the cache driver with params - https://forum.codeigniter.com/thread-62217-post-319687.html#pid319687 |
4 | 4 | class Cacher { |
5 | 5 | protected $CI; |
6 | 6 | |
7 | 7 | public function __construct() { |
8 | - $this->CI =& get_instance(); //grab an instance of CI |
|
8 | + $this->CI = & get_instance(); //grab an instance of CI |
|
9 | 9 | $this->initiate_cache(); |
10 | 10 | } |
11 | 11 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // break; |
27 | 27 | |
28 | 28 | case 'html': |
29 | - $this->body_data['trackerData'] = $trackerData['series']; |
|
29 | + $this->body_data['trackerData'] = $trackerData['series']; |
|
30 | 30 | |
31 | 31 | $this->header_data['show_header'] = FALSE; |
32 | 32 | $this->footer_data['show_footer'] = FALSE; |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | if($show_404) show_404(); |
63 | 63 | } |
64 | 64 | |
65 | - private function _walk_recursive_remove (array $array, callable $callback) : array { |
|
66 | - foreach ($array as $k => $v) { |
|
67 | - if (is_array($v)) { |
|
65 | + private function _walk_recursive_remove(array $array, callable $callback) : array { |
|
66 | + foreach($array as $k => $v) { |
|
67 | + if(is_array($v)) { |
|
68 | 68 | $array[$k] = $this->_walk_recursive_remove($v, $callback); |
69 | 69 | } else { |
70 | - if ($callback($v, $k)) { |
|
70 | + if($callback($v, $k)) { |
|
71 | 71 | unset($array[$k]); |
72 | 72 | } |
73 | 73 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | case 'csv': |
33 | 33 | $this->output->set_content_type('text/csv', 'utf-8'); |
34 | - $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($historyData, 'Date/Time,Title,URL,Site,Status'), 'csv',TRUE, 'tracker-history'); |
|
34 | + $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($historyData, 'Date/Time,Title,URL,Site,Status'), 'csv', TRUE, 'tracker-history'); |
|
35 | 35 | break; |
36 | 36 | |
37 | 37 | default: |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | case 'csv': |
33 | 33 | $this->output->set_content_type('text/csv', 'utf-8'); |
34 | - $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($favouriteData, 'Date/Time,Title,Manga URL,Site,Chapter,Chapter Number, Chapter URL'), 'csv',TRUE, 'tracker-favourite'); |
|
34 | + $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($favouriteData, 'Date/Time,Title,Manga URL,Site,Chapter,Chapter Number, Chapter URL'), 'csv', TRUE, 'tracker-favourite'); |
|
35 | 35 | break; |
36 | 36 | |
37 | 37 | default: |
@@ -1,4 +1,4 @@ discard block |
||
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 Tracker_Favourites_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | tf.chapter, tf.updated_at', FALSE) |
15 | 15 | ->from('tracker_favourites AS tf') |
16 | 16 | ->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left') |
17 | - ->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left') |
|
18 | - ->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left') |
|
17 | + ->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left') |
|
18 | + ->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left') |
|
19 | 19 | ->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites? |
20 | 20 | ->order_by('tf.id DESC') |
21 | 21 | ->limit($rowsPerPage, ($rowsPerPage * ($page - 1))) |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | tf.chapter, tf.updated_at', FALSE) |
51 | 51 | ->from('tracker_favourites AS tf') |
52 | 52 | ->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left') |
53 | - ->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left') |
|
54 | - ->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left') |
|
53 | + ->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left') |
|
54 | + ->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left') |
|
55 | 55 | ->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites? |
56 | 56 | ->order_by('tf.id DESC') |
57 | 57 | ->get(); |
@@ -1,4 +1,4 @@ discard block |
||
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 | //http://english.stackexchange.com/a/141735 |
4 | 4 | class Tracker_Portation_Model extends Tracker_Base_Model { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $arr = []; |
63 | 63 | if($query->num_rows() > 0) { |
64 | - foreach ($query->result() as $row) { |
|
64 | + foreach($query->result() as $row) { |
|
65 | 65 | $arr[$row->category][] = [ |
66 | 66 | 'site' => $row->site, |
67 | 67 | 'title_url' => $row->title_url, |
@@ -94,15 +94,15 @@ discard block |
||
94 | 94 | $enclosure_esc = preg_quote($enclosure, '/'); |
95 | 95 | |
96 | 96 | $output = array(); |
97 | - foreach ($fields as $field) { |
|
98 | - if ($field === NULL && $nullToMysqlNull) { |
|
97 | + foreach($fields as $field) { |
|
98 | + if($field === NULL && $nullToMysqlNull) { |
|
99 | 99 | $output[] = 'NULL'; |
100 | 100 | continue; |
101 | 101 | } |
102 | 102 | |
103 | 103 | // Enclose fields containing $delimiter, $enclosure or whitespace |
104 | - if ($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) { |
|
105 | - $output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure; |
|
104 | + if($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) { |
|
105 | + $output[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $field).$enclosure; |
|
106 | 106 | } else { |
107 | 107 | $output[] = $field; |
108 | 108 | } |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | $csvArr[] = $headers; |
117 | 117 | } |
118 | 118 | |
119 | - foreach ($fields as $field) { |
|
120 | - $csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure,$encloseAll,$nullToMysqlNull); |
|
119 | + foreach($fields as $field) { |
|
120 | + $csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure, $encloseAll, $nullToMysqlNull); |
|
121 | 121 | } |
122 | 122 | |
123 | - return implode(PHP_EOL,$csvArr); |
|
123 | + return implode(PHP_EOL, $csvArr); |
|
124 | 124 | } |
125 | 125 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | print "Testing site\n"; |
65 | 65 | switch($type) { |
66 | 66 | case 'update': |
67 | - if(!is_null($extra )) { |
|
67 | + if(!is_null($extra)) { |
|
68 | 68 | print_r($this->Tracker->sites->{$site}->getTitleData($extra)); |
69 | 69 | } |
70 | 70 | break; |