| Total Complexity | 6 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait CommandTrait |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * The commands that will be sent to the browser in the response |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $aCommands = []; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Get the commands in the response |
||
| 21 | * |
||
| 22 | * @return array |
||
| 23 | */ |
||
| 24 | public function getCommands(): array |
||
| 25 | { |
||
| 26 | return $this->aCommands; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Get the number of commands in the response |
||
| 31 | * |
||
| 32 | * @return int |
||
| 33 | */ |
||
| 34 | public function getCommandCount(): int |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Clear all the commands already added to the response |
||
| 41 | * |
||
| 42 | * @return void |
||
| 43 | */ |
||
| 44 | public function clearCommands() |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Merge the commands with those in this <Response> object |
||
| 51 | * |
||
| 52 | * @param array $aCommands The commands to merge |
||
| 53 | * @param bool $bBefore Add the new commands to the beginning of the list |
||
| 54 | * |
||
| 55 | * @return void |
||
| 56 | */ |
||
| 57 | public function appendCommands(array $aCommands, bool $bBefore = false) |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Merge the response commands with those in this <Response> object |
||
| 66 | * |
||
| 67 | * @param ResponseInterface $xResponse The <Response> object |
||
| 68 | * @param bool $bBefore Add the new commands to the beginning of the list |
||
| 69 | * |
||
| 70 | * @return void |
||
| 71 | */ |
||
| 72 | public function appendResponse(ResponseInterface $xResponse, bool $bBefore = false) |
||
| 77 |