| Total Complexity | 4 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | trait DialogLibraryTrait |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * The dialog library helper |
||
| 22 | * |
||
| 23 | * @var DialogLibraryHelper |
||
| 24 | */ |
||
| 25 | protected $xHelper; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var Response |
||
| 29 | */ |
||
| 30 | protected $xResponse = null; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * For MessageInterface, tells if the calls to the functions shall |
||
| 34 | * add commands to the response or return the js code. By default, they add commands. |
||
| 35 | * |
||
| 36 | * @var bool |
||
| 37 | */ |
||
| 38 | protected $bReturnCode = false; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Set the response to attach the messages to. |
||
| 42 | * |
||
| 43 | * @param Response $xResponse Whether to return the code |
||
| 44 | * |
||
| 45 | * @return void |
||
| 46 | */ |
||
| 47 | final public function setResponse(Response $xResponse) |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the <Jaxon\Response\Response> object |
||
| 54 | * |
||
| 55 | * @return Response |
||
| 56 | */ |
||
| 57 | final protected function response(): Response |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param bool $bReturnCode |
||
| 64 | * |
||
| 65 | * @return MessageInterface |
||
| 66 | */ |
||
| 67 | final public function setReturnCode(bool $bReturnCode): MessageInterface |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Check if the library should return the js code or run it in the browser. |
||
| 75 | * |
||
| 76 | * @return bool |
||
| 77 | */ |
||
| 78 | final protected function returnCode(): bool |
||
| 83 |