We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 75% |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | final class Isbn extends AbstractRule |
||
| 28 | { |
||
| 29 | /** |
||
| 30 | * @see https://howtodoinjava.com/regex/java-regex-validate-international-standard-book-number-isbns |
||
| 31 | */ |
||
| 32 | private const PIECES = [ |
||
| 33 | '^(?:ISBN(?:-1[03])?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[- ]){3})', |
||
| 34 | '[- 0-9X]{13}$|97[89][0-9]{10}$|(?=(?:[0-9]+[- ]){4})[- 0-9]{17}$)', |
||
| 35 | '(?:97[89][- ]?)?[0-9]{1,5}[- ]?[0-9]+[- ]?[0-9]+[- ]?[0-9X]$', |
||
| 36 | ]; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | */ |
||
| 41 | 18 | public function validate($input): bool |
|
| 50 |