| Conditions | 4 |
| Paths | 8 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 52 | 3 | public function performStrictValidationCheck(): \Generator |
|
| 53 | { |
||
| 54 | 3 | $utf8ClientIdSize = \mb_strlen($this->clientId); |
|
| 55 | |||
| 56 | 3 | if ($this->isEmptyClientId()) { |
|
| 57 | /* |
||
| 58 | * If you ever wind up in this situation, search for MQTT-3.1.3-7 on the following document for more |
||
| 59 | * information: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718067 |
||
| 60 | */ |
||
| 61 | 1 | yield 'ClientId size is 0 bytes. This has several implications, check comments'; |
|
| 62 | } |
||
| 63 | |||
| 64 | 3 | if ($utf8ClientIdSize > 23) { |
|
| 65 | 1 | yield 'The broker MAY reject the connection because the ClientId is too long'; |
|
| 66 | } |
||
| 67 | |||
| 68 | 3 | if (\strlen($this->clientId) !== $utf8ClientIdSize) { |
|
| 69 | 1 | yield 'The broker MAY reject the connection because of invalid characters'; |
|
| 70 | } |
||
| 73 |