8p / EightPointsGuzzleBundle

⛽️ Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony
MIT License
440 stars 71 forks source link

Error encountered when creating new plugin #297

Closed alexandrubau closed 4 years ago

alexandrubau commented 4 years ago

Upon trying to create a new plugin using the steps from here, I encounter the following error:

PHP Fatal error:  Declaration of Symfony\Component\HttpKernel\Bundle\Bundle::boot() must be compatible with EightPoints\Bundle\GuzzleBundle\PluginInterface::boot(): void in /var/www/html/src/Service/Api/Plugin/AuthorizationPlugin.php on line 37

and

PHP Fatal error:  Declaration of Symfony\Component\HttpKernel\Bundle\Bundle::build(Symfony\Component\DependencyInjection\ContainerBuilder $container) must be compatible with EightPoints\Bundle\GuzzleBundle\PluginInterface::build(Symfony\Component\DependencyInjection\ContainerBuilder $container): void in /var/www/html/src/Service/Api/Plugin/AuthorizationPlugin.php on line 54

This happens because the methods boot() and build() have return type set to void in EightPoints\Bundle\GuzzleBundle\PluginInterface but the Symfony\Component\HttpKernel\Bundle\Bundle class doesn't specify them.

Q A
Symfony version 4.4
Bundle version 8.0
alexandrubau commented 4 years ago

Problem solved by downgrading Bundle Version from 8.0 to 7.5.

gregurco commented 4 years ago

@alexandrubau thank's for hint. Now you can use v8.