| Total Complexity | 6 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | trait CanBuild |
||
| 10 | { |
||
| 11 | protected $build = false; |
||
| 12 | |||
| 13 | protected function checkBuild() |
||
| 14 | { |
||
| 15 | if ($this->isBuild()) { |
||
| 16 | return; |
||
| 17 | } |
||
| 18 | $this->build(); |
||
| 19 | $this->build = true; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @return bool |
||
| 24 | */ |
||
| 25 | public function isBuild(): bool |
||
| 26 | { |
||
| 27 | return $this->build === true; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param bool $build |
||
| 32 | */ |
||
| 33 | public function setBuild(\Closure $build) |
||
| 36 | } |
||
| 37 | |||
| 38 | protected function build() |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |