Skip to content

Issue #105: Added nullable flag to $certClient - #108

Merged
micoreyes merged 1 commit into
MOODLE_404_STABLEfrom
MOODLE_404_STABLE-issue105
Jul 17, 2026
Merged

Issue #105: Added nullable flag to $certClient#108
micoreyes merged 1 commit into
MOODLE_404_STABLEfrom
MOODLE_404_STABLE-issue105

Conversation

@niko-hoogeveen

Copy link
Copy Markdown
Contributor

Closes issue #105.

Updated aws::MessageValidator constructor with ? nullable flag for $certClient to fix deprecation warning during unit tests.

Environment

- Moodle 5.1.5+ (Build: 20260714)
- PHP: 8.4.22
- DB: MySQL 8.4
- PHPUnit: 11.5.55
- Branch: MOODLE_404_STABLE

Testing instructions:

  • tool_emailutils test suite: vendor/bin/phpunit --testsuite tool_emailutils_testsuite
  • Running the unit tests for tool_emailutils will produce the following warning (on the above environment):
Moodle 5.1.5+ (Build: 20260714)
Php: 8.4.22, mysqli: 8.4.10, OS: Linux 6.17.0-1028-oem x86_64
PHPUnit 11.5.55 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.22
Configuration: /var/www/upstream-plugins/phpunit.xml

SD......................                                          24 / 24 (100%)

Time: 00:02.132, Memory: 74.50 MB

1 test triggered 1 PHP deprecation:

1) /var/www/upstream-plugins/public/admin/tool/emailutils/lib/aws-sns-message-validator/src/MessageValidator.php:64
Aws\Sns\MessageValidator::__construct(): Implicitly marking parameter $certClient as nullable is deprecated, the explicit nullable type must be used instead

Triggered by:

* tool_emailutils\sns_client_test::test_lib
  /var/www/upstream-plugins/public/admin/tool/emailutils/tests/sns_client_test.php:43

OK, but there were issues!
Tests: 24, Assertions: 65, Deprecations: 1, PHPUnit Deprecations: 7, Skipped: 1.

Expected Output from PHPUnit Tests

  • Pulling this branch MOODLE_404_STABLE-issue105 and re-running the testsuite:
Moodle 5.1.5+ (Build: 20260714)
Php: 8.4.22, mysqli: 8.4.10, OS: Linux 6.17.0-1028-oem x86_64
PHPUnit 11.5.55 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.22
Configuration: /var/www/upstream-plugins/phpunit.xml

S.......................                                          24 / 24 (100%)

Time: 00:02.144, Memory: 72.50 MB

OK, but there were issues!
Tests: 24, Assertions: 65, PHPUnit Deprecations: 7, Skipped: 1.

@micoreyes
micoreyes self-requested a review July 17, 2026 16:18
@micoreyes

micoreyes commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

LGTM code changes is safe and it fixes PHP deprecation waning

The code change is safe and low risk it only makes the str_getcsv() arguments explicit, so the behavior should remain unchanged while fixing the PHP deprecation warning.

Result after pulling featurebranch

501

root@840eefc78542:/var/www/catalystupstream501# vendor/bin/phpunit --testsuite tool_emailutils_testsuite
Moodle 5.1.5+ (Build: 20260714)
Php: 8.4.23, pgsql: 17.10 (Debian 17.10-1.pgdg13+1), OS: Linux 6.17.0-40-generic x86_64
PHPUnit 11.5.55 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.23
Configuration: /var/www/catalystupstream501/phpunit.xml

S.......................                                          24 / 24 (100%)

Time: 00:01.712, Memory: 72.50 MB

OK, but there were issues!
Tests: 24, Assertions: 65, PHPUnit Deprecations: 7, Skipped: 1.

405

root@31331fa89c70:/var/www/catalystupstream405# vendor/bin/phpunit --testsuite tool_emailutils_testsuite
Moodle 4.5.12+ (Build: 20260714), 13e8d928852cb7dea57b1fad11d5946d244e8899
Php: 8.3.32, pgsql: 17.10 (Debian 17.10-1.pgdg13+1), OS: Linux 6.17.0-40-generic x86_64
PHPUnit 9.6.34 by Sebastian Bergmann and contributors.

S.......................                                          24 / 24 (100%)

Time: 00:01.668, Memory: 74.50 MB

OK, but incomplete, skipped, or risky tests!
Tests: 24, Assertions: 61, Skipped: 1.

@micoreyes
micoreyes merged commit 9e0a8df into MOODLE_404_STABLE Jul 17, 2026
30 of 31 checks passed
@micoreyes
micoreyes deleted the MOODLE_404_STABLE-issue105 branch July 17, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants