1 | <?php |
||
9 | trait HasBinaryUuid |
||
10 | { |
||
11 | protected static function bootHasBinaryUuid() |
||
21 | |||
22 | public static function scopeWithUuid(Builder $builder, $uuid): Builder |
||
32 | |||
33 | public static function encodeUuid(string $uuid): string |
||
43 | |||
44 | public static function decodeUuid(string $binaryUuid): string |
||
45 | { |
||
46 | $uuidWithoutDashes = bin2hex( |
||
47 | substr($binaryUuid, 4, 4) |
||
48 | .substr($binaryUuid, 2, 2) |
||
49 | .substr($binaryUuid, 0, 2) |
||
50 | .substr($binaryUuid, 8, 8) |
||
51 | ); |
||
52 | |||
53 | $uuidWithDashes = collect([8, 13, 18, 23])->reduce(function ($uuid, $position) { |
||
54 | return substr_replace($uuid, '-', $position, 0); |
||
55 | }, $uuidWithoutDashes); |
||
56 | |||
57 | return $uuidWithDashes; |
||
58 | } |
||
59 | |||
60 | public function getUuidTextAttribute(): string |
||
64 | |||
65 | public function setUuidTextAttribute(string $uuid) |
||
69 | |||
70 | public function getQueueableId() |
||
74 | |||
75 | public function newQueryForRestoration($id) |
||
79 | } |
||
80 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: