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

TASK: Use correct @template-covariant tag for ProjectionFactoryInterface #5099

Conversation

mhsdesign
Copy link
Member

See also 329330e

See https://phpstan.org/blog/whats-up-with-template-covariant

Solves that

$projectionsFactory = new ProjectionsAndCatchUpHooksFactory();
$projectionsFactory->registerFactory(new DoctrineDbalContentGraphProjectionFactory($this->dbalClient), []);

yields when being used stand alone:

  172    Parameter #1 $factory of method Neos\ContentRepository\Core\Factory\ProjectionsAndCatchUpHooksFactory::registerFactory() expects                                                                                                                                                            
         Neos\ContentRepository\Core\Projection\ProjectionFactoryInterface<Neos\ContentRepository\Core\Projection\ProjectionInterface<Neos\ContentRepository\Core\Projection\ProjectionStateInterface>>, Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjectionFactory given.      
         💡 Template type T on class Neos\ContentRepository\Core\Projection\ProjectionFactoryInterface is not covariant. Learn more: https://phpstan.org/blog/whats-up-with-template-covariant                                                                                                       
         ✏️  file:///Users/marchenryschultz/Code/lab/standalone-content-repository/src/StandaloneContentRepositoryRegistry.php:172  

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@mhsdesign mhsdesign merged commit 6d9f639 into neos:9.0 Jun 13, 2024
9 checks passed
@mhsdesign mhsdesign deleted the task/adjustGenericsTemplateTagForProjectionFactoryInterface branch June 13, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants