Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 5 | public function execute(string $value): int |
|
18 | { |
||
19 | 5 | $sentences = \preg_split('/(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\?)\s/um', \trim($value), null, PREG_SPLIT_DELIM_CAPTURE); |
|
20 | |||
21 | $sentences = array_map(function($value) { |
||
22 | 5 | return trim($value); |
|
23 | 5 | }, $sentences); |
|
|
|||
24 | |||
25 | 5 | return \count($sentences); |
|
26 | } |
||
28 |