Skip to content

Commit 8ed08be

Browse files
committed
Validation module typos
1 parent e5bf17b commit 8ed08be

4 files changed

Lines changed: 9 additions & 14 deletions

File tree

system/Session/Handlers/BaseHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ abstract class BaseHandler implements \SessionHandlerInterface
130130
*
131131
* @param BaseConfig $config
132132
*/
133-
public function __construct(BaseConfig $config, string $ipAddress)
133+
public function __construct($config, string $ipAddress)
134134
{
135135
$this->cookiePrefix = $config->cookiePrefix;
136136
$this->cookieDomain = $config->cookieDomain;

system/Throttle/Throttler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function __construct(CacheInterface $cache)
9797
*
9898
* @return integer
9999
*/
100-
public function getTokenTime()
100+
public function getTokenTime(): int
101101
{
102102
return $this->tokenTime;
103103
}
@@ -123,7 +123,7 @@ public function getTokenTime()
123123
* @return boolean
124124
* @internal param int $maxRequests
125125
*/
126-
public function check(string $key, int $capacity, int $seconds, int $cost = 1)
126+
public function check(string $key, int $capacity, int $seconds, int $cost = 1): bool
127127
{
128128
$tokenName = $this->prefix . $key;
129129

@@ -193,7 +193,7 @@ public function setTestTime(int $time)
193193
*
194194
* @return integer
195195
*/
196-
public function time()
196+
public function time(): int
197197
{
198198
return $this->testTime ?? time();
199199
}

system/Validation/FormatRules.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,6 @@ public function valid_email(string $str = null): bool
287287
*/
288288
public function valid_emails(string $str = null): bool
289289
{
290-
if (strpos($str, ',') === false)
291-
{
292-
return $this->valid_email(trim($str));
293-
}
294-
295290
foreach (explode(',', $str) as $email)
296291
{
297292
$email = trim($email);

system/Validation/Validation.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function __construct($config, RendererInterface $view)
116116

117117
/**
118118
* Runs the validation process, returning true/false determining whether
119-
* or not validation was successful.
119+
* validation was successful or not.
120120
*
121121
* @param array $data The array of data to validate.
122122
* @param string $group The pre-defined group of rules to apply.
@@ -168,7 +168,7 @@ public function run(array $data = null, string $group = null, string $db_group =
168168

169169
/**
170170
* Check; runs the validation process, returning true or false
171-
* determining whether or not validation was successful.
171+
* determining whether validation was successful or not.
172172
*
173173
* @param mixed $value Value to validation.
174174
* @param string $rule Rule.
@@ -202,7 +202,7 @@ public function check($value, string $rule, array $errors = []): bool
202202
*
203203
* @return boolean
204204
*/
205-
protected function processRules(string $field, string $label = null, $value, $rules = null, array $data)
205+
protected function processRules(string $field, string $label = null, $value, $rules = null, array $data): bool
206206
{
207207
// If the if_exist rule is defined...
208208
if (in_array('if_exist', $rules))
@@ -399,7 +399,7 @@ public function setRules(array $rules, array $errors = []): ValidationInterface
399399
*
400400
* @return array
401401
*/
402-
public function getRules()
402+
public function getRules(): array
403403
{
404404
return $this->rules;
405405
}
@@ -615,7 +615,7 @@ public function getError(string $field = null): string
615615

616616
/**
617617
* Returns the array of errors that were encountered during
618-
* a run() call. The array should be in the followig format:
618+
* a run() call. The array should be in the following format:
619619
*
620620
* [
621621
* 'field1' => 'error message',

0 commit comments

Comments
 (0)