Skip to content

Fix autowiring #913

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

Merged
merged 1 commit into from
Feb 7, 2020
Merged

Fix autowiring #913

merged 1 commit into from
Feb 7, 2020

Conversation

toooni
Copy link
Contributor

@toooni toooni commented Feb 6, 2020

Autowiring doesn't work for me without autowire: true in services.yml and using the Container as typehint doesn result in the following message:

Cannot autowire service "ONGR\ElasticsearchBundle\Command\CacheClearCommand": argument "$container" of method "ONGR\ElasticsearchBundle\Command\AbstractIndexServiceAwareCommand::__construct()" references class "Symfony\Component\DependencyInject
ion\Container" but no such service exists. Try changing the type-hint to one of its parents: interface "Psr\Container\ContainerInterface", or interface "Symfony\Component\DependencyInjection\ContainerInterface".

@toooni
Copy link
Contributor Author

toooni commented Feb 7, 2020

Travis-ci was failing because of an unrelated while trying to download something, so I re-pushed the branch.

@toooni toooni requested a review from saimaz February 7, 2020 08:02
@saimaz saimaz changed the base branch from master to 7.0 February 7, 2020 08:19
@codecov-io
Copy link

Codecov Report

Merging #913 into 7.0 will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##                7.0     #913   +/-   ##
=========================================
  Coverage     83.16%   83.16%           
  Complexity      413      413           
=========================================
  Files            39       39           
  Lines          1360     1360           
=========================================
  Hits           1131     1131           
  Misses          229      229
Impacted Files Coverage Δ Complexity Δ
Command/AbstractIndexServiceAwareCommand.php 100% <100%> (ø) 6 <2> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1a6398...4122bbe. Read the comment docs.

@saimaz saimaz merged commit 428d21e into ongr-io:7.0 Feb 7, 2020
@patie
Copy link

patie commented Feb 8, 2020

can you please fix also for v6 bundle and symfony 4.4? thanks!

In AbstractIndexServiceAwareCommand.php line 27:

  Too few arguments to function ONGR\ElasticsearchBundle\Command\AbstractIndexServiceAwareCommand::__construct(), 0 passed in /home/www/xxx/
  home/patie/subdomains/nw-api/var/cache/dev/Container6RY9hyi/getCacheClearCommandService.php on line 13 and exactly 1 expected


In AbstractIndexServiceAwareCommand.php line 27:

  Too few arguments to function ONGR\ElasticsearchBundle\Command\AbstractIndexServiceAwareCommand::__construct(), 0 passed in /home/www/xxx/
  home/patie/subdomains/nw-api/var/cache/dev/Container6RY9hyi/getIndexCreateCommandService.php on line 13 and exactly 1 expected


In AbstractIndexServiceAwareCommand.php line 27:

  Too few arguments to function ONGR\ElasticsearchBundle\Command\AbstractIndexServiceAwareCommand::__construct(), 0 passed in /home/www/xxx/
  home/patie/subdomains/nw-api/var/cache/dev/Container6RY9hyi/getIndexDropCommandService.php on line 13 and exactly 1 expected


In AbstractIndexServiceAwareCommand.php line 27:

  Too few arguments to function ONGR\ElasticsearchBundle\Command\AbstractIndexServiceAwareCommand::__construct(), 0 passed in /home/www/xxx/
  home/patie/subdomains/nw-api/var/cache/dev/Container6RY9hyi/getIndexExportCommandService.php on line 13 and exactly 1 expected


In AbstractIndexServiceAwareCommand.php line 27:

  Too few arguments to function ONGR\ElasticsearchBundle\Command\AbstractIndexServiceAwareCommand::__construct(), 0 passed in /home/www/xxx/
  home/patie/subdomains/nw-api/var/cache/dev/Container6RY9hyi/getIndexImportCommandService.php on line 13 and exactly 1 expected

@toooni
Copy link
Contributor Author

toooni commented Feb 10, 2020

@patie It would have been easy for you to create a PR with e cherry-pick from the 7.0 fix. It took me like a minute for #915. You're welcome.

@saimaz
Copy link
Contributor

saimaz commented Feb 10, 2020

Didn't notice it is also a problem for v6, will cherry-pick it with the next release of v6

@toooni
Copy link
Contributor Author

toooni commented Feb 10, 2020

@saimaz I already made the PR 👍

@patie
Copy link

patie commented Feb 10, 2020

@toooni @saimaz its wierd, i have still the same problem with too few arguments in AbstractIndexServiceAwareCommand in ~6.2 and Sf4.4, any idea please? thanks

@saimaz
Copy link
Contributor

saimaz commented Feb 10, 2020

It's not released yet. I will release it in the evening.

@patie
Copy link

patie commented Feb 10, 2020

dont work even with 6.2.x-dev#04d452a, but maybe you need do more, i will wait till tommorow, thanks for bundle

EDIT: and the same problem is with version 7 with Symfony 4.4

@toooni
Copy link
Contributor Author

toooni commented Feb 10, 2020

@patie clearing the cache might not be enough. Delete the symfony cache/dev folder.

@patie
Copy link

patie commented Feb 10, 2020

deleted but dont work anyway, now do refactor on our project for upgrade to sf5

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.

4 participants