phptek / silverstripe-sentry

Flexible Sentry compatible bug aggregation client for Silverstripe applications.
BSD 3-Clause "New" or "Revised" License
11 stars 22 forks source link

v4: PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in /path/to/vendor/phptek/sentry/src/Adaptor/SentryAdaptor.php on line 157 #71

Closed elliot-sawyer closed 2 years ago

elliot-sawyer commented 2 years ago
PHP Warning:  array_merge(): Expected parameter 1 to be an array, null given in /path/to/vendor/phptek/sentry/src/Adaptor/SentryAdaptor.php on line 157
PHP Fatal error:  Uncaught TypeError: Return value of PhpTek\Sentry\Adaptor\SentryAdaptor::get_opts() must be of the type array, null returned in /path/to/vendor/phptek/sentry/src/Adaptor/SentryAdaptor.php:171

I have SENTRY_DSN defined in my .env and also tried inserting via Injector, but getting the above error on v4. Rolling back to 3.0.10 resolves the issue.

Calling dump/die of $optsConfig shows that it returns null, presumably because private static opts; is not defined. This will cause array_merge to fail

elliot-sawyer commented 2 years ago

PR here https://github.com/phptek/silverstripe-sentry/pull/72

phptek commented 2 years ago

Closing. Merged in #73