| Total Complexity | 4 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | trait LibraryTrait |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var Response |
||
| 21 | */ |
||
| 22 | protected $xResponse = null; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var bool |
||
| 26 | */ |
||
| 27 | protected $bReturn = false; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Set the response to attach the messages to. |
||
| 31 | * |
||
| 32 | * @param Response $xResponse Whether to return the code |
||
| 33 | * |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | public function setResponse(Response $xResponse) |
||
| 37 | { |
||
| 38 | $this->xResponse = $xResponse; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get the <Jaxon\Response\Response> object |
||
| 43 | * |
||
| 44 | * @return Response |
||
| 45 | */ |
||
| 46 | final public function response(): Response |
||
| 47 | { |
||
| 48 | return $this->xResponse; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Set the library to return the javascript code or run it in the browser. |
||
| 53 | * |
||
| 54 | * @param bool $bReturn Whether to return the code |
||
| 55 | * |
||
| 56 | * @return void |
||
| 57 | */ |
||
| 58 | public function setReturn(bool $bReturn) |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Check if the library should return the js code or run it in the browser. |
||
| 65 | * |
||
| 66 | * @return bool |
||
| 67 | */ |
||
| 68 | public function getReturn(): bool |
||
| 71 | } |
||
| 72 | } |
||
| 73 |