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

Fix Fixtures\ProviderMock interface violation #169

Merged
merged 1 commit into from Feb 15, 2023

Conversation

luispabon
Copy link
Contributor

@luispabon luispabon commented Sep 6, 2021

Fixes:

bin/console hautelook:fixtures:load
Careful, database will be purged. Do you want to continue y/N ?y

Fatal error: Declaration of Fixtures\ProviderMock::getOptions(Symfony\Component\HttpFoundation\Request $request): void must be compatible with Nelmio\CorsBundle\Options\ProviderInterface::getOptions(Symfony\Component\HttpFoundation\Request $request): array in /var/www/html/vendor/nelmio/cors-bundle/tests/fixtures/ProviderMock.php on line 14
09:12:27 CRITICAL  [php] Fatal Compile Error: Declaration of Fixtures\ProviderMock::getOptions(Symfony\Component\HttpFoundation\Request $request): void must be compatible with Nelmio\CorsBundle\Options\ProviderInterface::getOptions(Symfony\Component\HttpFoundation\Request $request): array ["exception" => Symfony\Component\ErrorHandler\Error\FatalError^ { …}]

In ProviderMock.php line 14:

  Compile Error: Declaration of Fixtures\ProviderMock::getOptions(Symfony\Component\HttpFoundation\Request $request): void must be compatible with Nelmio\CorsBundle\Opt
  ions\ProviderInterface::getOptions(Symfony\Component\HttpFoundation\Request $request): array


hautelook:fixtures:load [-b|--bundle [BUNDLE]] [--no-bundles [NO-BUNDLES]] [-m|--manager MANAGER] [--append] [--shard SHARD] [--purge-with-truncate]

Basically Fixtures\ProviderMock wasn't implementing the ProviderInterface correctly and for some reason this broke one of my projects I'm currently migrating to PHP 8 & symfony 5.3. The symfony compiler all of a sudden chokes on it when running some unrelated console command.

@@ -11,5 +11,5 @@ final class ProviderMock implements ProviderInterface
{
public function __construct() {}

public function getOptions(Request $request): void {}
public function getOptions(Request $request): array {}
Copy link
Contributor Author

@luispabon luispabon Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Seldaek Seldaek merged commit 70fbc62 into nelmio:master Feb 15, 2023
@Seldaek
Copy link
Member

Seldaek commented Feb 15, 2023

Thanks

@luispabon luispabon deleted the fix-provider-mock branch February 15, 2023 12:38
@Seldaek Seldaek mentioned this pull request Feb 15, 2023
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.

None yet

2 participants