| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | final public function generateRandomPacketIdentifier(): self |
||
| 45 | { |
||
| 46 | try { |
||
| 47 | $this->packetIdentifier = new PacketIdentifierDataType(random_int(1, 65535)); |
||
| 48 | } catch (\Exception $e) { |
||
| 49 | /* |
||
| 50 | * Default to an older method, there should be no security issues here I believe. |
||
| 51 | * |
||
| 52 | * If I am mistaken, please contact me at https://t.me/unreal4u |
||
| 53 | */ |
||
| 54 | /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ |
||
| 55 | /** @noinspection RandomApiMigrationInspection */ |
||
| 56 | $this->packetIdentifier = new PacketIdentifierDataType(mt_rand(1, 65535)); |
||
| 57 | } |
||
| 58 | return $this; |
||
| 59 | } |
||
| 61 |