@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | class UnitTester extends \Codeception\Actor |
20 | 20 | { |
21 | - use _generated\UnitTesterActions; |
|
21 | + use _generated\UnitTesterActions; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Define custom actions here |
@@ -16,8 +16,7 @@ |
||
16 | 16 | * |
17 | 17 | * @SuppressWarnings(PHPMD) |
18 | 18 | */ |
19 | -class UnitTester extends \Codeception\Actor |
|
20 | -{ |
|
19 | +class UnitTester extends \Codeception\Actor { |
|
21 | 20 | use _generated\UnitTesterActions; |
22 | 21 | |
23 | 22 | /** |
@@ -4,7 +4,6 @@ |
||
4 | 4 | // here you can define custom actions |
5 | 5 | // all public methods declared in helper class will be available in $I |
6 | 6 | |
7 | -class Functional extends \Codeception\Module |
|
8 | -{ |
|
7 | +class Functional extends \Codeception\Module { |
|
9 | 8 | |
10 | 9 | } |
@@ -4,7 +4,6 @@ |
||
4 | 4 | // here you can define custom actions |
5 | 5 | // all public methods declared in helper class will be available in $I |
6 | 6 | |
7 | -class Unit extends \Codeception\Module |
|
8 | -{ |
|
7 | +class Unit extends \Codeception\Module { |
|
9 | 8 | |
10 | 9 | } |
@@ -4,7 +4,6 @@ |
||
4 | 4 | // here you can define custom actions |
5 | 5 | // all public methods declared in helper class will be available in $I |
6 | 6 | |
7 | -class Acceptance extends \Codeception\Module |
|
8 | -{ |
|
7 | +class Acceptance extends \Codeception\Module { |
|
9 | 8 | |
10 | 9 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | class AcceptanceTester extends \Codeception\Actor |
20 | 20 | { |
21 | - use _generated\AcceptanceTesterActions; |
|
21 | + use _generated\AcceptanceTesterActions; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Define custom actions here |
@@ -16,8 +16,7 @@ |
||
16 | 16 | * |
17 | 17 | * @SuppressWarnings(PHPMD) |
18 | 18 | */ |
19 | -class AcceptanceTester extends \Codeception\Actor |
|
20 | -{ |
|
19 | +class AcceptanceTester extends \Codeception\Actor { |
|
21 | 20 | use _generated\AcceptanceTesterActions; |
22 | 21 | |
23 | 22 | /** |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | class FunctionalTester extends \Codeception\Actor |
20 | 20 | { |
21 | - use _generated\FunctionalTesterActions; |
|
21 | + use _generated\FunctionalTesterActions; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Define custom actions here |
@@ -16,8 +16,7 @@ |
||
16 | 16 | * |
17 | 17 | * @SuppressWarnings(PHPMD) |
18 | 18 | */ |
19 | -class FunctionalTester extends \Codeception\Actor |
|
20 | -{ |
|
19 | +class FunctionalTester extends \Codeception\Actor { |
|
21 | 20 | use _generated\FunctionalTesterActions; |
22 | 21 | |
23 | 22 | /** |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | public function valid_password(string $password) : bool { |
31 | 31 | if(!($isValid = $this->min_length($password, $this->CI->config->item('min_password_length', 'ion_auth')))) { |
32 | 32 | $this->set_message('valid_password', 'The password is too short!'); |
33 | - } |
|
34 | - elseif(!($isValid = $this->max_length($password, $this->CI->config->item('max_password_length', 'ion_auth')))) { |
|
33 | + } elseif(!($isValid = $this->max_length($password, $this->CI->config->item('max_password_length', 'ion_auth')))) { |
|
35 | 34 | $this->set_message('valid_password', 'The password is too long!'); |
36 | 35 | } |
37 | 36 | return $isValid; |
@@ -91,7 +90,7 @@ discard block |
||
91 | 90 | */ |
92 | 91 | public function isRuleValid(string $ruleName) : bool { |
93 | 92 | $isValid = FALSE; |
94 | - if(is_string($ruleName) && $this->has_rule($ruleName)){ |
|
93 | + if(is_string($ruleName) && $this->has_rule($ruleName)) { |
|
95 | 94 | $isValid = !in_array($ruleName, array_keys($this->error_array()), TRUE); |
96 | 95 | } |
97 | 96 | return $isValid; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | parent::__construct(); |
8 | 8 | log_message('debug', "MY_Form_validation Class Initialized"); |
9 | 9 | |
10 | - $this->CI =& get_instance(); |
|
10 | + $this->CI = & get_instance(); |
|
11 | 11 | $this->CI->config->load('ion_auth', TRUE); |
12 | 12 | $this->user_tables = $this->CI->config->item('tables', 'ion_auth'); |
13 | 13 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function isRuleValid(string $ruleName) : bool { |
97 | 97 | $isValid = FALSE; |
98 | - if(is_string($ruleName) && $this->has_rule($ruleName)){ |
|
98 | + if(is_string($ruleName) && $this->has_rule($ruleName)) { |
|
99 | 99 | $isValid = !in_array($ruleName, array_keys($this->error_array()), TRUE); |
100 | 100 | } |
101 | 101 | return $isValid; |
@@ -245,7 +245,7 @@ |
||
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
248 | - * @param $md5 |
|
248 | + * @param string $md5 |
|
249 | 249 | * |
250 | 250 | * @return array |
251 | 251 | */ |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function __construct(&$db) { |
76 | 76 | // Assign the main CI object to $this->CI and load the file helper since we use it a lot |
77 | - $this->CI =& get_instance(); |
|
78 | - $this->db =& $db; |
|
77 | + $this->CI = & get_instance(); |
|
78 | + $this->db = & $db; |
|
79 | 79 | $this->CI->load->helper('file'); |
80 | 80 | |
81 | 81 | $this->check_path(); |
@@ -102,18 +102,18 @@ discard block |
||
102 | 102 | |
103 | 103 | // Add a trailing slash to the path if needed |
104 | 104 | $path = realpath($path) |
105 | - ? rtrim(realpath($path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR |
|
106 | - : rtrim($path, '/') . '/'; |
|
105 | + ? rtrim(realpath($path), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR |
|
106 | + : rtrim($path, '/').'/'; |
|
107 | 107 | |
108 | 108 | if(!is_dir($path)) { |
109 | - log_message('debug', 'DB cache path error: ' . $path); |
|
109 | + log_message('debug', 'DB cache path error: '.$path); |
|
110 | 110 | |
111 | 111 | // If the path is wrong we'll turn off caching |
112 | 112 | return $this->db->cache_off(); |
113 | 113 | } |
114 | 114 | |
115 | 115 | if(!is_really_writable($path)) { |
116 | - log_message('debug', 'DB cache dir not writable: ' . $path); |
|
116 | + log_message('debug', 'DB cache dir not writable: '.$path); |
|
117 | 117 | |
118 | 118 | // If the path is not really writable we'll turn off caching |
119 | 119 | return $this->db->cache_off(); |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | // BEGIN --- modification for supporting multi-level cache folders |
145 | 145 | |
146 | 146 | if(is_array($this->CI->config->item('multi_level_cache_folders'))) { |
147 | - $uri_md5 = md5($segment_one . '+' . $segment_two); |
|
147 | + $uri_md5 = md5($segment_one.'+'.$segment_two); |
|
148 | 148 | $layer = $this->get_folder_layers($uri_md5); |
149 | - $filepath = $this->db->cachedir . $segment_one.'/'.$segment_two . '/' . implode('/', $layer) . '/' . $uri_md5; |
|
149 | + $filepath = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'.implode('/', $layer).'/'.$uri_md5; |
|
150 | 150 | } else { |
151 | - $filepath = $this->db->cachedir . $segment_one.'/'. $segment_two . '/' . md5($sql); |
|
151 | + $filepath = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'.md5($sql); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // END --- modification for supporting multi-level cache folders |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | // BEGIN --- modification for supporting multi-level cache folders |
179 | 179 | |
180 | 180 | if(is_array($this->CI->config->item('multi_level_cache_folders'))) { |
181 | - $uri_md5 = md5($segment_one . '+' . $segment_two); |
|
181 | + $uri_md5 = md5($segment_one.'+'.$segment_two); |
|
182 | 182 | $layer = $this->get_folder_layers($uri_md5); |
183 | - $dir_path = $this->db->cachedir . $segment_one.'/'.$segment_two . '/' . implode('/', $layer) . '/'; |
|
183 | + $dir_path = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'.implode('/', $layer).'/'; |
|
184 | 184 | |
185 | 185 | if(!is_dir($dir_path)) { |
186 | 186 | $old = umask(0); |
@@ -188,18 +188,18 @@ discard block |
||
188 | 188 | umask($old); |
189 | 189 | } |
190 | 190 | } else { |
191 | - $dir_path = $this->db->cachedir . $segment_one.'/'. $segment_two . '/'; |
|
191 | + $dir_path = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | $filename = md5($sql); |
195 | 195 | |
196 | 196 | // END --- modification for supporting multi-level cache folders |
197 | 197 | |
198 | - if(write_file($dir_path . $filename, serialize($object)) === FALSE) { |
|
198 | + if(write_file($dir_path.$filename, serialize($object)) === FALSE) { |
|
199 | 199 | return FALSE; |
200 | 200 | } |
201 | 201 | |
202 | - chmod($dir_path . $filename, 0640); |
|
202 | + chmod($dir_path.$filename, 0640); |
|
203 | 203 | |
204 | 204 | return TRUE; |
205 | 205 | } |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | if(is_array($this->CI->config->item('multi_level_cache_folders'))) { |
227 | - $uri_md5 = md5($segment_one . '+' . $segment_two); |
|
227 | + $uri_md5 = md5($segment_one.'+'.$segment_two); |
|
228 | 228 | $layer = $this->get_folder_layers($uri_md5); |
229 | - $dir_path = $this->db->cachedir . $segment_one.'/'.$segment_two . '/' . implode('/', $layer) . '/'; |
|
229 | + $dir_path = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'.implode('/', $layer).'/'; |
|
230 | 230 | } else { |
231 | - $dir_path = $this->db->cachedir . $segment_one.'/'. $segment_two . '/'; |
|
231 | + $dir_path = $this->db->cachedir.$segment_one.'/'.$segment_two.'/'; |
|
232 | 232 | } |
233 | 233 | delete_files($dir_path, TRUE); |
234 | 234 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @since Version 1.0.0 |
36 | 36 | * @filesource |
37 | 37 | */ |
38 | -defined('BASEPATH') OR exit('No direct script access allowed'); |
|
38 | +defined('BASEPATH') or exit('No direct script access allowed'); |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Database Cache Class |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $last_key = 0; |
255 | 255 | $last_value = 0; |
256 | 256 | |
257 | - foreach($this->CI->config->item('multi_level_cache_folders') AS $key => $value) { |
|
257 | + foreach($this->CI->config->item('multi_level_cache_folders') as $key => $value) { |
|
258 | 258 | if($key != 0) { |
259 | 259 | $key = $last_key + $last_value; |
260 | 260 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | // if this class is already loaded before instantiating it. Loading it now |
23 | 23 | // makes sure our version is used when a controller enables query caching |
24 | 24 | if(!class_exists('CI_DB_Cache')) { |
25 | - @include(APPPATH . 'libraries/MY_DB_cache.php'); |
|
25 | + @include(APPPATH.'libraries/MY_DB_cache.php'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | // call the parent method to retain the CI functionality |