Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
DebuggerState.php
1<?php
2
4
6{
7 public const RUN = 0;
8 public const NEXT_STEP = 1;
9 public const STOP = 2;
10 public const PAUSE = 3;
11 public const UNDEFINED = -1;
12
13 private int $stateId;
14
15 public function __construct(int $stateId)
16 {
17 $this->stateId = $stateId;
18 }
19
20 public static function undefined(): self
21 {
22 return new self(self::UNDEFINED);
23 }
24
25 public static function run(): self
26 {
27 return new self(self::RUN);
28 }
29
30 public static function nextStep(): self
31 {
32 return new self(self::NEXT_STEP);
33 }
34
35 public static function pause(): self
36 {
37 return new self(self::PAUSE);
38 }
39
40 public static function stop(): self
41 {
42 return new self(self::STOP);
43 }
44
45 public function is(int $stateId): bool
46 {
47 return $this->stateId === $stateId;
48 }
49
50 public function getId(): int
51 {
52 return $this->stateId;
53 }
54}