| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | 4 | public function __construct($value = null) |
|
| 43 | { |
||
| 44 | 4 | $uuid_str = BaseUuid::uuid4(); |
|
| 45 | |||
| 46 | 4 | if (null !== $value) { |
|
| 47 | 2 | $pattern = '/'.BaseUuid::VALID_PATTERN.'/'; |
|
| 48 | |||
| 49 | 2 | if (! \preg_match($pattern, $value)) { |
|
| 50 | 1 | throw new InvalidNativeArgumentException($value, array('UUID string')); |
|
| 51 | } |
||
| 52 | |||
| 53 | 1 | $uuid_str = $value; |
|
| 54 | 1 | } |
|
| 55 | |||
| 56 | 3 | $this->value = \strval($uuid_str); |
|
| 57 | 3 | } |
|
| 58 | |||
| 74 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.