Make PHP-CS happy

This commit is contained in:
Philipp 2025-01-02 21:10:58 +01:00
parent eb0c38f90f
commit 6d77eb9b10
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
2 changed files with 75 additions and 69 deletions

View file

@ -230,7 +230,7 @@ class System
$trace = array_slice($trace, 2 + $offset);
$callstack = [];
$previous = ['class' => '', 'function' => '', 'database' => false];
$previous = ['class' => '', 'function' => '', 'database' => false];
// The ignore list contains all functions that are only wrapper functions
$ignore = ['call_user_func_array'];
@ -250,15 +250,15 @@ class System
// Don't show multiple calls from the Database classes to show the essential parts of the callstack
$func['database'] = in_array($func['class'], ['Friendica\Database\DBA', 'Friendica\Database\Database']);
if ($full || !$previous['database'] || !$func['database']) {
$classparts = explode("\\", $func['class']);
$classparts = explode("\\", $func['class']);
$callstack[] = array_pop($classparts).'::'.$func['function'] . (isset($func['line']) ? ' (' . $func['line'] . ')' : '');
$previous = $func;
$previous = $func;
}
} elseif (!in_array($func['function'], $ignore)) {
$func['database'] = ($func['function'] == 'q');
$callstack[] = $func['function'] . (isset($func['line']) ? ' (' . $func['line'] . ')' : '');
$func['class'] = '';
$previous = $func;
$callstack[] = $func['function'] . (isset($func['line']) ? ' (' . $func['line'] . ')' : '');
$func['class'] = '';
$previous = $func;
}
}
@ -277,10 +277,13 @@ class System
*/
public static function echoResponse(ResponseInterface $response)
{
header(sprintf("HTTP/%s %s %s",
header(
sprintf(
"HTTP/%s %s %s",
$response->getProtocolVersion(),
$response->getStatusCode(),
$response->getReasonPhrase())
$response->getReasonPhrase()
)
);
foreach ($response->getHeaders() as $key => $header) {
@ -701,7 +704,7 @@ class System
if (DI::config()->get('system', 'tosdisplay')) {
$rulelist = DI::config()->get('system', 'tosrules') ?: DI::config()->get('system', 'tostext');
$msg = BBCode::toPlaintext($rulelist, false);
$msg = BBCode::toPlaintext($rulelist, false);
foreach (explode("\n", trim($msg)) as $line) {
$line = trim($line);
if ($line) {