| Conditions | 4 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public static function skipCommit(Commit $commit) |
||
| 34 | { |
||
| 35 | $comment = $commit['comment']; |
||
| 36 | |||
| 37 | static $equals = [ |
||
| 38 | '' => 1, |
||
| 39 | 'minor' => 1, |
||
| 40 | ]; |
||
| 41 | if ($equals[$comment]) { |
||
| 42 | return true; |
||
| 43 | } |
||
| 44 | |||
| 45 | static $starts = [ |
||
| 46 | 'version bump', |
||
| 47 | 'bumped version', |
||
| 48 | "merge branch 'master'", |
||
| 49 | ]; |
||
| 50 | foreach ($starts as $start) { |
||
| 51 | if (strtolower(substr($comment, 0, strlen($start))) === $start) { |
||
| 52 | return true; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | |||
| 56 | return false; |
||
| 57 | } |
||
| 58 | |||
| 60 |
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: