Add JS-CATCH-FALLBACK-01 rule and update npm packages
Add PHP-ALIAS-01 rule: prohibit field aliasing in serialization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -889,90 +889,6 @@ class Debugger
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Forced console debug - Always outputs in development
|
||||
*
|
||||
* Same as console_debug() but bypasses all filters and configuration.
|
||||
* Always outputs to BOTH CLI and HTTP contexts simultaneously.
|
||||
* Only works in non-production mode - silently ignored in production.
|
||||
*
|
||||
* Use for critical development notices that developers must see,
|
||||
* such as "manifest does not exist, full rebuild required".
|
||||
*
|
||||
* @param string $channel Channel category
|
||||
* @param mixed ...$values Values to output
|
||||
* @return void
|
||||
*/
|
||||
public static function console_debug_force(string $channel, ...$values): void
|
||||
{
|
||||
// Never output in production
|
||||
if (app()->environment('production')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Normalize channel name
|
||||
$channel = static::__normalize_channel($channel);
|
||||
|
||||
// Get caller information
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
|
||||
|
||||
// Detect if called via helper function
|
||||
$caller_index = 0;
|
||||
if (isset($trace[0]['function']) && $trace[0]['function'] === 'console_debug_force' &&
|
||||
isset($trace[0]['file']) && str_ends_with($trace[0]['file'], '/app/RSpade/helpers.php')) {
|
||||
// Called via helper, skip one level
|
||||
$caller_index = 1;
|
||||
}
|
||||
|
||||
$caller = $trace[$caller_index] ?? null;
|
||||
|
||||
// Build location prefix
|
||||
$location_prefix = '';
|
||||
if ($caller && isset($caller['file']) && isset($caller['line'])) {
|
||||
$file = str_replace(base_path() . '/', '', $caller['file']);
|
||||
$location_prefix = "[{$file}:{$caller['line']}] ";
|
||||
}
|
||||
|
||||
// CLI output - always output
|
||||
if (app()->runningInConsole()) {
|
||||
$prefix = $location_prefix . "[{$channel}]";
|
||||
// ANSI color codes: \033[33m = yellow (more visible), \033[0m = reset
|
||||
fwrite(STDERR, "\033[33m" . $prefix . "\033[0m");
|
||||
|
||||
foreach ($values as $value) {
|
||||
if (is_string($value) || is_numeric($value) || is_bool($value) || is_null($value)) {
|
||||
$output = is_bool($value) ? ($value ? 'true' : 'false') :
|
||||
(is_null($value) ? 'null' : (string)$value);
|
||||
fwrite(STDERR, ' ' . $output);
|
||||
} else {
|
||||
$json_value = static::_prepare_value_for_json($value);
|
||||
$json = json_encode($json_value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
fwrite(STDERR, "\n" . $json);
|
||||
}
|
||||
}
|
||||
fwrite(STDERR, "\n");
|
||||
}
|
||||
|
||||
// HTTP output - always output
|
||||
if (!app()->runningInConsole()) {
|
||||
// Prepare values for JSON
|
||||
$prepared_values = [];
|
||||
foreach ($values as $value) {
|
||||
$prepared_values[] = static::_prepare_value_for_json($value);
|
||||
}
|
||||
|
||||
// Store message
|
||||
$channel_with_prefixes = $location_prefix . "[{$channel}]";
|
||||
static::$console_messages[] = [$channel_with_prefixes, $prepared_values];
|
||||
|
||||
// Register shutdown function if not already registered
|
||||
if (!static::$shutdown_registered && !static::$trace_mode) {
|
||||
register_shutdown_function([static::class, 'dump_console_debug_messages_to_html']);
|
||||
static::$shutdown_registered = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare a value for JSON encoding
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user