@@ -1,11 +1,11 @@ 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_List_Model extends Tracker_Base_Model { |
| 4 | 4 | public function __construct() { |
| 5 | 5 | parent::__construct(); |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | - public function get(?int $userID = NULL) { |
|
| 8 | + public function get(? int $userID = NULL) { |
|
| 9 | 9 | $userID = (is_null($userID) ? (int) $this->User->id : $userID); |
| 10 | 10 | |
| 11 | 11 | $query = $this->db |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | ]; |
| 30 | 30 | } |
| 31 | 31 | if($query->num_rows() > 0) { |
| 32 | - foreach ($query->result() as $row) { |
|
| 32 | + foreach($query->result() as $row) { |
|
| 33 | 33 | $is_unread = intval($row->latest_chapter == $row->current_chapter ? '1' : '0'); |
| 34 | 34 | $arr['series'][$row->category]['unread_count'] = (($arr['series'][$row->category]['unread_count'] ?? 0) + !$is_unread); |
| 35 | 35 | $data = [ |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | $sortOrder = $this->User_Options->get('list_sort_order', $userID); |
| 71 | 71 | switch($this->User_Options->get('list_sort_type', $userID)) { |
| 72 | 72 | case 'unread': |
| 73 | - foreach (array_keys($arr['series']) as $category) { |
|
| 74 | - usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) { |
|
| 73 | + foreach(array_keys($arr['series']) as $category) { |
|
| 74 | + usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
|
| 75 | 75 | $a_text = strtolower("{$a['new_chapter_exists']} - {$a['title_data']['title']}"); |
| 76 | 76 | $b_text = strtolower("{$b['new_chapter_exists']} - {$b['title_data']['title']}"); |
| 77 | 77 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | break; |
| 86 | 86 | |
| 87 | 87 | case 'alphabetical': |
| 88 | - foreach (array_keys($arr['series']) as $category) { |
|
| 88 | + foreach(array_keys($arr['series']) as $category) { |
|
| 89 | 89 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
| 90 | 90 | $a_text = strtolower("{$a['title_data']['title']}"); |
| 91 | 91 | $b_text = strtolower("{$b['title_data']['title']}"); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | break; |
| 101 | 101 | |
| 102 | 102 | case 'my_status': |
| 103 | - foreach (array_keys($arr['series']) as $category) { |
|
| 103 | + foreach(array_keys($arr['series']) as $category) { |
|
| 104 | 104 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
| 105 | 105 | $a_text = strtolower("{$a['generated_current_data']['number']}"); |
| 106 | 106 | $b_text = strtolower("{$b['generated_current_data']['number']}"); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | break; |
| 116 | 116 | |
| 117 | 117 | case 'latest': |
| 118 | - foreach (array_keys($arr['series']) as $category) { |
|
| 118 | + foreach(array_keys($arr['series']) as $category) { |
|
| 119 | 119 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
| 120 | 120 | $a_text = strtolower("{$a['generated_latest_data']['number']}"); |
| 121 | 121 | $b_text = strtolower("{$b['generated_latest_data']['number']}"); |
@@ -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; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $this->sites = new Sites_Model; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - public function getEnabledCategories(?int $userID = NULL) : array { |
|
| 33 | + public function getEnabledCategories(? int $userID = NULL) : array { |
|
| 34 | 34 | $userID = (is_null($userID) ? (int) $this->User->id : $userID); |
| 35 | 35 | |
| 36 | 36 | $enabledCategories = []; |
@@ -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( |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @return mixed Returns option value as STRING, or FALSE if option does not exist. |
| 118 | 118 | */ |
| 119 | - public function get(string $option, ?int $userID = NULL) { |
|
| 119 | + public function get(string $option, ? int $userID = NULL) { |
|
| 120 | 120 | $userID = (is_null($userID) ? (int) $this->User->id : $userID); |
| 121 | 121 | |
| 122 | 122 | return $this->get_by_userid($option, $userID); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $query = $this->db->select('value_str, value_int') |
| 191 | 191 | ->from('user_options') |
| 192 | 192 | ->where('user_id', $userID) |
| 193 | - ->where('name', $option) |
|
| 193 | + ->where('name', $option) |
|
| 194 | 194 | ->limit(1); |
| 195 | 195 | $data = $query->get()->row_array(); |
| 196 | 196 | } else { |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $query = $this->db->select('value_str, value_int') |
| 199 | 199 | ->from('user_options') |
| 200 | 200 | ->where('user_id', $userID) |
| 201 | - ->where('name', $option) |
|
| 201 | + ->where('name', $option) |
|
| 202 | 202 | ->limit(1); |
| 203 | 203 | $data = $query->get()->row_array(); |
| 204 | 204 | $this->session->set_tempdata("option_{$option}", $data, 3600); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | ); |
| 252 | 252 | //FIXME: Get a better solution than str_replace for removing special characters |
| 253 | 253 | $elements = array(); |
| 254 | - foreach (array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
| 254 | + foreach(array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
| 255 | 255 | $elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array( |
| 256 | 256 | 'value' => $valid_option |
| 257 | 257 | )); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | $this->load->library('form_validation'); |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | - public function index(?string $username = NULL, string $type = 'html') { |
|
| 11 | + public function index(? string $username = NULL, string $type = 'html') { |
|
| 12 | 12 | $show_404 = FALSE; |
| 13 | 13 | |
| 14 | 14 | $type = mb_strtolower($type); |