We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 5 | 
| Paths | 6 | 
| Total Lines | 12 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 9 | 
| CRAP Score | 5 | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 22 | 7 | public function validate($input)  | 
            |
| 23 |     { | 
            ||
| 24 | 7 | $count = count($input);  | 
            |
| 25 | 7 | if($count < 2) return true;  | 
            |
| 26 | 7 |         for($i = 1; $i < $count; $i++){ | 
            |
| 27 | 7 | $cmp = $this->ascending === true  | 
            |
| 28 | 5 | ? ($this->fn)($input[$i]) >= ($this->fn)($input[$i - 1])  | 
            |
| 29 | 7 | : ($this->fn)($input[$i]) <= ($this->fn)($input[$i - 1]);  | 
            |
| 30 | 7 | if($cmp === false) return false;  | 
            |
| 31 | }  | 
            ||
| 32 | 5 | return true;  | 
            |
| 33 | }  | 
            ||
| 34 | }  | 
            ||
| 35 | 
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: