Skip to content

Commit

Permalink
Make PHP-CS happy
Browse files Browse the repository at this point in the history
  • Loading branch information
nupplaphil committed Jan 2, 2025
1 parent 6934244 commit 77050f9
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 69 deletions.
21 changes: 12 additions & 9 deletions src/Core/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public static function callstack(int $depth = 4, int $offset = 0, bool $full = f
$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'];
Expand All @@ -250,15 +250,15 @@ public static function callstack(int $depth = 4, int $offset = 0, bool $full = f
// 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;
}
}

Expand All @@ -277,10 +277,13 @@ public static function callstack(int $depth = 4, int $offset = 0, bool $full = f
*/
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) {
Expand Down Expand Up @@ -701,7 +704,7 @@ public static function getRules(bool $numeric_id = false): array

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) {
Expand Down
Loading

0 comments on commit 77050f9

Please sign in to comment.