Skip to content

Commit

Permalink
Merge branch '2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Aug 27, 2024
2 parents e0cd5d5 + 23560e3 commit 6772a39
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 60 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- pull_request

permissions:
contents: read # to fetch code (actions/checkout)
contents: read

jobs:
tests:
Expand All @@ -21,6 +21,7 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"

dependencies: [highest]

Expand All @@ -39,8 +40,7 @@ jobs:
composer-options: "--ignore-platform-req=php+"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- uses: "actions/checkout@v4"

- name: Run CouchDB
timeout-minutes: 3
Expand All @@ -54,8 +54,7 @@ jobs:
with:
mongodb-version: 5.0

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
Expand All @@ -71,8 +70,7 @@ jobs:
composer require --no-update --no-interaction --dev elasticsearch/elasticsearch:^7
composer config --no-plugins allow-plugins.ocramius/package-versions true
- name: "Update dependencies with composer"
uses: "ramsey/composer-install@v2"
- uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"
Expand Down Expand Up @@ -114,8 +112,7 @@ jobs:
- "7.17.0"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- uses: "actions/checkout@v4"

# required for elasticsearch
- name: Configure sysctl limits
Expand All @@ -131,8 +128,7 @@ jobs:
with:
stack-version: "${{ matrix.es-version }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
Expand All @@ -147,8 +143,7 @@ jobs:
if: "matrix.php-version == '7.4' && matrix.dependencies == 'lowest'"
run: "composer config allow-plugins.ocramius/package-versions true"

- name: "Update dependencies with composer"
uses: "ramsey/composer-install@v2"
- uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

Expand All @@ -161,7 +156,7 @@ jobs:
composer remove --no-update --dev graylog2/gelf-php ruflin/elastica elasticsearch/elasticsearch rollbar/rollbar
composer require --no-update --no-interaction --dev ruflin/elastica:^7 elasticsearch/elasticsearch:^7
composer require --no-update psr/log:^3
composer update -W
composer update
composer exec phpunit -- --group Elasticsearch,Elastica
tests-es-8:
Expand Down Expand Up @@ -190,8 +185,7 @@ jobs:
- "8.2.0"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- uses: "actions/checkout@v4"

# required for elasticsearch
- name: Configure sysctl limits
Expand All @@ -207,8 +201,7 @@ jobs:
with:
stack-version: "${{ matrix.es-version }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
Expand All @@ -225,8 +218,7 @@ jobs:
if: "matrix.php-version == '7.4' && matrix.dependencies == 'lowest'"
run: "composer config allow-plugins.ocramius/package-versions true"

- name: "Update dependencies with composer"
uses: "ramsey/composer-install@v2"
- uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "PHP Lint"

on:
push:
pull_request:
- push
- pull_request

permissions:
contents: read # to fetch code (actions/checkout)
contents: read

jobs:
tests:
Expand All @@ -17,19 +17,27 @@ jobs:
matrix:
php-version:
- "8.1"
- "8.3"
- "nightly"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- uses: actions/checkout@v4

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: shivammathur/setup-php@v2
with:
coverage: "none"
extensions: "intl"
ini-values: "memory_limit=-1"
php-version: "${{ matrix.php-version }}"
coverage: none

- name: "Lint PHP files"
run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
run: |
hasErrors=0
for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*' ! -path '*/Fixtures/*')
do
{ error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1;
if [ "$error" != "" ]; then
while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error"
hasErrors=1
fi
done
if [ $hasErrors -eq 1 ]; then
exit 1
fi
29 changes: 7 additions & 22 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ on:
- push
- pull_request

env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"

permissions:
contents: read # to fetch code (actions/checkout)
contents: read

jobs:
tests:
Expand All @@ -22,32 +19,20 @@ jobs:
- "8.1"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- uses: actions/checkout@v4

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
coverage: none
extensions: mongodb, redis, amqp

- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
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"

- name: "Install latest dependencies"
run: "composer update ${{ env.COMPOSER_FLAGS }}"
- uses: ramsey/composer-install@v3
with:
dependency-versions: highest

- name: Run PHPStan
run: composer phpstan
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ parameters:
count: 1
path: src/Monolog/Logger.php

-
message: "#^Only numeric types are allowed in post\\-decrement, int\\|null given\\.$#"
count: 1
path: src/Monolog/Logger.php

-
message: "#^Parameter \\#1 \\$level \\('alert'\\|'critical'\\|'debug'\\|'emergency'\\|'error'\\|'info'\\|'notice'\\|'warning'\\|Monolog\\\\Level\\) of method Monolog\\\\Logger\\:\\:log\\(\\) should be contravariant with parameter \\$level \\(mixed\\) of method Psr\\\\Log\\\\LoggerInterface\\:\\:log\\(\\)$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/Monolog/SignalHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function testRegisterCallablePreviousSignalHandler($callPrevious)
$logger = new Logger('test', [$handler = new TestHandler]);
$errHandler = new SignalHandler($logger);
$previousCalled = 0;
pcntl_signal(SIGURG, function ($signo, array $siginfo = null) use (&$previousCalled) {
pcntl_signal(SIGURG, function ($signo, ?array $siginfo = null) use (&$previousCalled) {
++$previousCalled;
});
$errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, $callPrevious, false, false);
Expand Down

0 comments on commit 6772a39

Please sign in to comment.