Page MenuHomeDevCentral

Upgrade php-amqplib/php-amqplib in keruald/broker
Closed, ResolvedPublic

Description

Notifications Center raised several warnings with keruald/broker 0.4.1:

  • mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/wwwroot/default/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPReader.php on line 62
  • Return type of PhpAmqpLib\Wire\AMQPAbstractCollection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/wwwroot/default/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPAbstractCollection.php on line 437 and same for other iterator methods

Can we upgrade php-amqplib to last version and report/fix this upstream if needed?

Source: https://sentry.nasqueron.org/organizations/nasqueron/performance/notifications-center:a91e6e4a67e745078fab8165af74f7fb/

Event Timeline

Note: keruald/broker is currently still an autonmouse repository, so fix will be in rKBROKER, and not rKERUALD

Full deprecations list when running tests:

1Switching to Composer phpunit:
2PHPUnit 10.0.16 by Sebastian Bergmann and contributors.
3
4Runtime: PHP 8.1.16
5Configuration: /tmp/broker/phpunit.xml
6
7D..D... 7 / 7 (100%)
8
9Time: 00:00.137, Memory: 8.00 MB
10
11There were 2 PHP deprecations:
12
131) Keruald\Broker\Tests\AMQPBrokerTest::testFluencyPattern
14* Optional parameter $vhost declared before required parameter $io is implicitly treated as a required parameter
15
16* Optional parameter $insist declared before required parameter $io is implicitly treated as a required parameter
17
18* Optional parameter $login_method declared before required parameter $io is implicitly treated as a required parameter
19
20* Optional parameter $login_response declared before required parameter $io is implicitly treated as a required parameter
21
22* Optional parameter $locale declared before required parameter $io is implicitly treated as a required parameter
23
24* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
25
26* Return type of PhpAmqpLib\Wire\AMQPAbstractCollection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
27
28* Return type of PhpAmqpLib\Wire\AMQPAbstractCollection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
29
30* Return type of PhpAmqpLib\Wire\AMQPAbstractCollection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
31
32* Return type of PhpAmqpLib\Wire\AMQPAbstractCollection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
33
34* Return type of PhpAmqpLib\Wire\AMQPAbstractCollection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
35
36* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
37
38* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
39
40* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
41
42* Optional parameter $version_major declared before required parameter $server_properties is implicitly treated as a required parameter
43
44* Optional parameter $version_minor declared before required parameter $server_properties is implicitly treated as a required parameter
45
46* Optional parameter $reply_text declared before required parameter $method_id is implicitly treated as a required parameter
47
48* Optional parameter $reply_text declared before required parameter $method_id is implicitly treated as a required parameter
49
50* Optional parameter $ticket declared before required parameter $exchange is implicitly treated as a required parameter
51
52* Optional parameter $ticket declared before required parameter $exchange is implicitly treated as a required parameter
53
54* Optional parameter $ticket declared before required parameter $source is implicitly treated as a required parameter
55
56* Optional parameter $ticket declared before required parameter $source is implicitly treated as a required parameter
57
58* Optional parameter $ticket declared before required parameter $exchange is implicitly treated as a required parameter
59
60* Optional parameter $queue declared before required parameter $exchange is implicitly treated as a required parameter
61
62* Optional parameter $ticket declared before required parameter $exchange is implicitly treated as a required parameter
63
64* Optional parameter $queue declared before required parameter $exchange is implicitly treated as a required parameter
65
66* Optional parameter $reply_text declared before required parameter $routing_key is implicitly treated as a required parameter
67
68* Optional parameter $redelivered declared before required parameter $routing_key is implicitly treated as a required parameter
69
70* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
71
72* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
73
74* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
75
76* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
77
78/tmp/broker/tests/AMQPBrokerTest.php:17
79
802) Keruald\Broker\Tests\BrokerFactoryTest::testValidParameters
81* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
82
83* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
84
85* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
86
87* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
88
89* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
90
91* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
92
93* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
94
95* mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
96
97/tmp/broker/tests/BrokerFactoryTest.php:9
98
99OK, but some tests have issues!
100Tests: 7, Assertions: 14, Deprecations: 2.

dereckson triaged this task as Normal priority.EditedMar 16 2023, 00:35
dereckson moved this task from Backlog to Working on on the Notifications center board.

Now the Notifications Center has the sockets extension, we can create a new keruald/broker release and upgrade version in rNOTIF composer.json.

Deployed, no more warning according Sentry.