| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace norsys\score\net\uri\scheme; |
||
| 15 | function __construct(string $string, port $port, \exception $exception = null) |
||
| 16 | { |
||
| 17 | parent::__construct($string); |
||
| 18 | |||
| 19 | ( |
||
| 20 | new php\test\match\regex( |
||
| 21 | new php\string\regex\pcre('/^[a-z][a-z0-9+-.]*$/'), |
||
| 22 | $this |
||
| 23 | ) |
||
| 24 | ) |
||
| 25 | ->recipientOfTestIs( |
||
| 26 | new php\test\recipient\ifFalse\exception\fallback( |
||
| 27 | new \invalidArgumentException('Scheme must follow ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )'), |
||
| 28 | $exception |
||
| 29 | ) |
||
| 30 | ) |
||
| 31 | ; |
||
| 32 | |||
| 33 | $this->port = $port; |
||
| 34 | } |
||
| 41 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.