| Total Complexity | 18 |
| Total Lines | 139 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class ExecutionResult |
||
| 14 | { |
||
| 15 | /** @var string[] */ |
||
| 16 | private $sql = []; |
||
| 17 | |||
| 18 | /** @var mixed[] */ |
||
| 19 | private $params = []; |
||
| 20 | |||
| 21 | /** @var mixed[] */ |
||
| 22 | private $types = []; |
||
| 23 | |||
| 24 | /** @var null|float */ |
||
| 25 | private $time; |
||
| 26 | |||
| 27 | /** @var null|float */ |
||
| 28 | private $memory; |
||
| 29 | |||
| 30 | /** @var bool */ |
||
| 31 | private $skipped = false; |
||
| 32 | |||
| 33 | /** @var bool */ |
||
| 34 | private $error = false; |
||
| 35 | |||
| 36 | /** @var null|Throwable */ |
||
| 37 | private $exception; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string[] $sql |
||
| 41 | * @param mixed[] $params |
||
| 42 | * @param mixed[] $types |
||
| 43 | */ |
||
| 44 | 68 | public function __construct(array $sql = [], array $params = [], array $types = []) |
|
| 45 | { |
||
| 46 | 68 | $this->sql = $sql; |
|
| 47 | 68 | $this->params = $params; |
|
| 48 | 68 | $this->types = $types; |
|
| 49 | 68 | } |
|
| 50 | |||
| 51 | 1 | public function hasSql() : bool |
|
| 52 | { |
||
| 53 | 1 | return count($this->sql) !== 0; |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return string[] |
||
| 58 | */ |
||
| 59 | 38 | public function getSql() : array |
|
| 60 | { |
||
| 61 | 38 | return $this->sql; |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @param string[] $sql |
||
| 66 | */ |
||
| 67 | 52 | public function setSql(array $sql) : void |
|
| 68 | { |
||
| 69 | 52 | $this->sql = $sql; |
|
| 70 | 52 | } |
|
| 71 | |||
| 72 | /** |
||
| 73 | * @return mixed[] |
||
| 74 | */ |
||
| 75 | 12 | public function getParams() : array |
|
| 76 | { |
||
| 77 | 12 | return $this->params; |
|
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @param mixed[] $params |
||
| 82 | */ |
||
| 83 | 52 | public function setParams(array $params) : void |
|
| 84 | { |
||
| 85 | 52 | $this->params = $params; |
|
| 86 | 52 | } |
|
| 87 | |||
| 88 | /** |
||
| 89 | * @return mixed[] |
||
| 90 | */ |
||
| 91 | 3 | public function getTypes() : array |
|
| 92 | { |
||
| 93 | 3 | return $this->types; |
|
| 94 | } |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @param mixed[] $types |
||
| 98 | */ |
||
| 99 | 52 | public function setTypes(array $types) : void |
|
| 100 | { |
||
| 101 | 52 | $this->types = $types; |
|
| 102 | 52 | } |
|
| 103 | |||
| 104 | 29 | public function getTime() : ?float |
|
| 105 | { |
||
| 106 | 29 | return $this->time; |
|
| 107 | } |
||
| 108 | |||
| 109 | 52 | public function setTime(float $time) : void |
|
| 110 | { |
||
| 111 | 52 | $this->time = $time; |
|
| 112 | 52 | } |
|
| 113 | |||
| 114 | 1 | public function getMemory() : ?float |
|
| 115 | { |
||
| 116 | 1 | return $this->memory; |
|
| 117 | } |
||
| 118 | |||
| 119 | 52 | public function setMemory(float $memory) : void |
|
| 120 | { |
||
| 121 | 52 | $this->memory = $memory; |
|
| 122 | 52 | } |
|
| 123 | |||
| 124 | 7 | public function setSkipped(bool $skipped) : void |
|
| 125 | { |
||
| 126 | 7 | $this->skipped = $skipped; |
|
| 127 | 7 | } |
|
| 128 | |||
| 129 | 1 | public function isSkipped() : bool |
|
| 130 | { |
||
| 131 | 1 | return $this->skipped; |
|
| 132 | } |
||
| 133 | |||
| 134 | 3 | public function setError(bool $error) : void |
|
| 137 | 3 | } |
|
| 138 | |||
| 139 | 1 | public function hasError() : bool |
|
| 140 | { |
||
| 141 | 1 | return $this->error; |
|
| 142 | } |
||
| 143 | |||
| 144 | 3 | public function setException(Throwable $exception) : void |
|
| 145 | { |
||
| 146 | 3 | $this->exception = $exception; |
|
| 147 | 3 | } |
|
| 148 | |||
| 149 | 1 | public function getException() : ?Throwable |
|
| 152 | } |
||
| 153 | } |
||
| 154 |