Conditions | 4 |
Paths | 4 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
54 | public function sequence(int $currentTime) |
||
55 | { |
||
56 | /** |
||
57 | * If swoole lock failure,we return a bit number, This will cause the program to |
||
58 | * perform the next millisecond operation. |
||
59 | */ |
||
60 | if (!$this->lock->trylock()) { |
||
61 | if ($this->count >= 10) { |
||
62 | throw new \Exception('Swoole lock failure, Unable to get the program lock after many attempts.'); |
||
63 | } |
||
64 | |||
65 | ++$this->count; |
||
66 | |||
67 | return 999999; |
||
68 | } |
||
69 | |||
70 | if ($this->lastTimeStamp === $currentTime) { |
||
71 | ++$this->sequence; |
||
72 | } |
||
73 | |||
74 | $this->lastTimeStamp = $currentTime; |
||
|
|||
75 | |||
76 | $this->lock->unlock(); |
||
77 | |||
78 | return $this->sequence; |
||
79 | } |
||
80 | } |
||
81 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..