Skip to content

Commit 853986d

Browse files
acelayaramunasd
authored andcommitted
Fix deprecation warnings with PHP 8.4
1 parent 5db9a68 commit 853986d

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

.github/workflows/phpunit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
phpseclib: '^3.0'
4646
composer: 'composer:v2'
4747
coverage: none
48+
- php: '8.4'
49+
phpseclib: '^3.0'
50+
composer: 'composer:v2'
51+
coverage: none
4852

4953
name: PHP ${{ matrix.php }} + phpseclib ${{ matrix.phpseclib }}
5054
env:

PhpAmqpLib/Connection/AbstractConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function __construct(
182182
$login_method = 'AMQPLAIN',
183183
$login_response = null,
184184
$locale = 'en_US',
185-
AbstractIO $io = null,
185+
?AbstractIO $io = null,
186186
$heartbeat = 0,
187187
$connection_timeout = 0,
188188
$channel_rpc_timeout = 0.0,

PhpAmqpLib/Exception/AMQPTimeoutException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class AMQPTimeoutException extends \RuntimeException implements AMQPExceptionInt
99
*/
1010
private $timeout;
1111

12-
public function __construct($message = '', $timeout = 0, $code = 0, \Exception $previous = null)
12+
public function __construct($message = '', $timeout = 0, $code = 0, ?\Exception $previous = null)
1313
{
1414
parent::__construct($message, $code, $previous);
1515
$this->timeout = $timeout;

PhpAmqpLib/Wire/AMQPAbstractCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ abstract class AMQPAbstractCollection implements \Iterator, \ArrayAccess
114114
*/
115115
protected $data = array();
116116

117-
public function __construct(array $data = null)
117+
public function __construct(?array $data = null)
118118
{
119119
if (!empty($data)) {
120120
$this->data = $this->encodeCollection($data);

PhpAmqpLib/Wire/AMQPArray.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class AMQPArray extends AMQPAbstractCollection
88
/**
99
* @param array|null $data
1010
*/
11-
public function __construct(array $data = null)
11+
public function __construct(?array $data = null)
1212
{
1313
parent::__construct(empty($data) ? null : array_values($data));
1414
}

0 commit comments

Comments
 (0)