| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 11 | public function __construct(bool $checkOnlyBeginning = false) |
|
| 30 | 11 | { |
|
| 31 | 11 | parent::__construct(false); |
|
| 32 | $this->hint = 'Subject should be written in imperative mood'; |
||
| 33 | 11 | $this->setSubjectBlacklist( |
|
| 34 | [ |
||
| 35 | 'added', |
||
| 36 | 'changed', |
||
| 37 | 'created', |
||
| 38 | 'deleted', |
||
| 39 | 'fixed', |
||
| 40 | 'reformatted', |
||
| 41 | 'removed', |
||
| 42 | 'updated', |
||
| 43 | 'uploaded' |
||
| 44 | 11 | ] |
|
| 45 | ); |
||
| 46 | |||
| 47 | 4 | if ($checkOnlyBeginning) { |
|
| 48 | // overwrite the detection logic to only check the beginning og the string |
||
| 49 | $this->stringDetection = function (string $content, string $term): bool { |
||
| 50 | 11 | return strpos($content, $term) === 0; |
|
| 51 | }; |
||
| 55 |