From b0a861a9cc7276098eaba6f36bee4d498ed1e085 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 12 Apr 2024 09:48:58 +0200 Subject: [PATCH 1/9] explicitly mark nullable parameters as nullable (#1874) --- src/Monolog/Handler/FilterHandler.php | 2 +- src/Monolog/Handler/FingersCrossedHandler.php | 2 +- src/Monolog/Handler/SamplingHandler.php | 2 +- src/Monolog/Handler/Slack/SlackRecord.php | 2 +- src/Monolog/Handler/TelegramBotHandler.php | 12 ++++++------ src/Monolog/Logger.php | 2 +- src/Monolog/Processor/WebProcessor.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Monolog/Handler/FilterHandler.php b/src/Monolog/Handler/FilterHandler.php index 718f17ef..5e43e1dc 100644 --- a/src/Monolog/Handler/FilterHandler.php +++ b/src/Monolog/Handler/FilterHandler.php @@ -161,7 +161,7 @@ class FilterHandler extends Handler implements ProcessableHandlerInterface, Rese * * @phpstan-param Record $record */ - public function getHandler(array $record = null) + public function getHandler(?array $record = null) { if (!$this->handler instanceof HandlerInterface) { $this->handler = ($this->handler)($record, $this); diff --git a/src/Monolog/Handler/FingersCrossedHandler.php b/src/Monolog/Handler/FingersCrossedHandler.php index 0627b445..dfcb3af2 100644 --- a/src/Monolog/Handler/FingersCrossedHandler.php +++ b/src/Monolog/Handler/FingersCrossedHandler.php @@ -210,7 +210,7 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa * * @phpstan-param Record $record */ - public function getHandler(array $record = null) + public function getHandler(?array $record = null) { if (!$this->handler instanceof HandlerInterface) { $this->handler = ($this->handler)($record, $this); diff --git a/src/Monolog/Handler/SamplingHandler.php b/src/Monolog/Handler/SamplingHandler.php index c128a32d..25cce07f 100644 --- a/src/Monolog/Handler/SamplingHandler.php +++ b/src/Monolog/Handler/SamplingHandler.php @@ -90,7 +90,7 @@ class SamplingHandler extends AbstractHandler implements ProcessableHandlerInter * * @return HandlerInterface */ - public function getHandler(array $record = null) + public function getHandler(?array $record = null) { if (!$this->handler instanceof HandlerInterface) { $this->handler = ($this->handler)($record, $this); diff --git a/src/Monolog/Handler/Slack/SlackRecord.php b/src/Monolog/Handler/Slack/SlackRecord.php index 71a41094..9ae10037 100644 --- a/src/Monolog/Handler/Slack/SlackRecord.php +++ b/src/Monolog/Handler/Slack/SlackRecord.php @@ -100,7 +100,7 @@ class SlackRecord bool $useShortAttachment = false, bool $includeContextAndExtra = false, array $excludeFields = array(), - FormatterInterface $formatter = null + ?FormatterInterface $formatter = null ) { $this ->setChannel($channel) diff --git a/src/Monolog/Handler/TelegramBotHandler.php b/src/Monolog/Handler/TelegramBotHandler.php index 8912eba5..a6223b79 100644 --- a/src/Monolog/Handler/TelegramBotHandler.php +++ b/src/Monolog/Handler/TelegramBotHandler.php @@ -108,9 +108,9 @@ class TelegramBotHandler extends AbstractProcessingHandler string $channel, $level = Logger::DEBUG, bool $bubble = true, - string $parseMode = null, - bool $disableWebPagePreview = null, - bool $disableNotification = null, + ?string $parseMode = null, + ?bool $disableWebPagePreview = null, + ?bool $disableNotification = null, bool $splitLongMessages = false, bool $delayBetweenMessages = false ) @@ -130,7 +130,7 @@ class TelegramBotHandler extends AbstractProcessingHandler $this->delayBetweenMessages($delayBetweenMessages); } - public function setParseMode(string $parseMode = null): self + public function setParseMode(?string $parseMode = null): self { if ($parseMode !== null && !in_array($parseMode, self::AVAILABLE_PARSE_MODES)) { throw new \InvalidArgumentException('Unknown parseMode, use one of these: ' . implode(', ', self::AVAILABLE_PARSE_MODES) . '.'); @@ -141,14 +141,14 @@ class TelegramBotHandler extends AbstractProcessingHandler return $this; } - public function disableWebPagePreview(bool $disableWebPagePreview = null): self + public function disableWebPagePreview(?bool $disableWebPagePreview = null): self { $this->disableWebPagePreview = $disableWebPagePreview; return $this; } - public function disableNotification(bool $disableNotification = null): self + public function disableNotification(?bool $disableNotification = null): self { $this->disableNotification = $disableNotification; diff --git a/src/Monolog/Logger.php b/src/Monolog/Logger.php index 84a2f551..3c588a70 100644 --- a/src/Monolog/Logger.php +++ b/src/Monolog/Logger.php @@ -337,7 +337,7 @@ class Logger implements LoggerInterface, ResettableInterface * * @phpstan-param Level $level */ - public function addRecord(int $level, string $message, array $context = [], DateTimeImmutable $datetime = null): bool + public function addRecord(int $level, string $message, array $context = [], ?DateTimeImmutable $datetime = null): bool { if (isset(self::RFC_5424_LEVELS[$level])) { $level = self::RFC_5424_LEVELS[$level]; diff --git a/src/Monolog/Processor/WebProcessor.php b/src/Monolog/Processor/WebProcessor.php index 51850e17..887f4d39 100644 --- a/src/Monolog/Processor/WebProcessor.php +++ b/src/Monolog/Processor/WebProcessor.php @@ -43,7 +43,7 @@ class WebProcessor implements ProcessorInterface * @param array|\ArrayAccess|null $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data * @param array|array|null $extraFields Field names and the related key inside $serverData to be added (or just a list of field names to use the default configured $serverData mapping). If not provided it defaults to: [url, ip, http_method, server, referrer] + unique_id if present in server data */ - public function __construct($serverData = null, array $extraFields = null) + public function __construct($serverData = null, ?array $extraFields = null) { if (null === $serverData) { $this->serverData = &$_SERVER; From 5223f28d4125a554a5a1b48460f1352e6c277752 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Apr 2024 11:21:16 +0200 Subject: [PATCH 2/9] Add some docs --- src/Monolog/DateTimeImmutable.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Monolog/DateTimeImmutable.php b/src/Monolog/DateTimeImmutable.php index 6a1ba9b2..789f9bfc 100644 --- a/src/Monolog/DateTimeImmutable.php +++ b/src/Monolog/DateTimeImmutable.php @@ -30,6 +30,8 @@ class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable { $this->useMicroseconds = $useMicroseconds; + // if you like to use a custom time to pass to Logger::addRecord directly, + // call modify() or setTimestamp() on this instance to change the date after creating it parent::__construct('now', $timezone); } From 06f81e4717707da035695804528f1887f86e0fba Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Apr 2024 13:27:23 +0200 Subject: [PATCH 3/9] Upgrade phpstan --- composer.json | 2 +- phpstan-baseline.neon | 146 ++++++++++++++++++++++++++++++++++++++++++ phpstan.neon.dist | 3 + 3 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 phpstan-baseline.neon diff --git a/composer.json b/composer.json index b9437d6d..f94037af 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^8.5.14", "predis/predis": "^1.1 || ^2.0", "rollbar/rollbar": "^1.3 || ^2 || ^3", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000..aca584a6 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,146 @@ +parameters: + ignoreErrors: + - + message: "#^Property Monolog\\\\ErrorHandler\\:\\:\\$reservedMemory is never read, only written\\.$#" + count: 1 + path: src/Monolog/ErrorHandler.php + + - + message: "#^Parameter \\#2 \\$array of function implode expects array\\, array\\\\> given\\.$#" + count: 1 + path: src/Monolog/Formatter/JsonFormatter.php + + - + message: "#^Method Monolog\\\\Formatter\\\\NormalizerFormatter\\:\\:normalize\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Monolog/Formatter/NormalizerFormatter.php + + - + message: "#^Offset 'line' does not exist on array\\{function\\: string, line\\?\\: int, file\\: string, class\\?\\: class\\-string, type\\?\\: '\\-\\>'\\|'\\:\\:', args\\?\\: array, object\\?\\: object\\}\\.$#" + count: 1 + path: src/Monolog/Formatter/NormalizerFormatter.php + + - + message: "#^PHPDoc tag @var for variable \\$value has no value type specified in iterable type array\\.$#" + count: 2 + path: src/Monolog/Formatter/NormalizerFormatter.php + + - + message: "#^Method Monolog\\\\Formatter\\\\WildfireFormatter\\:\\:normalize\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Monolog/Formatter/WildfireFormatter.php + + - + message: "#^Unsafe call to private method Monolog\\\\Handler\\\\BrowserConsoleHandler\\:\\:call\\(\\) through static\\:\\:\\.$#" + count: 3 + path: src/Monolog/Handler/BrowserConsoleHandler.php + + - + message: "#^Unsafe call to private method Monolog\\\\Handler\\\\BrowserConsoleHandler\\:\\:call_array\\(\\) through static\\:\\:\\.$#" + count: 3 + path: src/Monolog/Handler/BrowserConsoleHandler.php + + - + message: "#^Unsafe call to private method Monolog\\\\Handler\\\\BrowserConsoleHandler\\:\\:dump\\(\\) through static\\:\\:\\.$#" + count: 2 + path: src/Monolog/Handler/BrowserConsoleHandler.php + + - + message: "#^Unsafe call to private method Monolog\\\\Handler\\\\BrowserConsoleHandler\\:\\:generateScript\\(\\) through static\\:\\:\\.$#" + count: 2 + path: src/Monolog/Handler/BrowserConsoleHandler.php + + - + message: "#^Unsafe call to private method Monolog\\\\Handler\\\\BrowserConsoleHandler\\:\\:getConsoleMethodForLevel\\(\\) through static\\:\\:\\.$#" + count: 1 + path: src/Monolog/Handler/BrowserConsoleHandler.php + + - + message: "#^Unsafe call to private method Monolog\\\\Handler\\\\BrowserConsoleHandler\\:\\:handleCustomStyles\\(\\) through static\\:\\:\\.$#" + count: 1 + path: src/Monolog/Handler/BrowserConsoleHandler.php + + - + message: "#^Unsafe call to private method Monolog\\\\Handler\\\\BrowserConsoleHandler\\:\\:handleStyles\\(\\) through static\\:\\:\\.$#" + count: 2 + path: src/Monolog/Handler/BrowserConsoleHandler.php + + - + message: "#^Unsafe call to private method Monolog\\\\Handler\\\\BrowserConsoleHandler\\:\\:quote\\(\\) through static\\:\\:\\.$#" + count: 9 + path: src/Monolog/Handler/BrowserConsoleHandler.php + + - + message: "#^Method Monolog\\\\Handler\\\\ElasticsearchHandler\\:\\:bulkSend\\(\\) has parameter \\$records with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Monolog/Handler/ElasticsearchHandler.php + + - + message: "#^Method Monolog\\\\Handler\\\\LogglyHandler\\:\\:loadCurlHandle\\(\\) never returns resource so it can be removed from the return type\\.$#" + count: 1 + path: src/Monolog/Handler/LogglyHandler.php + + - + message: "#^Property Monolog\\\\Handler\\\\MongoDBHandler\\:\\:\\$namespace \\(string\\) in isset\\(\\) is not nullable\\.$#" + count: 1 + path: src/Monolog/Handler/MongoDBHandler.php + + - + message: "#^Offset 'dirname' does not exist on array\\{dirname\\?\\: string, basename\\: string, extension\\?\\: string, filename\\: string\\}\\.$#" + count: 2 + path: src/Monolog/Handler/RotatingFileHandler.php + + - + message: "#^Invalid array key type Fiber\\.$#" + count: 1 + path: src/Monolog/Logger.php + + - + message: "#^Method Monolog\\\\Logger\\:\\:__construct\\(\\) has parameter \\$processors with no value type specified in iterable type array\\.$#" + count: 2 + path: src/Monolog/Logger.php + + - + message: "#^Offset Fiber does not exist on WeakMap\\\\|null\\.$#" + count: 1 + path: src/Monolog/Logger.php + + - + message: "#^PHPDoc tag @var for variable \\$fiberLogDepth contains generic class Fiber but does not specify its types\\: TStart, TResume, TReturn, TSuspend$#" + count: 2 + path: src/Monolog/Logger.php + + - + message: "#^Property Monolog\\\\Logger\\:\\:\\$fiberLogDepth \\(WeakMap\\\\|null\\) does not accept non\\-empty\\-array\\\\|WeakMap\\\\.$#" + count: 3 + path: src/Monolog/Logger.php + + - + message: "#^Property Monolog\\\\Logger\\:\\:\\$fiberLogDepth with generic class Fiber does not specify its types\\: TStart, TResume, TReturn, TSuspend$#" + count: 1 + path: src/Monolog/Logger.php + + - + message: "#^Method Monolog\\\\Processor\\\\IntrospectionProcessor\\:\\:isTraceClassOrSkippedFunction\\(\\) has parameter \\$trace with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Monolog/Processor/IntrospectionProcessor.php + + - + message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#" + count: 1 + path: src/Monolog/Processor/UidProcessor.php + + - + message: "#^Cannot access offset int on 0\\|0\\.0\\|array\\\\|string\\|false\\|null\\.$#" + count: 1 + path: src/Monolog/SignalHandler.php + + - + message: "#^Dead catch \\- Throwable is never thrown in the try block\\.$#" + count: 1 + path: src/Monolog/Utils.php + + - + message: "#^Parameter \\#2 \\$callback of function preg_replace_callback expects callable\\(array\\\\)\\: string, Closure\\(mixed\\)\\: \\(array\\\\|string\\|false\\) given\\.$#" + count: 1 + path: src/Monolog/Utils.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 6011baa8..b742a81b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,3 +1,6 @@ +includes: + - 'phpstan-baseline.neon' + parameters: level: 8 From a1af771439e4f507f0a87c6b7c8db6bb665b3d5b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Apr 2024 13:29:18 +0200 Subject: [PATCH 4/9] Allow more modern phpunit --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f94037af..a1f08a22 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php-amqplib/php-amqplib": "~2.4 || ^3", "phpspec/prophecy": "^1.15", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.5.14", + "phpunit/phpunit": "^8.5.38 || ^9.6.19", "predis/predis": "^1.1 || ^2.0", "rollbar/rollbar": "^1.3 || ^2 || ^3", "ruflin/elastica": "^7", From f771304e2517605ab6a7e8552e68ed82706b1488 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Apr 2024 13:30:45 +0200 Subject: [PATCH 5/9] Update baseline for php8.0 --- phpstan-baseline.neon | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index aca584a6..1e5240b6 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -10,6 +10,16 @@ parameters: count: 1 path: src/Monolog/Formatter/JsonFormatter.php + - + message: "#^Property SoapFault\\:\\:\\$faultactor \\(string\\) in isset\\(\\) is not nullable\\.$#" + count: 1 + path: src/Monolog/Formatter/LineFormatter.php + + - + message: "#^Property SoapFault\\:\\:\\$faultcode \\(string\\) in isset\\(\\) is not nullable\\.$#" + count: 1 + path: src/Monolog/Formatter/LineFormatter.php + - message: "#^Method Monolog\\\\Formatter\\\\NormalizerFormatter\\:\\:normalize\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -25,6 +35,16 @@ parameters: count: 2 path: src/Monolog/Formatter/NormalizerFormatter.php + - + message: "#^Property SoapFault\\:\\:\\$faultactor \\(string\\) in isset\\(\\) is not nullable\\.$#" + count: 1 + path: src/Monolog/Formatter/NormalizerFormatter.php + + - + message: "#^Property SoapFault\\:\\:\\$faultcode \\(string\\) in isset\\(\\) is not nullable\\.$#" + count: 1 + path: src/Monolog/Formatter/NormalizerFormatter.php + - message: "#^Method Monolog\\\\Formatter\\\\WildfireFormatter\\:\\:normalize\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -90,36 +110,16 @@ parameters: count: 2 path: src/Monolog/Handler/RotatingFileHandler.php - - - message: "#^Invalid array key type Fiber\\.$#" - count: 1 - path: src/Monolog/Logger.php - - message: "#^Method Monolog\\\\Logger\\:\\:__construct\\(\\) has parameter \\$processors with no value type specified in iterable type array\\.$#" count: 2 path: src/Monolog/Logger.php - - message: "#^Offset Fiber does not exist on WeakMap\\\\|null\\.$#" - count: 1 - path: src/Monolog/Logger.php - - - - message: "#^PHPDoc tag @var for variable \\$fiberLogDepth contains generic class Fiber but does not specify its types\\: TStart, TResume, TReturn, TSuspend$#" - count: 2 - path: src/Monolog/Logger.php - - - - message: "#^Property Monolog\\\\Logger\\:\\:\\$fiberLogDepth \\(WeakMap\\\\|null\\) does not accept non\\-empty\\-array\\\\|WeakMap\\\\.$#" + message: "#^Property Monolog\\\\Logger\\:\\:\\$fiberLogDepth \\(WeakMap\\\\|null\\) does not accept non\\-empty\\-array\\\\|WeakMap\\\\.$#" count: 3 path: src/Monolog/Logger.php - - - message: "#^Property Monolog\\\\Logger\\:\\:\\$fiberLogDepth with generic class Fiber does not specify its types\\: TStart, TResume, TReturn, TSuspend$#" - count: 1 - path: src/Monolog/Logger.php - - message: "#^Method Monolog\\\\Processor\\\\IntrospectionProcessor\\:\\:isTraceClassOrSkippedFunction\\(\\) has parameter \\$trace with no value type specified in iterable type array\\.$#" count: 1 From a9129ee202f2c471035c499128263cc534c0a467 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Apr 2024 13:31:51 +0200 Subject: [PATCH 6/9] Update build matrix --- .github/workflows/continuous-integration.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7a0e7f0b..b637a164 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -23,6 +23,8 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" + - "8.3" dependencies: [highest] @@ -35,10 +37,7 @@ jobs: - php-version: "7.2" dependencies: lowest operating-system: ubuntu-latest - - php-version: "8.1" - dependencies: lowest - operating-system: ubuntu-latest - - php-version: "8.2" + - php-version: "8.4" dependencies: highest operating-system: ubuntu-latest composer-options: "--ignore-platform-req=php+" From 91f225e4b6a25c51b134813235b15563f5c9bfa1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Apr 2024 13:36:30 +0200 Subject: [PATCH 7/9] Update build --- .github/workflows/continuous-integration.yml | 8 ++++---- .github/workflows/lint.yml | 4 ++-- .github/workflows/phpstan.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b637a164..da5a5a7d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -44,7 +44,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Run CouchDB timeout-minutes: 3 @@ -54,7 +54,7 @@ jobs: couchdb version: '2.3.1' - name: Run MongoDB - uses: supercharge/mongodb-github-action@1.7.0 + uses: supercharge/mongodb-github-action@1.10.0 with: mongodb-version: 5.0 @@ -133,7 +133,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" # required for elasticsearch - name: Configure sysctl limits @@ -212,7 +212,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" # required for elasticsearch - name: Configure sysctl limits diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a4e44059..708e2299 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,11 +17,11 @@ jobs: matrix: php-version: - "7.2" - - "8.0" + - "8.3" steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 6b375ca1..cc6811f6 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -23,7 +23,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -34,7 +34,7 @@ jobs: - name: Get composer cache directory id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" - name: Cache dependencies uses: actions/cache@v3 @@ -44,7 +44,7 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Add require for mongodb/mongodb to make tests runnable - run: 'composer require ${{ env.COMPOSER_FLAGS }} mongodb/mongodb --dev --no-update' + run: "composer require ${{ env.COMPOSER_FLAGS }} mongodb/mongodb --dev --no-update" - name: "Install latest dependencies" # --ignore-platform-req=php here needed as long as elasticsearch/elasticsearch does not support php 8 From d1422610e9b17f0c2c9edc8989a4e05cad0a17d5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Apr 2024 13:43:28 +0200 Subject: [PATCH 8/9] Fix PHP 8.4 build error --- tests/Monolog/SignalHandlerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Monolog/SignalHandlerTest.php b/tests/Monolog/SignalHandlerTest.php index 8c28fc14..bc511d08 100644 --- a/tests/Monolog/SignalHandlerTest.php +++ b/tests/Monolog/SignalHandlerTest.php @@ -34,7 +34,7 @@ class SignalHandlerTest extends TestCase $this->asyncSignalHandling = pcntl_async_signals(); } if (function_exists('pcntl_sigprocmask')) { - pcntl_sigprocmask(SIG_BLOCK, array(), $this->blockedSignals); + pcntl_sigprocmask(SIG_SETMASK, array(), $this->blockedSignals); } } } @@ -146,7 +146,7 @@ class SignalHandlerTest extends TestCase posix_kill(posix_getpid(), $signo); pcntl_signal_dispatch(); // If $callPrevious is true, SIGINT should terminate by this line. - pcntl_sigprocmask(SIG_BLOCK, array(), $oldset); + pcntl_sigprocmask(SIG_SETMASK, array(), $oldset); file_put_contents($path, implode(' ', $oldset), FILE_APPEND); posix_kill(posix_getpid(), $signo); pcntl_signal_dispatch(); From e7455b79422144de12cc99eaee74f199a406754a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Apr 2024 13:44:53 +0200 Subject: [PATCH 9/9] Bump actions/cache --- .github/workflows/phpstan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index cc6811f6..2effa1eb 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -37,7 +37,7 @@ jobs: run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composercache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}