| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 20 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 11 | public function __construct(bool $checkOnlyBeginning = false) |
|
| 30 | { |
||
| 31 | 11 | parent::__construct(); |
|
| 32 | |||
| 33 | 11 | $this->hint = 'A commit message subject should always complete the following sentence.' . PHP_EOL . |
|
| 34 | 11 | 'This commit will [YOUR COMMIT MESSAGE].'; |
|
| 35 | |||
| 36 | 11 | $this->setSubjectBlacklist( |
|
| 37 | 11 | [ |
|
| 38 | 11 | 'added', |
|
| 39 | 11 | 'changed', |
|
| 40 | 11 | 'created', |
|
| 41 | 11 | 'deleted', |
|
| 42 | 11 | 'fixed', |
|
| 43 | 11 | 'reformatted', |
|
| 44 | 11 | 'removed', |
|
| 45 | 11 | 'updated', |
|
| 46 | 11 | 'uploaded' |
|
| 47 | 11 | ] |
|
| 48 | 11 | ); |
|
| 49 | |||
| 50 | 11 | if ($checkOnlyBeginning) { |
|
| 51 | // overwrite the detection logic to only check the beginning og the string |
||
| 52 | 4 | $this->stringDetection = function (string $content, string $term): bool { |
|
| 53 | 4 | return strpos($content, $term) === 0; |
|
| 54 | 4 | }; |
|
| 58 |