| 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 |
||
| 39 | public static function skipCommit(Commit $commit) |
||
| 40 | { |
||
| 41 | $comment = $commit['comment']; |
||
| 42 | |||
| 43 | static $equals = [ |
||
| 44 | '' => 1, |
||
| 45 | 'minor' => 1, |
||
| 46 | ]; |
||
| 47 | if ($equals[$comment]) { |
||
| 48 | return true; |
||
| 49 | } |
||
| 50 | |||
| 51 | static $starts = [ |
||
| 52 | 'version bump', |
||
| 53 | 'bumped version', |
||
| 54 | "merge branch 'master'", |
||
| 55 | ]; |
||
| 56 | foreach ($starts as $start) { |
||
| 57 | if (strtolower(substr($comment, 0, strlen($start))) === $start) { |
||
| 58 | return true; |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | return false; |
||
| 63 | } |
||
| 64 | |||
| 80 |
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: