| Total Complexity | 8 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Meter |
||
| 6 | { |
||
| 7 | protected $counter; |
||
| 8 | |||
| 9 | protected $name; |
||
| 10 | |||
| 11 | public function __construct(string $name) |
||
| 12 | { |
||
| 13 | $this->name = $name; |
||
| 14 | $this->counter = new \Swoole\Atomic\Long(0); |
||
| 15 | } |
||
| 16 | |||
| 17 | public function mark(): void |
||
| 18 | { |
||
| 19 | $this->counter->add(1); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function markTimes(int $times): void |
||
| 25 | } |
||
| 26 | |||
| 27 | public function getName(): string |
||
| 28 | { |
||
| 29 | return $this->name; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function setName(string $name): void |
||
| 35 | } |
||
| 36 | |||
| 37 | public function getAndClear(): int |
||
| 42 | } |
||
| 43 | |||
| 44 | public function get(bool $clear = false): int |
||
| 49 |