diff --git a/.github/workflows/php-package-ci.yml b/.github/workflows/php-package-ci.yml index 4d09b1a5..853a3634 100644 --- a/.github/workflows/php-package-ci.yml +++ b/.github/workflows/php-package-ci.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [ 7.4, 8.0 ] + php: [ 7.4, 8.0, 8.1 ] steps: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v2 diff --git a/composer.json b/composer.json index 666d59f5..7e7f9a9b 100644 --- a/composer.json +++ b/composer.json @@ -19,14 +19,14 @@ "php": "^7.4 | ^8.0", "nette/di": "^3.0", "nette/utils": "^3.0", - "php-amqplib/php-amqplib": "~3.0.0" + "php-amqplib/php-amqplib": "~3.1.0" }, "require-dev": { "kdyby/console": "~2.8", "nette/bootstrap": "~3.0", "latte/latte": "~2.4", "tracy/tracy": "~2.4", - "phpstan/phpstan": "^0.12.88", + "phpstan/phpstan": "^1.4", "php-coveralls/php-coveralls": "^2.1", "nette/tester": "^2.3.2", "mockery/mockery": "~1.3.0", diff --git a/src/Kdyby/RabbitMq/Consumer.php b/src/Kdyby/RabbitMq/Consumer.php index 59578792..9042662a 100644 --- a/src/Kdyby/RabbitMq/Consumer.php +++ b/src/Kdyby/RabbitMq/Consumer.php @@ -82,13 +82,13 @@ public function consume(int $msgAmount): void $this->setupConsumer(); $this->onStart($this); - $previousErrorHandler = \set_error_handler(static function ($severity, $message, $file, $line, $context) use (&$previousErrorHandler) { - if (!\preg_match('~stream_select\\(\\)~i', $message)) { + $previousErrorHandler = \set_error_handler(static function (int $errno, string $errstr, string $errfile, int $errline) use (&$previousErrorHandler) { + if (!\preg_match('~stream_select\\(\\)~i', $errstr)) { $args = \func_get_args(); return \call_user_func_array($previousErrorHandler, $args); } - throw new \PhpAmqpLib\Exception\AMQPRuntimeException($message . ' in ' . $file . ':' . $line, (int) $severity); + throw new \PhpAmqpLib\Exception\AMQPRuntimeException($errstr . ' in ' . $errfile . ':' . $errline, $errno); }); try {