From 3b866c91859995fcbe4159b4fac3348ca11b006a Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 4 Feb 2023 22:29:31 +0100 Subject: [PATCH 1/3] GitHub Workflows security hardening (#1763) Signed-off-by: Alex --- .github/workflows/continuous-integration.yml | 3 +++ .github/workflows/lint.yml | 3 +++ .github/workflows/phpstan.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index cf50545a..efa84bda 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -4,6 +4,9 @@ on: - push - pull_request +permissions: + contents: read # to fetch code (actions/checkout) + jobs: tests: name: "CI (PHP ${{ matrix.php-version }}, ${{ matrix.dependencies }} deps)" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9e20a03e..a7482ace 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,6 +4,9 @@ on: push: pull_request: +permissions: + contents: read # to fetch code (actions/checkout) + jobs: tests: name: "Lint" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 434324ce..fcf5007e 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -7,6 +7,9 @@ on: env: COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" +permissions: + contents: read # to fetch code (actions/checkout) + jobs: tests: name: "PHPStan" From 7c04005a28658b7b3577620ff17da8a60ee5a7bc Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 4 Feb 2023 22:41:51 +0100 Subject: [PATCH 2/3] Ignore enum errors --- phpstan.neon.dist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 81d47e3e..6011baa8 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -48,3 +48,7 @@ parameters: # php 8.1 Fiber failures - '#unknown class Fiber#' - '#Offset mixed does not exist on WeakMap\|null\.#' + + # php 8.1 Enum failures + - '#Class (UnitEnum|BackedEnum) not found#' + - '#unknown class (UnitEnum|BackedEnum)#' From 1f25f9b3439a811b2350550efe1d8fbf908aa231 Mon Sep 17 00:00:00 2001 From: Tetragramat Date: Sat, 4 Feb 2023 22:53:22 +0100 Subject: [PATCH 3/3] WhatFailureGroupHandler catches failures in method close (#1791) --- src/Monolog/Handler/WhatFailureGroupHandler.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Monolog/Handler/WhatFailureGroupHandler.php b/src/Monolog/Handler/WhatFailureGroupHandler.php index 2dd13672..b6d3d3b1 100644 --- a/src/Monolog/Handler/WhatFailureGroupHandler.php +++ b/src/Monolog/Handler/WhatFailureGroupHandler.php @@ -64,4 +64,18 @@ class WhatFailureGroupHandler extends GroupHandler } } } + + /** + * {@inheritDoc} + */ + public function close(): void + { + foreach ($this->handlers as $handler) { + try { + $handler->close(); + } catch (\Throwable $e) { + // What failure? + } + } + } }