Skip to content

Conversation

Copy link

Copilot AI commented Jan 15, 2026

PHP 8.4 deprecates implicit nullable types. The getBooleanOption method signature had array $options = null, which triggers a deprecation warning since the typed parameter defaults to null without explicit nullable marking.

Changes

  • Updated method signature to use explicit nullable type: ?array $options = null
  • Updated PHPDoc from @param array $options to @param array|null $options

Before:

public function getBooleanOption($name, array $options = null, $default = null)

After:

public function getBooleanOption($name, ?array $options = null, $default = null)

This maintains full backward compatibility while satisfying PHP 8.4's type requirements.

Original prompt

This section details on the original issue you should resolve

<issue_title>Deprecation warning</issue_title>
<issue_description>From https://forum.modmore.com/t/alpacka-deprecation-messages-on-php-8-4/2679:

I’m experiencing deprecation warnings with MoreGallery in my MODX installation running on PHP 8.4. The warnings appear to be coming from the Alpacka dependency.

I have some PHP CLI scripts that include MODX object (use MODX\Revolution\modX;), and that is enough to raise this erorr message in every output of this script.

Error Message:

Deprecated: modmore\Alpacka\Alpacka::getBooleanOption(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/core/components/moregallery/vendor/modmore/alpacka/core/components/alpacka/src/Alpacka.php on line 541

Environment:

MODX Revolution: 3.1.2
PHP Version: 8.4
MoreGallery: 1.18.0-rc1

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix deprecation warning in MoreGallery for PHP 8.4 Fix PHP 8.4 deprecation warning for implicit nullable type in getBooleanOption Jan 15, 2026
Copilot AI requested a review from Mark-H January 15, 2026 15:03
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.

Deprecation warning

2 participants