@@ -4,23 +4,23 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | interface SessionInterface |
| 6 | 6 | { |
| 7 | - /** |
|
| 7 | +/** |
|
| 8 | 8 | * Get the current session id |
| 9 | 9 | * |
| 10 | 10 | * @return string |
| 11 | 11 | */ |
| 12 | - public function getId(): string; |
|
| 12 | +public function getId(): string; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 14 | +/** |
|
| 15 | 15 | * Generate a new session id |
| 16 | 16 | * |
| 17 | 17 | * @param bool $bDeleteData Whether to delete data from the previous session |
| 18 | 18 | * |
| 19 | 19 | * @return void |
| 20 | 20 | */ |
| 21 | - public function newId(bool $bDeleteData = false): void; |
|
| 21 | +public function newId(bool $bDeleteData = false): void; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 23 | +/** |
|
| 24 | 24 | * Save data in the session |
| 25 | 25 | * |
| 26 | 26 | * @param string $sKey The session key |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @return void |
| 30 | 30 | */ |
| 31 | - public function set(string $sKey, mixed $xValue): void; |
|
| 31 | +public function set(string $sKey, mixed $xValue): void; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 33 | +/** |
|
| 34 | 34 | * Save data in the session, that will be available only until the next call |
| 35 | 35 | * |
| 36 | 36 | * @param string $sKey The session key |
@@ -38,18 +38,18 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @return void |
| 40 | 40 | */ |
| 41 | - // public function flash(string $sKey, $xValue); |
|
| 41 | +// public function flash(string $sKey, $xValue); |
|
| 42 | 42 | |
| 43 | - /** |
|
| 43 | +/** |
|
| 44 | 44 | * Check if a session key exists |
| 45 | 45 | * |
| 46 | 46 | * @param string $sKey The session key |
| 47 | 47 | * |
| 48 | 48 | * @return bool |
| 49 | 49 | */ |
| 50 | - public function has(string $sKey): bool; |
|
| 50 | +public function has(string $sKey): bool; |
|
| 51 | 51 | |
| 52 | - /** |
|
| 52 | +/** |
|
| 53 | 53 | * Get data from the session |
| 54 | 54 | * |
| 55 | 55 | * @param string $sKey The session key |
@@ -57,28 +57,28 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @return mixed |
| 59 | 59 | */ |
| 60 | - public function get(string $sKey, mixed $xDefault = null): mixed; |
|
| 60 | +public function get(string $sKey, mixed $xDefault = null): mixed; |
|
| 61 | 61 | |
| 62 | - /** |
|
| 62 | +/** |
|
| 63 | 63 | * Get all data in the session |
| 64 | 64 | * |
| 65 | 65 | * @return array |
| 66 | 66 | */ |
| 67 | - public function all(): array; |
|
| 67 | +public function all(): array; |
|
| 68 | 68 | |
| 69 | - /** |
|
| 69 | +/** |
|
| 70 | 70 | * Delete a session key and its data |
| 71 | 71 | * |
| 72 | 72 | * @param string $sKey The session key |
| 73 | 73 | * |
| 74 | 74 | * @return void |
| 75 | 75 | */ |
| 76 | - public function delete(string $sKey): void; |
|
| 76 | +public function delete(string $sKey): void; |
|
| 77 | 77 | |
| 78 | - /** |
|
| 78 | +/** |
|
| 79 | 79 | * Delete all data in the session |
| 80 | 80 | * |
| 81 | 81 | * @return void |
| 82 | 82 | */ |
| 83 | - public function clear(): void; |
|
| 83 | +public function clear(): void; |
|
| 84 | 84 | } |
@@ -31,81 +31,81 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | trait ServicesTrait |
| 33 | 33 | { |
| 34 | - use DiTrait; |
|
| 34 | +use DiTrait; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 36 | +/** |
|
| 37 | 37 | * @return Translator |
| 38 | 38 | */ |
| 39 | - public function translator(): Translator |
|
| 40 | - { |
|
| 41 | - return $this->di()->g(Translator::class); |
|
| 42 | - } |
|
| 39 | +public function translator(): Translator |
|
| 40 | +{ |
|
| 41 | +return $this->di()->g(Translator::class); |
|
| 42 | +} |
|
| 43 | 43 | |
| 44 | - /** |
|
| 44 | +/** |
|
| 45 | 45 | * @return LoggerInterface |
| 46 | 46 | */ |
| 47 | - public function logger(): LoggerInterface |
|
| 48 | - { |
|
| 49 | - return $this->di()->getLogger(); |
|
| 50 | - } |
|
| 47 | +public function logger(): LoggerInterface |
|
| 48 | +{ |
|
| 49 | +return $this->di()->getLogger(); |
|
| 50 | +} |
|
| 51 | 51 | |
| 52 | - /** |
|
| 52 | +/** |
|
| 53 | 53 | * @return Bootstrap |
| 54 | 54 | */ |
| 55 | - protected function getBootstrap(): Bootstrap |
|
| 56 | - { |
|
| 57 | - return $this->di()->getBootstrap(); |
|
| 58 | - } |
|
| 55 | +protected function getBootstrap(): Bootstrap |
|
| 56 | +{ |
|
| 57 | +return $this->di()->getBootstrap(); |
|
| 58 | +} |
|
| 59 | 59 | |
| 60 | - /** |
|
| 60 | +/** |
|
| 61 | 61 | * @return PluginManager |
| 62 | 62 | */ |
| 63 | - protected function getPluginManager(): PluginManager |
|
| 64 | - { |
|
| 65 | - return $this->di()->getPluginManager(); |
|
| 66 | - } |
|
| 63 | +protected function getPluginManager(): PluginManager |
|
| 64 | +{ |
|
| 65 | +return $this->di()->getPluginManager(); |
|
| 66 | +} |
|
| 67 | 67 | |
| 68 | - /** |
|
| 68 | +/** |
|
| 69 | 69 | * @return CallbackManager |
| 70 | 70 | */ |
| 71 | - protected function getCallbackManager(): CallbackManager |
|
| 72 | - { |
|
| 73 | - return $this->di()->getCallbackManager(); |
|
| 74 | - } |
|
| 71 | +protected function getCallbackManager(): CallbackManager |
|
| 72 | +{ |
|
| 73 | +return $this->di()->getCallbackManager(); |
|
| 74 | +} |
|
| 75 | 75 | |
| 76 | - /** |
|
| 76 | +/** |
|
| 77 | 77 | * @return RequestHandler |
| 78 | 78 | */ |
| 79 | - protected function getRequestHandler(): RequestHandler |
|
| 80 | - { |
|
| 81 | - return $this->di()->getRequestHandler(); |
|
| 82 | - } |
|
| 79 | +protected function getRequestHandler(): RequestHandler |
|
| 80 | +{ |
|
| 81 | +return $this->di()->getRequestHandler(); |
|
| 82 | +} |
|
| 83 | 83 | |
| 84 | - /** |
|
| 84 | +/** |
|
| 85 | 85 | * @return ResponseManager |
| 86 | 86 | */ |
| 87 | - protected function getResponseManager(): ResponseManager |
|
| 88 | - { |
|
| 89 | - return $this->di()->getResponseManager(); |
|
| 90 | - } |
|
| 87 | +protected function getResponseManager(): ResponseManager |
|
| 88 | +{ |
|
| 89 | +return $this->di()->getResponseManager(); |
|
| 90 | +} |
|
| 91 | 91 | |
| 92 | - /** |
|
| 92 | +/** |
|
| 93 | 93 | * @return PackageManager |
| 94 | 94 | */ |
| 95 | - protected function getPackageManager(): PackageManager |
|
| 96 | - { |
|
| 97 | - return $this->di()->getPackageManager(); |
|
| 98 | - } |
|
| 95 | +protected function getPackageManager(): PackageManager |
|
| 96 | +{ |
|
| 97 | +return $this->di()->getPackageManager(); |
|
| 98 | +} |
|
| 99 | 99 | |
| 100 | - /** |
|
| 100 | +/** |
|
| 101 | 101 | * @return CodeGenerator |
| 102 | 102 | */ |
| 103 | - protected function getCodeGenerator(): CodeGenerator |
|
| 104 | - { |
|
| 105 | - return $this->di()->getCodeGenerator(); |
|
| 106 | - } |
|
| 103 | +protected function getCodeGenerator(): CodeGenerator |
|
| 104 | +{ |
|
| 105 | +return $this->di()->getCodeGenerator(); |
|
| 106 | +} |
|
| 107 | 107 | |
| 108 | - /** |
|
| 108 | +/** |
|
| 109 | 109 | * Add a view renderer with an id |
| 110 | 110 | * |
| 111 | 111 | * @param string $sRenderer The renderer name |
@@ -114,70 +114,70 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @return void |
| 116 | 116 | */ |
| 117 | - public function addViewRenderer(string $sRenderer, string $sExtension, Closure $xClosure): void |
|
| 118 | - { |
|
| 119 | - $this->view()->setDefaultRenderer($sRenderer, $sExtension, $xClosure); |
|
| 120 | - } |
|
| 117 | +public function addViewRenderer(string $sRenderer, string $sExtension, Closure $xClosure): void |
|
| 118 | +{ |
|
| 119 | +$this->view()->setDefaultRenderer($sRenderer, $sExtension, $xClosure); |
|
| 120 | +} |
|
| 121 | 121 | |
| 122 | - /** |
|
| 122 | +/** |
|
| 123 | 123 | * @param LoggerInterface|Closure $xLogger |
| 124 | 124 | * |
| 125 | 125 | * @return void |
| 126 | 126 | */ |
| 127 | - public function setLogger(LoggerInterface|Closure $xLogger): void |
|
| 128 | - { |
|
| 129 | - $this->di()->setLogger($xLogger); |
|
| 130 | - } |
|
| 127 | +public function setLogger(LoggerInterface|Closure $xLogger): void |
|
| 128 | +{ |
|
| 129 | +$this->di()->setLogger($xLogger); |
|
| 130 | +} |
|
| 131 | 131 | |
| 132 | - /** |
|
| 132 | +/** |
|
| 133 | 133 | * Set the session manager |
| 134 | 134 | * |
| 135 | 135 | * @param Closure $xClosure A closure to create the session manager instance |
| 136 | 136 | * |
| 137 | 137 | * @return void |
| 138 | 138 | */ |
| 139 | - public function setSessionManager(Closure $xClosure): void |
|
| 140 | - { |
|
| 141 | - $this->di()->setSessionManager($xClosure); |
|
| 142 | - } |
|
| 139 | +public function setSessionManager(Closure $xClosure): void |
|
| 140 | +{ |
|
| 141 | +$this->di()->setSessionManager($xClosure); |
|
| 142 | +} |
|
| 143 | 143 | |
| 144 | - /** |
|
| 144 | +/** |
|
| 145 | 145 | * @return UploadHandlerInterface|null |
| 146 | 146 | */ |
| 147 | - public function upload(): ?UploadHandlerInterface |
|
| 148 | - { |
|
| 149 | - return $this->di()->getUploadHandler(); |
|
| 150 | - } |
|
| 147 | +public function upload(): ?UploadHandlerInterface |
|
| 148 | +{ |
|
| 149 | +return $this->di()->getUploadHandler(); |
|
| 150 | +} |
|
| 151 | 151 | |
| 152 | - /** |
|
| 152 | +/** |
|
| 153 | 153 | * @return PsrFactory |
| 154 | 154 | */ |
| 155 | - public function psr(): PsrFactory |
|
| 156 | - { |
|
| 157 | - return $this->di()->getPsrFactory(); |
|
| 158 | - } |
|
| 155 | +public function psr(): PsrFactory |
|
| 156 | +{ |
|
| 157 | +return $this->di()->getPsrFactory(); |
|
| 158 | +} |
|
| 159 | 159 | |
| 160 | - /** |
|
| 160 | +/** |
|
| 161 | 161 | * @return TemplateEngine |
| 162 | 162 | */ |
| 163 | - public function template(): TemplateEngine |
|
| 164 | - { |
|
| 165 | - return $this->di()->getTemplateEngine(); |
|
| 166 | - } |
|
| 163 | +public function template(): TemplateEngine |
|
| 164 | +{ |
|
| 165 | +return $this->di()->getTemplateEngine(); |
|
| 166 | +} |
|
| 167 | 167 | |
| 168 | - /** |
|
| 168 | +/** |
|
| 169 | 169 | * @return ViewRenderer |
| 170 | 170 | */ |
| 171 | - public function view(): ViewRenderer |
|
| 172 | - { |
|
| 173 | - return $this->di()->getViewRenderer(); |
|
| 174 | - } |
|
| 171 | +public function view(): ViewRenderer |
|
| 172 | +{ |
|
| 173 | +return $this->di()->getViewRenderer(); |
|
| 174 | +} |
|
| 175 | 175 | |
| 176 | - /** |
|
| 176 | +/** |
|
| 177 | 177 | * @return SessionInterface|null |
| 178 | 178 | */ |
| 179 | - public function session(): ?SessionInterface |
|
| 180 | - { |
|
| 181 | - return $this->di()->getSessionManager(); |
|
| 182 | - } |
|
| 179 | +public function session(): ?SessionInterface |
|
| 180 | +{ |
|
| 181 | +return $this->di()->getSessionManager(); |
|
| 182 | +} |
|
| 183 | 183 | } |
@@ -23,58 +23,58 @@ |
||
| 23 | 23 | |
| 24 | 24 | trait ResponseTrait |
| 25 | 25 | { |
| 26 | - /** |
|
| 26 | +/** |
|
| 27 | 27 | * @return ResponseManager |
| 28 | 28 | */ |
| 29 | - abstract public function getResponseManager(): ResponseManager; |
|
| 29 | +abstract public function getResponseManager(): ResponseManager; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 31 | +/** |
|
| 32 | 32 | * Get the global Response object |
| 33 | 33 | * |
| 34 | 34 | * @return Response |
| 35 | 35 | */ |
| 36 | - public function getResponse(): Response |
|
| 37 | - { |
|
| 38 | - return $this->getResponseManager()->getResponse(); |
|
| 39 | - } |
|
| 36 | +public function getResponse(): Response |
|
| 37 | +{ |
|
| 38 | +return $this->getResponseManager()->getResponse(); |
|
| 39 | +} |
|
| 40 | 40 | |
| 41 | - /** |
|
| 41 | +/** |
|
| 42 | 42 | * Create a new Jaxon response object |
| 43 | 43 | * |
| 44 | 44 | * @return Response |
| 45 | 45 | */ |
| 46 | - public function newResponse(): Response |
|
| 47 | - { |
|
| 48 | - return $this->getResponseManager()->newResponse(); |
|
| 49 | - } |
|
| 46 | +public function newResponse(): Response |
|
| 47 | +{ |
|
| 48 | +return $this->getResponseManager()->newResponse(); |
|
| 49 | +} |
|
| 50 | 50 | |
| 51 | - /** |
|
| 51 | +/** |
|
| 52 | 52 | * Get the Jaxon ajax response |
| 53 | 53 | * |
| 54 | 54 | * @return AjaxResponse |
| 55 | 55 | */ |
| 56 | - public function ajaxResponse(): AjaxResponse |
|
| 57 | - { |
|
| 58 | - return $this->getResponseManager()->ajaxResponse(); |
|
| 59 | - } |
|
| 56 | +public function ajaxResponse(): AjaxResponse |
|
| 57 | +{ |
|
| 58 | +return $this->getResponseManager()->ajaxResponse(); |
|
| 59 | +} |
|
| 60 | 60 | |
| 61 | - /** |
|
| 61 | +/** |
|
| 62 | 62 | * Get the configured character encoding |
| 63 | 63 | * |
| 64 | 64 | * @return string |
| 65 | 65 | */ |
| 66 | - public function getCharacterEncoding(): string |
|
| 67 | - { |
|
| 68 | - return $this->getResponseManager()->getCharacterEncoding(); |
|
| 69 | - } |
|
| 66 | +public function getCharacterEncoding(): string |
|
| 67 | +{ |
|
| 68 | +return $this->getResponseManager()->getCharacterEncoding(); |
|
| 69 | +} |
|
| 70 | 70 | |
| 71 | - /** |
|
| 71 | +/** |
|
| 72 | 72 | * Get the content type of the HTTP response |
| 73 | 73 | * |
| 74 | 74 | * @return string |
| 75 | 75 | */ |
| 76 | - public function getContentType(): string |
|
| 77 | - { |
|
| 78 | - return $this->getResponseManager()->getContentType(); |
|
| 79 | - } |
|
| 76 | +public function getContentType(): string |
|
| 77 | +{ |
|
| 78 | +return $this->getResponseManager()->getContentType(); |
|
| 79 | +} |
|
| 80 | 80 | } |
@@ -22,31 +22,31 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | trait RequestTrait |
| 24 | 24 | { |
| 25 | - /** |
|
| 25 | +/** |
|
| 26 | 26 | * @return RequestHandler |
| 27 | 27 | */ |
| 28 | - abstract protected function getRequestHandler(): RequestHandler; |
|
| 28 | +abstract protected function getRequestHandler(): RequestHandler; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 30 | +/** |
|
| 31 | 31 | * Get the HTTP response |
| 32 | 32 | * |
| 33 | 33 | * @param string $sCode The HTTP response code |
| 34 | 34 | * |
| 35 | 35 | * @return mixed |
| 36 | 36 | */ |
| 37 | - abstract public function httpResponse(string $sCode = '200'): mixed; |
|
| 37 | +abstract public function httpResponse(string $sCode = '200'): mixed; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 39 | +/** |
|
| 40 | 40 | * Determine if a call is a jaxon request |
| 41 | 41 | * |
| 42 | 42 | * @return bool |
| 43 | 43 | */ |
| 44 | - public function canProcessRequest(): bool |
|
| 45 | - { |
|
| 46 | - return $this->getRequestHandler()->canProcessRequest(); |
|
| 47 | - } |
|
| 44 | +public function canProcessRequest(): bool |
|
| 45 | +{ |
|
| 46 | +return $this->getRequestHandler()->canProcessRequest(); |
|
| 47 | +} |
|
| 48 | 48 | |
| 49 | - /** |
|
| 49 | +/** |
|
| 50 | 50 | * If this is a jaxon request, call the requested PHP function, build the response and send it back to the browser |
| 51 | 51 | * |
| 52 | 52 | * This is the main server side engine for Jaxon. |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | * @throws RequestException |
| 62 | 62 | * @see <canProcessRequest> |
| 63 | 63 | */ |
| 64 | - public function processRequest(): mixed |
|
| 65 | - { |
|
| 66 | - // Process the jaxon request |
|
| 67 | - $this->getRequestHandler()->processRequest(); |
|
| 64 | +public function processRequest(): mixed |
|
| 65 | +{ |
|
| 66 | +// Process the jaxon request |
|
| 67 | +$this->getRequestHandler()->processRequest(); |
|
| 68 | 68 | |
| 69 | - return $this->httpResponse(); |
|
| 70 | - } |
|
| 69 | +return $this->httpResponse(); |
|
| 70 | +} |
|
| 71 | 71 | } |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | trait ConfigTrait |
| 20 | 20 | { |
| 21 | - /** |
|
| 21 | +/** |
|
| 22 | 22 | * @return ConfigManager |
| 23 | 23 | */ |
| 24 | - abstract public function config(): ConfigManager; |
|
| 24 | +abstract public function config(): ConfigManager; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 26 | +/** |
|
| 27 | 27 | * Set the values of an array of config options |
| 28 | 28 | * |
| 29 | 29 | * @param array $aOptions The options values to be set |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @return bool |
| 33 | 33 | */ |
| 34 | - public function setOptions(array $aOptions, string $sNamePrefix = ''): bool |
|
| 35 | - { |
|
| 36 | - return $this->config()->setOptions($aOptions, $sNamePrefix); |
|
| 37 | - } |
|
| 34 | +public function setOptions(array $aOptions, string $sNamePrefix = ''): bool |
|
| 35 | +{ |
|
| 36 | +return $this->config()->setOptions($aOptions, $sNamePrefix); |
|
| 37 | +} |
|
| 38 | 38 | |
| 39 | - /** |
|
| 39 | +/** |
|
| 40 | 40 | * Set the value of a config option |
| 41 | 41 | * |
| 42 | 42 | * @param string $sName The option name |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return void |
| 46 | 46 | */ |
| 47 | - public function setOption(string $sName, $sValue) |
|
| 48 | - { |
|
| 49 | - $this->config()->setOption($sName, $sValue); |
|
| 50 | - } |
|
| 47 | +public function setOption(string $sName, $sValue) |
|
| 48 | +{ |
|
| 49 | +$this->config()->setOption($sName, $sValue); |
|
| 50 | +} |
|
| 51 | 51 | |
| 52 | - /** |
|
| 52 | +/** |
|
| 53 | 53 | * Get the value of a config option |
| 54 | 54 | * |
| 55 | 55 | * @param string $sName The option name |
@@ -57,24 +57,24 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @return mixed |
| 59 | 59 | */ |
| 60 | - public function getOption(string $sName, $xDefault = null) |
|
| 61 | - { |
|
| 62 | - return $this->config()->getOption($sName, $xDefault); |
|
| 63 | - } |
|
| 60 | +public function getOption(string $sName, $xDefault = null) |
|
| 61 | +{ |
|
| 62 | +return $this->config()->getOption($sName, $xDefault); |
|
| 63 | +} |
|
| 64 | 64 | |
| 65 | - /** |
|
| 65 | +/** |
|
| 66 | 66 | * Check the presence of a config option |
| 67 | 67 | * |
| 68 | 68 | * @param string $sName The option name |
| 69 | 69 | * |
| 70 | 70 | * @return bool |
| 71 | 71 | */ |
| 72 | - public function hasOption(string $sName): bool |
|
| 73 | - { |
|
| 74 | - return $this->config()->hasOption($sName); |
|
| 75 | - } |
|
| 72 | +public function hasOption(string $sName): bool |
|
| 73 | +{ |
|
| 74 | +return $this->config()->hasOption($sName); |
|
| 75 | +} |
|
| 76 | 76 | |
| 77 | - /** |
|
| 77 | +/** |
|
| 78 | 78 | * Set the values of an array of config options |
| 79 | 79 | * |
| 80 | 80 | * @param array $aOptions The options values to be set |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | * |
| 83 | 83 | * @return bool |
| 84 | 84 | */ |
| 85 | - public function setAppOptions(array $aOptions, string $sNamePrefix = ''): bool |
|
| 86 | - { |
|
| 87 | - return $this->config()->setAppOptions($aOptions, $sNamePrefix); |
|
| 88 | - } |
|
| 85 | +public function setAppOptions(array $aOptions, string $sNamePrefix = ''): bool |
|
| 86 | +{ |
|
| 87 | +return $this->config()->setAppOptions($aOptions, $sNamePrefix); |
|
| 88 | +} |
|
| 89 | 89 | |
| 90 | - /** |
|
| 90 | +/** |
|
| 91 | 91 | * Set the value of a config option |
| 92 | 92 | * |
| 93 | 93 | * @param string $sName The option name |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | * |
| 96 | 96 | * @return void |
| 97 | 97 | */ |
| 98 | - public function setAppOption(string $sName, $sValue) |
|
| 99 | - { |
|
| 100 | - $this->config()->setAppOption($sName, $sValue); |
|
| 101 | - } |
|
| 98 | +public function setAppOption(string $sName, $sValue) |
|
| 99 | +{ |
|
| 100 | +$this->config()->setAppOption($sName, $sValue); |
|
| 101 | +} |
|
| 102 | 102 | |
| 103 | - /** |
|
| 103 | +/** |
|
| 104 | 104 | * Get the value of a config option |
| 105 | 105 | * |
| 106 | 106 | * @param string $sName The option name |
@@ -108,20 +108,20 @@ discard block |
||
| 108 | 108 | * |
| 109 | 109 | * @return mixed |
| 110 | 110 | */ |
| 111 | - public function getAppOption(string $sName, $xDefault = null) |
|
| 112 | - { |
|
| 113 | - return $this->config()->getAppOption($sName, $xDefault); |
|
| 114 | - } |
|
| 111 | +public function getAppOption(string $sName, $xDefault = null) |
|
| 112 | +{ |
|
| 113 | +return $this->config()->getAppOption($sName, $xDefault); |
|
| 114 | +} |
|
| 115 | 115 | |
| 116 | - /** |
|
| 116 | +/** |
|
| 117 | 117 | * Check the presence of a config option |
| 118 | 118 | * |
| 119 | 119 | * @param string $sName The option name |
| 120 | 120 | * |
| 121 | 121 | * @return bool |
| 122 | 122 | */ |
| 123 | - public function hasAppOption(string $sName): bool |
|
| 124 | - { |
|
| 125 | - return $this->config()->hasAppOption($sName); |
|
| 126 | - } |
|
| 123 | +public function hasAppOption(string $sName): bool |
|
| 124 | +{ |
|
| 125 | +return $this->config()->hasAppOption($sName); |
|
| 126 | +} |
|
| 127 | 127 | } |
@@ -28,27 +28,27 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | trait PluginTrait |
| 30 | 30 | { |
| 31 | - /** |
|
| 31 | +/** |
|
| 32 | 32 | * @return PluginManager |
| 33 | 33 | */ |
| 34 | - abstract public function getPluginManager(): PluginManager; |
|
| 34 | +abstract public function getPluginManager(): PluginManager; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 36 | +/** |
|
| 37 | 37 | * @return PackageManager |
| 38 | 38 | */ |
| 39 | - abstract public function getPackageManager(): PackageManager; |
|
| 39 | +abstract public function getPackageManager(): PackageManager; |
|
| 40 | 40 | |
| 41 | - /** |
|
| 41 | +/** |
|
| 42 | 42 | * @return CodeGenerator |
| 43 | 43 | */ |
| 44 | - abstract public function getCodeGenerator(): CodeGenerator; |
|
| 44 | +abstract public function getCodeGenerator(): CodeGenerator; |
|
| 45 | 45 | |
| 46 | - /** |
|
| 46 | +/** |
|
| 47 | 47 | * @return Bootstrap |
| 48 | 48 | */ |
| 49 | - abstract protected function getBootstrap(): Bootstrap; |
|
| 49 | +abstract protected function getBootstrap(): Bootstrap; |
|
| 50 | 50 | |
| 51 | - /** |
|
| 51 | +/** |
|
| 52 | 52 | * Register request handlers, including functions, callable classes and directories. |
| 53 | 53 | * |
| 54 | 54 | * @param string $sType The type of request handler being registered |
@@ -65,14 +65,14 @@ discard block |
||
| 65 | 65 | * @return void |
| 66 | 66 | * @throws SetupException |
| 67 | 67 | */ |
| 68 | - public function register(string $sType, string $sName, $xOptions = []): void |
|
| 69 | - { |
|
| 70 | - // We need the library to have been bootstrapped. |
|
| 71 | - $this->getBootstrap()->onBoot(); |
|
| 72 | - $this->getPluginManager()->registerCallable($sType, $sName, $xOptions); |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - /** |
|
| 68 | +public function register(string $sType, string $sName, $xOptions = []): void |
|
| 69 | +{ |
|
| 70 | +// We need the library to have been bootstrapped. |
|
| 71 | +$this->getBootstrap()->onBoot(); |
|
| 72 | +$this->getPluginManager()->registerCallable($sType, $sName, $xOptions); |
|
| 73 | +} |
|
| 74 | + |
|
| 75 | +/** |
|
| 76 | 76 | * Register a plugin |
| 77 | 77 | * |
| 78 | 78 | * Below is a table for priorities and their description: |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | * @return void |
| 88 | 88 | * @throws SetupException |
| 89 | 89 | */ |
| 90 | - public function registerPlugin(string $sClassName, string $sPluginName, int $nPriority = 1000) |
|
| 91 | - { |
|
| 92 | - // We need the library to have been bootstrapped. |
|
| 93 | - $this->getBootstrap()->onBoot(); |
|
| 94 | - $this->getPluginManager()->registerPlugin($sClassName, $sPluginName, $nPriority); |
|
| 95 | - } |
|
| 96 | - |
|
| 97 | - /** |
|
| 90 | +public function registerPlugin(string $sClassName, string $sPluginName, int $nPriority = 1000) |
|
| 91 | +{ |
|
| 92 | +// We need the library to have been bootstrapped. |
|
| 93 | +$this->getBootstrap()->onBoot(); |
|
| 94 | +$this->getPluginManager()->registerPlugin($sClassName, $sPluginName, $nPriority); |
|
| 95 | +} |
|
| 96 | + |
|
| 97 | +/** |
|
| 98 | 98 | * Register a package |
| 99 | 99 | * |
| 100 | 100 | * @param string $sClassName The package class |
@@ -103,14 +103,14 @@ discard block |
||
| 103 | 103 | * @return void |
| 104 | 104 | * @throws SetupException |
| 105 | 105 | */ |
| 106 | - public function registerPackage(string $sClassName, array $xPkgOptions = []) |
|
| 107 | - { |
|
| 108 | - // We need the library to have been bootstrapped. |
|
| 109 | - $this->getBootstrap()->onBoot(); |
|
| 110 | - $this->getPackageManager()->registerPackage($sClassName, $xPkgOptions); |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 106 | +public function registerPackage(string $sClassName, array $xPkgOptions = []) |
|
| 107 | +{ |
|
| 108 | +// We need the library to have been bootstrapped. |
|
| 109 | +$this->getBootstrap()->onBoot(); |
|
| 110 | +$this->getPackageManager()->registerPackage($sClassName, $xPkgOptions); |
|
| 111 | +} |
|
| 112 | + |
|
| 113 | +/** |
|
| 114 | 114 | * Find a response plugin by name or class name |
| 115 | 115 | * |
| 116 | 116 | * @template R of ResponsePluginInterface |
@@ -118,12 +118,12 @@ discard block |
||
| 118 | 118 | * |
| 119 | 119 | * @return ($sName is class-string ? R : ResponsePluginInterface)|null |
| 120 | 120 | */ |
| 121 | - public function plugin(string $sName): ?ResponsePluginInterface |
|
| 122 | - { |
|
| 123 | - return $this->getPluginManager()->getResponsePlugin($sName); |
|
| 124 | - } |
|
| 121 | +public function plugin(string $sName): ?ResponsePluginInterface |
|
| 122 | +{ |
|
| 123 | +return $this->getPluginManager()->getResponsePlugin($sName); |
|
| 124 | +} |
|
| 125 | 125 | |
| 126 | - /** |
|
| 126 | +/** |
|
| 127 | 127 | * Get a package instance |
| 128 | 128 | * |
| 129 | 129 | * @template P of AbstractPackage |
@@ -131,52 +131,52 @@ discard block |
||
| 131 | 131 | * |
| 132 | 132 | * @return P|null |
| 133 | 133 | */ |
| 134 | - public function package(string $sClassName): ?AbstractPackage |
|
| 135 | - { |
|
| 136 | - return $this->getPackageManager()->getPackage($sClassName); |
|
| 137 | - } |
|
| 134 | +public function package(string $sClassName): ?AbstractPackage |
|
| 135 | +{ |
|
| 136 | +return $this->getPackageManager()->getPackage($sClassName); |
|
| 137 | +} |
|
| 138 | 138 | |
| 139 | - /** |
|
| 139 | +/** |
|
| 140 | 140 | * Get the HTML tags to include Jaxon javascript files into the page. |
| 141 | 141 | * |
| 142 | 142 | * @return string |
| 143 | 143 | */ |
| 144 | - public function getJs(): string |
|
| 145 | - { |
|
| 146 | - return $this->getCodeGenerator()->getJs(); |
|
| 147 | - } |
|
| 144 | +public function getJs(): string |
|
| 145 | +{ |
|
| 146 | +return $this->getCodeGenerator()->getJs(); |
|
| 147 | +} |
|
| 148 | 148 | |
| 149 | - /** |
|
| 149 | +/** |
|
| 150 | 150 | * Get the HTML tags to include Jaxon javascript files into the page. |
| 151 | 151 | * |
| 152 | 152 | * @return string the javascript code |
| 153 | 153 | */ |
| 154 | - public function js(): string |
|
| 155 | - { |
|
| 156 | - return $this->getCodeGenerator()->getJs(); |
|
| 157 | - } |
|
| 154 | +public function js(): string |
|
| 155 | +{ |
|
| 156 | +return $this->getCodeGenerator()->getJs(); |
|
| 157 | +} |
|
| 158 | 158 | |
| 159 | - /** |
|
| 159 | +/** |
|
| 160 | 160 | * Get the HTML tags to include Jaxon CSS code and files into the page. |
| 161 | 161 | * |
| 162 | 162 | * @return string |
| 163 | 163 | */ |
| 164 | - public function getCss(): string |
|
| 165 | - { |
|
| 166 | - return $this->getCodeGenerator()->getCss(); |
|
| 167 | - } |
|
| 164 | +public function getCss(): string |
|
| 165 | +{ |
|
| 166 | +return $this->getCodeGenerator()->getCss(); |
|
| 167 | +} |
|
| 168 | 168 | |
| 169 | - /** |
|
| 169 | +/** |
|
| 170 | 170 | * Get the HTML tags to include Jaxon CSS code and files into the page. |
| 171 | 171 | * |
| 172 | 172 | * @return string |
| 173 | 173 | */ |
| 174 | - public function css(): string |
|
| 175 | - { |
|
| 176 | - return $this->getCodeGenerator()->getCss(); |
|
| 177 | - } |
|
| 174 | +public function css(): string |
|
| 175 | +{ |
|
| 176 | +return $this->getCodeGenerator()->getCss(); |
|
| 177 | +} |
|
| 178 | 178 | |
| 179 | - /** |
|
| 179 | +/** |
|
| 180 | 180 | * Returns the js header and wrapper code to be printed into the page |
| 181 | 181 | * |
| 182 | 182 | * The javascript code returned by this function depends on the plugins |
@@ -188,12 +188,12 @@ discard block |
||
| 188 | 188 | * @return string |
| 189 | 189 | * @throws UriException |
| 190 | 190 | */ |
| 191 | - public function getScript(bool $bIncludeJs = false, bool $bIncludeCss = false): string |
|
| 192 | - { |
|
| 193 | - return $this->getCodeGenerator()->getScript($bIncludeJs, $bIncludeCss); |
|
| 194 | - } |
|
| 191 | +public function getScript(bool $bIncludeJs = false, bool $bIncludeCss = false): string |
|
| 192 | +{ |
|
| 193 | +return $this->getCodeGenerator()->getScript($bIncludeJs, $bIncludeCss); |
|
| 194 | +} |
|
| 195 | 195 | |
| 196 | - /** |
|
| 196 | +/** |
|
| 197 | 197 | * Returns the js header and wrapper code to be printed into the page |
| 198 | 198 | * |
| 199 | 199 | * @param bool $bIncludeJs Also get the js code |
@@ -202,8 +202,8 @@ discard block |
||
| 202 | 202 | * @return string the javascript code |
| 203 | 203 | * @throws UriException |
| 204 | 204 | */ |
| 205 | - public function script(bool $bIncludeJs = false, bool $bIncludeCss = false): string |
|
| 206 | - { |
|
| 207 | - return $this->getCodeGenerator()->getScript($bIncludeJs, $bIncludeCss); |
|
| 208 | - } |
|
| 205 | +public function script(bool $bIncludeJs = false, bool $bIncludeCss = false): string |
|
| 206 | +{ |
|
| 207 | +return $this->getCodeGenerator()->getScript($bIncludeJs, $bIncludeCss); |
|
| 208 | +} |
|
| 209 | 209 | } |
@@ -19,41 +19,41 @@ |
||
| 19 | 19 | |
| 20 | 20 | trait DiTrait |
| 21 | 21 | { |
| 22 | - /** |
|
| 22 | +/** |
|
| 23 | 23 | * @var Container |
| 24 | 24 | */ |
| 25 | - private Container $xContainer; |
|
| 25 | +private Container $xContainer; |
|
| 26 | 26 | |
| 27 | - /** |
|
| 27 | +/** |
|
| 28 | 28 | * @var ComponentContainer |
| 29 | 29 | */ |
| 30 | - protected ComponentContainer $xComponentContainer; |
|
| 30 | +protected ComponentContainer $xComponentContainer; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 32 | +/** |
|
| 33 | 33 | * Get the DI container |
| 34 | 34 | * |
| 35 | 35 | * @return Container |
| 36 | 36 | */ |
| 37 | - public function di(): Container |
|
| 38 | - { |
|
| 39 | - return $this->xContainer; |
|
| 40 | - } |
|
| 37 | +public function di(): Container |
|
| 38 | +{ |
|
| 39 | +return $this->xContainer; |
|
| 40 | +} |
|
| 41 | 41 | |
| 42 | - /** |
|
| 42 | +/** |
|
| 43 | 43 | * Get the component DI container |
| 44 | 44 | * |
| 45 | 45 | * @return ComponentContainer |
| 46 | 46 | */ |
| 47 | - public function cdi(): ComponentContainer |
|
| 48 | - { |
|
| 49 | - return $this->xComponentContainer; |
|
| 50 | - } |
|
| 47 | +public function cdi(): ComponentContainer |
|
| 48 | +{ |
|
| 49 | +return $this->xComponentContainer; |
|
| 50 | +} |
|
| 51 | 51 | |
| 52 | - /** |
|
| 52 | +/** |
|
| 53 | 53 | * @return ConfigManager |
| 54 | 54 | */ |
| 55 | - public function config(): ConfigManager |
|
| 56 | - { |
|
| 57 | - return $this->di()->g(ConfigManager::class); |
|
| 58 | - } |
|
| 55 | +public function config(): ConfigManager |
|
| 56 | +{ |
|
| 57 | +return $this->di()->g(ConfigManager::class); |
|
| 58 | +} |
|
| 59 | 59 | } |
@@ -33,111 +33,111 @@ |
||
| 33 | 33 | |
| 34 | 34 | final class Jaxon |
| 35 | 35 | { |
| 36 | - use Traits\ConfigTrait; |
|
| 37 | - use Traits\ServicesTrait; |
|
| 38 | - use Traits\PluginTrait; |
|
| 39 | - use Traits\RequestTrait; |
|
| 40 | - use Traits\ResponseTrait; |
|
| 41 | - use Traits\SendResponseTrait; |
|
| 42 | - |
|
| 43 | - /** |
|
| 36 | +use Traits\ConfigTrait; |
|
| 37 | +use Traits\ServicesTrait; |
|
| 38 | +use Traits\PluginTrait; |
|
| 39 | +use Traits\RequestTrait; |
|
| 40 | +use Traits\ResponseTrait; |
|
| 41 | +use Traits\SendResponseTrait; |
|
| 42 | + |
|
| 43 | +/** |
|
| 44 | 44 | * @var Jaxon |
| 45 | 45 | */ |
| 46 | - private static $xInstance = null; |
|
| 46 | +private static $xInstance = null; |
|
| 47 | 47 | |
| 48 | - /** |
|
| 48 | +/** |
|
| 49 | 49 | * The constructor |
| 50 | 50 | * |
| 51 | 51 | * @param Container $xContainer |
| 52 | 52 | * @param ComponentContainer $xComponentContainer |
| 53 | 53 | */ |
| 54 | - private function __construct(Container $xContainer, ComponentContainer $xComponentContainer) |
|
| 55 | - { |
|
| 56 | - $this->xContainer = $xContainer; |
|
| 57 | - $this->xComponentContainer = $xComponentContainer; |
|
| 58 | - } |
|
| 54 | +private function __construct(Container $xContainer, ComponentContainer $xComponentContainer) |
|
| 55 | +{ |
|
| 56 | +$this->xContainer = $xContainer; |
|
| 57 | +$this->xComponentContainer = $xComponentContainer; |
|
| 58 | +} |
|
| 59 | 59 | |
| 60 | - /** |
|
| 60 | +/** |
|
| 61 | 61 | * @return Jaxon |
| 62 | 62 | */ |
| 63 | - private static function createInstance(): Jaxon |
|
| 64 | - { |
|
| 65 | - $xContainer = new Container(); |
|
| 66 | - $xComponentContainer = new ComponentContainer($xContainer); |
|
| 67 | - self::$xInstance = new Jaxon($xContainer, $xComponentContainer); |
|
| 63 | +private static function createInstance(): Jaxon |
|
| 64 | +{ |
|
| 65 | +$xContainer = new Container(); |
|
| 66 | +$xComponentContainer = new ComponentContainer($xContainer); |
|
| 67 | +self::$xInstance = new Jaxon($xContainer, $xComponentContainer); |
|
| 68 | 68 | |
| 69 | - // Save the Jaxon and container instances |
|
| 70 | - $xContainer->val(Jaxon::class, self::$xInstance); |
|
| 71 | - $xContainer->val(ComponentContainer::class, $xComponentContainer); |
|
| 69 | +// Save the Jaxon and container instances |
|
| 70 | +$xContainer->val(Jaxon::class, self::$xInstance); |
|
| 71 | +$xContainer->val(ComponentContainer::class, $xComponentContainer); |
|
| 72 | 72 | |
| 73 | - // Make the helpers functions available in the global namespace. |
|
| 74 | - self::$xInstance->getCallbackManager()->boot(function() { |
|
| 75 | - self::$xInstance->config()->globals(); |
|
| 76 | - }); |
|
| 73 | +// Make the helpers functions available in the global namespace. |
|
| 74 | +self::$xInstance->getCallbackManager()->boot(function() { |
|
| 75 | +self::$xInstance->config()->globals(); |
|
| 76 | +}); |
|
| 77 | 77 | |
| 78 | - return self::$xInstance; |
|
| 79 | - } |
|
| 78 | +return self::$xInstance; |
|
| 79 | +} |
|
| 80 | 80 | |
| 81 | - /** |
|
| 81 | +/** |
|
| 82 | 82 | * @return Jaxon |
| 83 | 83 | */ |
| 84 | - public static function getInstance(): Jaxon |
|
| 85 | - { |
|
| 86 | - return self::$xInstance ?: self::$xInstance = self::createInstance(); |
|
| 87 | - } |
|
| 84 | +public static function getInstance(): Jaxon |
|
| 85 | +{ |
|
| 86 | +return self::$xInstance ?: self::$xInstance = self::createInstance(); |
|
| 87 | +} |
|
| 88 | 88 | |
| 89 | - /** |
|
| 89 | +/** |
|
| 90 | 90 | * @return string |
| 91 | 91 | */ |
| 92 | - public function getVersion(): string |
|
| 93 | - { |
|
| 94 | - return \Jaxon\Jaxon::VERSION; |
|
| 95 | - } |
|
| 92 | +public function getVersion(): string |
|
| 93 | +{ |
|
| 94 | +return \Jaxon\Jaxon::VERSION; |
|
| 95 | +} |
|
| 96 | 96 | |
| 97 | - /** |
|
| 97 | +/** |
|
| 98 | 98 | * @return ConfigManager |
| 99 | 99 | */ |
| 100 | - public function config(): ConfigManager |
|
| 101 | - { |
|
| 102 | - return $this->di()->g(ConfigManager::class); |
|
| 103 | - } |
|
| 100 | +public function config(): ConfigManager |
|
| 101 | +{ |
|
| 102 | +return $this->di()->g(ConfigManager::class); |
|
| 103 | +} |
|
| 104 | 104 | |
| 105 | - /** |
|
| 105 | +/** |
|
| 106 | 106 | * Set the ajax endpoint URI |
| 107 | 107 | * |
| 108 | 108 | * @param string $sUri The ajax endpoint URI |
| 109 | 109 | * |
| 110 | 110 | * @return void |
| 111 | 111 | */ |
| 112 | - public function setUri(string $sUri): void |
|
| 113 | - { |
|
| 114 | - $this->config()->setOption('core.request.uri', $sUri); |
|
| 115 | - } |
|
| 112 | +public function setUri(string $sUri): void |
|
| 113 | +{ |
|
| 114 | +$this->config()->setOption('core.request.uri', $sUri); |
|
| 115 | +} |
|
| 116 | 116 | |
| 117 | - /** |
|
| 117 | +/** |
|
| 118 | 118 | * @return AppInterface |
| 119 | 119 | */ |
| 120 | - public function app(): AppInterface |
|
| 121 | - { |
|
| 122 | - return $this->xContainer->getApp(); |
|
| 123 | - } |
|
| 120 | +public function app(): AppInterface |
|
| 121 | +{ |
|
| 122 | +return $this->xContainer->getApp(); |
|
| 123 | +} |
|
| 124 | 124 | |
| 125 | - /** |
|
| 125 | +/** |
|
| 126 | 126 | * Get the callback manager |
| 127 | 127 | * |
| 128 | 128 | * @return CallbackManager |
| 129 | 129 | */ |
| 130 | - public function callback(): CallbackManager |
|
| 131 | - { |
|
| 132 | - return $this->getCallbackManager(); |
|
| 133 | - } |
|
| 130 | +public function callback(): CallbackManager |
|
| 131 | +{ |
|
| 132 | +return $this->getCallbackManager(); |
|
| 133 | +} |
|
| 134 | 134 | |
| 135 | - /** |
|
| 135 | +/** |
|
| 136 | 136 | * @return void |
| 137 | 137 | * @throws SetupException |
| 138 | 138 | */ |
| 139 | - public function reset(): void |
|
| 140 | - { |
|
| 141 | - self::$xInstance = null; |
|
| 142 | - } |
|
| 139 | +public function reset(): void |
|
| 140 | +{ |
|
| 141 | +self::$xInstance = null; |
|
| 142 | +} |
|
| 143 | 143 | } |
@@ -22,58 +22,58 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | interface AppInterface |
| 24 | 24 | { |
| 25 | - /** |
|
| 25 | +/** |
|
| 26 | 26 | * Set the logger. |
| 27 | 27 | * |
| 28 | 28 | * @param LoggerInterface|Closure $xLogger |
| 29 | 29 | * |
| 30 | 30 | * @return void |
| 31 | 31 | */ |
| 32 | - public function setLogger(LoggerInterface|Closure $xLogger): void; |
|
| 32 | +public function setLogger(LoggerInterface|Closure $xLogger): void; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 34 | +/** |
|
| 35 | 35 | * Get the configured character encoding |
| 36 | 36 | * |
| 37 | 37 | * @return string |
| 38 | 38 | */ |
| 39 | - public function getCharacterEncoding(): string; |
|
| 39 | +public function getCharacterEncoding(): string; |
|
| 40 | 40 | |
| 41 | - /** |
|
| 41 | +/** |
|
| 42 | 42 | * Get the content type of the HTTP response |
| 43 | 43 | * |
| 44 | 44 | * @return string |
| 45 | 45 | */ |
| 46 | - public function getContentType(): string; |
|
| 46 | +public function getContentType(): string; |
|
| 47 | 47 | |
| 48 | - /** |
|
| 48 | +/** |
|
| 49 | 49 | * Get the HTML tags to include Jaxon javascript files into the page. |
| 50 | 50 | * |
| 51 | 51 | * @return string |
| 52 | 52 | */ |
| 53 | - public function getJs(): string; |
|
| 53 | +public function getJs(): string; |
|
| 54 | 54 | |
| 55 | - /** |
|
| 55 | +/** |
|
| 56 | 56 | * Get the HTML tags to include Jaxon javascript files into the page. |
| 57 | 57 | * |
| 58 | 58 | * @return string the javascript code |
| 59 | 59 | */ |
| 60 | - public function js(): string; |
|
| 60 | +public function js(): string; |
|
| 61 | 61 | |
| 62 | - /** |
|
| 62 | +/** |
|
| 63 | 63 | * Get the HTML tags to include Jaxon CSS code and files into the page. |
| 64 | 64 | * |
| 65 | 65 | * @return string |
| 66 | 66 | */ |
| 67 | - public function getCss(): string; |
|
| 67 | +public function getCss(): string; |
|
| 68 | 68 | |
| 69 | - /** |
|
| 69 | +/** |
|
| 70 | 70 | * Get the HTML tags to include Jaxon CSS code and files into the page. |
| 71 | 71 | * |
| 72 | 72 | * @return string the javascript code |
| 73 | 73 | */ |
| 74 | - public function css(): string; |
|
| 74 | +public function css(): string; |
|
| 75 | 75 | |
| 76 | - /** |
|
| 76 | +/** |
|
| 77 | 77 | * Returns the js header and wrapper code to be printed into the page |
| 78 | 78 | * |
| 79 | 79 | * The javascript code returned by this function is dependent on the plugins |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @return string |
| 86 | 86 | */ |
| 87 | - public function getScript(bool $bIncludeJs = false, bool $bIncludeCss = false): string; |
|
| 87 | +public function getScript(bool $bIncludeJs = false, bool $bIncludeCss = false): string; |
|
| 88 | 88 | |
| 89 | - /** |
|
| 89 | +/** |
|
| 90 | 90 | * Returns the js header and wrapper code to be printed into the page |
| 91 | 91 | * |
| 92 | 92 | * @param bool $bIncludeJs Also get the JS files |
@@ -95,46 +95,46 @@ discard block |
||
| 95 | 95 | * @return string the javascript code |
| 96 | 96 | * @throws UriException |
| 97 | 97 | */ |
| 98 | - public function script(bool $bIncludeJs = false, bool $bIncludeCss = false): string; |
|
| 98 | +public function script(bool $bIncludeJs = false, bool $bIncludeCss = false): string; |
|
| 99 | 99 | |
| 100 | - /** |
|
| 100 | +/** |
|
| 101 | 101 | * Determine if a call is a jaxon request or a page load request |
| 102 | 102 | * |
| 103 | 103 | * @return bool |
| 104 | 104 | */ |
| 105 | - public function canProcessRequest(): bool; |
|
| 105 | +public function canProcessRequest(): bool; |
|
| 106 | 106 | |
| 107 | - /** |
|
| 107 | +/** |
|
| 108 | 108 | * Process an incoming Jaxon request, and return the response. |
| 109 | 109 | * |
| 110 | 110 | * @return mixed |
| 111 | 111 | */ |
| 112 | - public function processRequest(): mixed; |
|
| 112 | +public function processRequest(): mixed; |
|
| 113 | 113 | |
| 114 | - /** |
|
| 114 | +/** |
|
| 115 | 115 | * Get the Jaxon ajax response |
| 116 | 116 | * |
| 117 | 117 | * @return AjaxResponse |
| 118 | 118 | */ |
| 119 | - public function ajaxResponse(): AjaxResponse; |
|
| 119 | +public function ajaxResponse(): AjaxResponse; |
|
| 120 | 120 | |
| 121 | - /** |
|
| 121 | +/** |
|
| 122 | 122 | * @param Closure $xClosure A closure to create the session manager instance |
| 123 | 123 | * |
| 124 | 124 | * @return void |
| 125 | 125 | */ |
| 126 | - public function setSessionManager(Closure $xClosure); |
|
| 126 | +public function setSessionManager(Closure $xClosure); |
|
| 127 | 127 | |
| 128 | - /** |
|
| 128 | +/** |
|
| 129 | 129 | * Set the container provided by the integrated framework |
| 130 | 130 | * |
| 131 | 131 | * @param ContainerInterface $xContainer The container implementation |
| 132 | 132 | * |
| 133 | 133 | * @return void |
| 134 | 134 | */ |
| 135 | - public function setContainer(ContainerInterface $xContainer); |
|
| 135 | +public function setContainer(ContainerInterface $xContainer); |
|
| 136 | 136 | |
| 137 | - /** |
|
| 137 | +/** |
|
| 138 | 138 | * Add a view renderer with an id |
| 139 | 139 | * |
| 140 | 140 | * @param string $sRenderer The renderer name |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @return void |
| 145 | 145 | */ |
| 146 | - public function addViewRenderer(string $sRenderer, string $sExtension, Closure $xClosure); |
|
| 146 | +public function addViewRenderer(string $sRenderer, string $sExtension, Closure $xClosure); |
|
| 147 | 147 | |
| 148 | - /** |
|
| 148 | +/** |
|
| 149 | 149 | * Set the javascript asset |
| 150 | 150 | * |
| 151 | 151 | * @param bool $bExport Whether to export the js code in a file |
@@ -155,14 +155,14 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @return void |
| 157 | 157 | */ |
| 158 | - public function asset(bool $bExport, bool $bMinify, string $sUri = '', string $sDir = ''): void; |
|
| 158 | +public function asset(bool $bExport, bool $bMinify, string $sUri = '', string $sDir = ''): void; |
|
| 159 | 159 | |
| 160 | - /** |
|
| 160 | +/** |
|
| 161 | 161 | * Read config options from a config file and set up the library |
| 162 | 162 | * |
| 163 | 163 | * @param string $sConfigFile The full path to the config file |
| 164 | 164 | * |
| 165 | 165 | * @return void |
| 166 | 166 | */ |
| 167 | - public function setup(string $sConfigFile = ''): void; |
|
| 167 | +public function setup(string $sConfigFile = ''): void; |
|
| 168 | 168 | } |