| Conditions | 2 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 41 | public function __construct(string $url, string $description = null, HashGenerator $hashGenerator = null) |
||
| 42 | { |
||
| 43 | $hashGenerator = $hashGenerator ?: new HashGenerator(); |
||
| 44 | $this->id = $hashGenerator::generate(self::ID_HASH_LENGTH); |
||
|
|
|||
| 45 | $this->url = $url; |
||
| 46 | $this->description = $description; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.