Skip to content

Adding NC32 support #196

@oleua

Description

@oleua

Hi! With the help of AI I've managed to make the app compatible with NC32.

in /apps/files_scripts/vendor/psr/log/Psr/Log/NullLogger.php:

--- NullLogger.php.ori	2024-05-31 18:28:27.805883350 +0300
+++ NullLogger.php	2026-01-19 01:52:32.511733352 +0200
@@ -4,26 +4,21 @@
 
 /**
  * This Logger can be used to avoid conditional log calls.
- *
- * Logging should always be optional, and if no logger is provided to your
- * library creating a NullLogger instance to have something to throw logs at
- * is a good way to avoid littering your code with `if ($this->logger) { }`
- * blocks.
  */
 class NullLogger extends AbstractLogger
 {
     /**
      * Logs with an arbitrary level.
      *
-     * @param mixed  $level
-     * @param string $message
-     * @param array  $context
+     * @param mixed              $level
+     * @param \Stringable|string $message
+     * @param array              $context
      *
      * @return void
      *
      * @throws \Psr\Log\InvalidArgumentException
      */
-    public function log($level, $message, array $context = array())
+    public function log($level, \Stringable|string $message, array $context = array()): void
     {
         // noop
     }

in /apps/files_scripts/vendor/psr/log/Psr/Log/AbstractLogger.php:

--- AbstractLogger.php.ori	2024-05-31 18:28:27.805883350 +0300
+++ AbstractLogger.php	2026-01-18 23:50:40.456379892 +0200
@@ -4,124 +4,74 @@
 
 /**
  * This is a simple Logger implementation that other Loggers can inherit from.
- *
- * It simply delegates all log-level-specific methods to the `log` method to
- * reduce boilerplate code that a simple Logger that does the same thing with
- * messages regardless of the error level has to implement.
  */
 abstract class AbstractLogger implements LoggerInterface
 {
     /**
      * System is unusable.
      *
-     * @param string  $message
+     * @param \Stringable|string $message
      * @param mixed[] $context
      *
      * @return void
      */
-    public function emergency($message, array $context = array())
+    public function emergency(\Stringable|string $message, array $context = array()): void
     {
         $this->log(LogLevel::EMERGENCY, $message, $context);
     }
 
     /**
      * Action must be taken immediately.
-     *
-     * Example: Entire website down, database unavailable, etc. This should
-     * trigger the SMS alerts and wake you up.
-     *
-     * @param string  $message
-     * @param mixed[] $context
-     *
-     * @return void
      */
-    public function alert($message, array $context = array())
+    public function alert(\Stringable|string $message, array $context = array()): void
     {
         $this->log(LogLevel::ALERT, $message, $context);
     }
 
     /**
      * Critical conditions.
-     *
-     * Example: Application component unavailable, unexpected exception.
-     *
-     * @param string  $message
-     * @param mixed[] $context
-     *
-     * @return void
      */
-    public function critical($message, array $context = array())
+    public function critical(\Stringable|string $message, array $context = array()): void
     {
         $this->log(LogLevel::CRITICAL, $message, $context);
     }
 
     /**
-     * Runtime errors that do not require immediate action but should typically
-     * be logged and monitored.
-     *
-     * @param string  $message
-     * @param mixed[] $context
-     *
-     * @return void
+     * Runtime errors.
      */
-    public function error($message, array $context = array())
+    public function error(\Stringable|string $message, array $context = array()): void
     {
         $this->log(LogLevel::ERROR, $message, $context);
     }
 
     /**
-     * Exceptional occurrences that are not errors.
-     *
-     * Example: Use of deprecated APIs, poor use of an API, undesirable things
-     * that are not necessarily wrong.
-     *
-     * @param string  $message
-     * @param mixed[] $context
-     *
-     * @return void
+     * Exceptional occurrences.
      */
-    public function warning($message, array $context = array())
+    public function warning(\Stringable|string $message, array $context = array()): void
     {
         $this->log(LogLevel::WARNING, $message, $context);
     }
 
     /**
      * Normal but significant events.
-     *
-     * @param string  $message
-     * @param mixed[] $context
-     *
-     * @return void
      */
-    public function notice($message, array $context = array())
+    public function notice(\Stringable|string $message, array $context = array()): void
     {
         $this->log(LogLevel::NOTICE, $message, $context);
     }
 
     /**
      * Interesting events.
-     *
-     * Example: User logs in, SQL logs.
-     *
-     * @param string  $message
-     * @param mixed[] $context
-     *
-     * @return void
      */
-    public function info($message, array $context = array())
+    public function info(\Stringable|string $message, array $context = array()): void
     {
         $this->log(LogLevel::INFO, $message, $context);
     }
 
     /**
      * Detailed debug information.
-     *
-     * @param string  $message
-     * @param mixed[] $context
-     *
-     * @return void
      */
-    public function debug($message, array $context = array())
+    public function debug(\Stringable|string $message, array $context = array()): void
    {
         $this->log(LogLevel::DEBUG, $message, $context);
     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions