Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | 28 | public function __construct($value = null) |
|
42 | { |
||
43 | 28 | $uuid_str = BaseUuid::uuid4(); |
|
44 | |||
45 | 28 | if (null !== $value) { |
|
46 | 2 | $pattern = '/'.BaseUuid::VALID_PATTERN.'/'; |
|
47 | |||
48 | 2 | if (! \preg_match($pattern, $value)) { |
|
49 | 1 | throw new InvalidNativeArgumentException($value, array('UUID string')); |
|
50 | } |
||
51 | |||
52 | 1 | $uuid_str = $value; |
|
53 | } |
||
54 | |||
55 | 27 | $this->value = \strval($uuid_str); |
|
56 | 27 | } |
|
57 | |||
73 |
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
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.