@@ -179,7 +179,7 @@ public function __construct(array $defaults = [])
179
179
}
180
180
}
181
181
182
- // Set our exception handler
182
+ // set our exception handler
183
183
if ($ this ->catchExceptions ) {
184
184
set_exception_handler (\Closure::fromCallable ([$ this , 'caughtException ' ]));
185
185
set_error_handler (static function (int $ severity , string $ msg , string $ file , int $ line ): bool {
@@ -207,7 +207,7 @@ public function __construct(array $defaults = [])
207
207
http_response_code (500 );
208
208
}
209
209
210
- // Always run app on shutdown
210
+ // always run app on shutdown
211
211
if ($ this ->alwaysRun ) {
212
212
$ this ->setupAlwaysRun ();
213
213
}
@@ -289,9 +289,6 @@ public function callExit(): void
289
289
exit ;
290
290
}
291
291
292
- /**
293
- * Catch exception.
294
- */
295
292
public function caughtException (\Throwable $ exception ): void
296
293
{
297
294
if ($ exception instanceof LateOutputError) {
@@ -415,22 +412,22 @@ public function terminate($output = ''): void
415
412
416
413
$ this ->outputResponseJson ($ output );
417
414
} elseif (isset ($ _GET ['__atk_tab ' ]) && $ type === 'text/html ' ) {
418
- // ugly hack for TABS
419
- // because Fomantic-UI tab only deal with HTML and not JSON
420
- // we need to hack output to include app modal.
415
+ // ugly hack for Tabs
416
+ // because Fomantic-UI Tab only deal with HTML and not JSON
417
+ // we need to hack output to include app modal
421
418
$ ids = [];
422
- $ remove_function = '' ;
419
+ $ jsRemoveFunction = '' ;
423
420
foreach ($ this ->getRenderedPortals () as $ key => $ modal ) {
424
421
// add modal rendering to output
425
422
$ ids [] = '# ' . $ key ;
426
423
$ output ['atkjs ' ] .= '; ' . $ modal ['js ' ];
427
424
$ output ['html ' ] .= $ modal ['html ' ];
428
425
}
429
426
if (count ($ ids ) > 0 ) {
430
- $ remove_function = '$( \'.ui.dimmer.modals.page, .atk-side-panels \').find( \'' . implode (', ' , $ ids ) . '\').remove(); ' ;
427
+ $ jsRemoveFunction = '$( \'.ui.dimmer.modals.page, .atk-side-panels \').find( \'' . implode (', ' , $ ids ) . '\').remove(); ' ;
431
428
}
432
429
433
- $ output = $ this ->getTag ('script ' , [], '$(function () { ' . $ remove_function . $ output ['atkjs ' ] . '}); ' )
430
+ $ output = $ this ->getTag ('script ' , [], '$(function () { ' . $ jsRemoveFunction . $ output ['atkjs ' ] . '}); ' )
434
431
. $ output ['html ' ];
435
432
436
433
$ this ->outputResponseHtml ($ output );
@@ -699,9 +696,9 @@ public function url($page = [], $useRequestUrl = false, $extraRequestUrlArgs = [
699
696
700
697
$ pagePath = '' ;
701
698
if (is_string ($ page )) {
702
- $ page_arr = explode ('? ' , $ page , 2 );
703
- $ pagePath = $ page_arr [0 ];
704
- parse_str ($ page_arr [1 ] ?? '' , $ page );
699
+ $ pageExploded = explode ('? ' , $ page , 2 );
700
+ $ pagePath = $ pageExploded [0 ];
701
+ parse_str ($ pageExploded [1 ] ?? '' , $ page );
705
702
} else {
706
703
if (isset ($ page [0 ])) {
707
704
$ pagePath = $ page [0 ];
@@ -1103,9 +1100,6 @@ protected function emitResponse(): void
1103
1100
}
1104
1101
}
1105
1102
1106
- /**
1107
- * Output Response to the client.
1108
- */
1109
1103
protected function outputResponse (string $ data ): void
1110
1104
{
1111
1105
foreach (ob_get_status (true ) as $ status ) {
@@ -1170,8 +1164,6 @@ private function outputResponseHtml(string $data): void
1170
1164
}
1171
1165
1172
1166
/**
1173
- * Output JSON response to the client.
1174
- *
1175
1167
* @param string|array $data
1176
1168
*/
1177
1169
private function outputResponseJson ($ data ): void
0 commit comments