mirror of
https://github.com/Respect/Validation.git
synced 2024-06-29 02:30:06 +02:00
Codestyle fixed according to @nickl-
This commit is contained in:
parent
c50c27eecb
commit
41658279e8
|
@ -25,16 +25,14 @@ class Sorted extends AbstractRule
|
|||
public function validate($input)
|
||||
{
|
||||
$count = count($input);
|
||||
if ($count < 2) {
|
||||
return true;
|
||||
}
|
||||
if ($count < 2)
|
||||
return true;
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
if (
|
||||
($this->ascending && ($this->fn)($input[$i]) < ($this->fn)($input[$i - 1]))
|
||||
|| (!$this->ascending && ($this->fn)($input[$i]) > ($this->fn)($input[$i - 1]))
|
||||
) {
|
||||
)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue