symfony2admingenerator / AdmingeneratorGeneratorBundle

(old-legacy) Admingenerator for Symfony2, parse generator.yml files to build classes
http://symfony2admingenerator.org/
MIT License
360 stars 125 forks source link

ContextErrorException #816

Closed ndoulgeridis closed 9 years ago

ndoulgeridis commented 9 years ago

I get that error in my production, have an idea why and how to solve it?

[Symfony\Component\Debug\Exception\ContextErrorException]
  Runtime Notice: Declaration of Admingenerator\GeneratorBundle\Command\GenerateAdminAdminCommand::updateRouting
  () should be compatible with Sensio\Bundle\GeneratorBundle\Command\GenerateBundleCommand::updateRouting(Sensio
  \Bundle\GeneratorBundle\Command\Helper\QuestionHelper $questionHelper, Symfony\Component\Console\Input\InputIn
  terface $input, Symfony\Component\Console\Output\OutputInterface $output, $bundle, $format) in /vendor/cedriclombardot/admingenerator-generator-bundle/Admingenerator/GeneratorBundle/Command/GenerateAdminAdminCommand.php line 18

It seems my Symfony 2.5.8 has

protected function updateRouting(QuestionHelper $questionHelper, InputInterface $input, OutputInterface $output, $bundle, $format)

But this bundle overrides it as:

protected function updateRouting(DialogHelper $dialogHelper, InputInterface $input, OutputInterface $output, $bundle, $format)

This issue is related with these pulls:

https://github.com/sensiolabs/SensioGeneratorBundle/commit/59eebd0d067cfbc8d12e509a44cb44f8eea4739a

https://github.com/sensiolabs/SensioGeneratorBundle/commit/0225fcd08e94de2165ffa85de50c3c9d9592e96b

sescandell commented 9 years ago

Yes, this is because you probably updated your dependencies.

Force the generator bundle to be less than 2.5. So you should have something like:

"sension/generator-bundle": "~2.4.0"

See https://github.com/symfony2admingenerator/GeneratorBundle/issues/54

ndoulgeridis commented 9 years ago

Hmm I have it ~2.3 in composer.json but somehow my lock have 2.5... Something wrong is happening, anyway sorry for false alarm please close this issue.

sescandell commented 9 years ago

Hmm I have it ~2.3 in composer.json but somehow my lock have 2.5.

~2.3 is the equivalent to 2.*... so it is normal your locked version is 2.5.x