Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Relic Reporting : Monospice\LaravelRedisSentinel\Horizon\HorizonServiceBindings::getIterator() should either be compatible with IteratorAggregate::getIterator() #41

Open
TheFrankman opened this issue Mar 30, 2022 · 1 comment

Comments

@TheFrankman
Copy link

Hello there,

Since upgrading to PHP8.1 New Relic is alive with the below error.

I can't actually see these logs in Laravel.log or the Horizon.log - I also can't confirm that it's even real since New Relic has been unreliable since 8.1 but I'm wondering if anyone else is experiencing this issue at all ?

I am on "monospice/laravel-redis-sentinel-drivers": "^2.7" (2.x-dev) perhaps i'm just being stupid and i'm on the wrong version of the driver.

Any assistance / thoughts would be great.

Return type of Monospice\LaravelRedisSentinel\Horizon\HorizonServiceBindings::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
                in Composer\Autoload\includeFile called at /var/www/hidden/vendor/composer/ClassLoader.php (428)
                                                  /in Composer\Autoload\ClassLoader::loadClass called at ? (?)
              in is_a called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (371)
…:createMonologDriver called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (210)
…\LogManager::resolve called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (125)
…\Log\LogManager::get called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (112)
…g\LogManager::driver called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (101)
…lled at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php (101)
…lled at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php (72)
@TheFrankman
Copy link
Author

By the way, i have fixed this in my fork as the error suggests : adding #[\ReturnTypeWillChange] to HorizonServiceBindings::getIterator() like so :

/**
     * Get an iterator for the service bindings so we can iterate over an
     * instance of this class.
     *
     * @return ArrayIterator
     */
    #[\ReturnTypeWillChange]
    public function getIterator()
    {
        return new ArrayIterator($this->serviceBindings);
    }

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

No branches or pull requests

1 participant