PHPGit icon indicating copy to clipboard operation
PHPGit copied to clipboard

PHP Catchable fatal error in vendor/kzykhys/git/src/PHPGit/Command/LogCommand.php

Open ankalagon opened this issue 9 years ago • 1 comments

In newest version I get this kind of error: PHP Catchable fatal error: Argument 1 passed to PHPGit\Command\LogCommand::setDefaultOptions() must be an instance of Symfony\Component\OptionsResolver\OptionsResolverInterface, instance of Symfony\Component\OptionsResolver\OptionsResolver given, called in /path/vendor/kzykhys/git/src/PHPGit/Command.php on line 40 and defined in /path/vendor/kzykhys/git/src/PHPGit/Command/LogCommand.php on line 97

Changing: public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'limit' => 10, 'skip' => 0 )); }

to this: public function setDefaultOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver) { $resolver->setDefaults(array( 'limit' => 10, 'skip' => 0 )); }

fix problem.

Problem occured while:

$this->_git->log('1.2.1..1.2.3', '', array('limit' => 1000));

ankalagon avatar Jan 28 '16 20:01 ankalagon

i got the same error with the StatusCommand (and you may get the error with every command) PHP Catchable fatal error: Argument 1 passed to PHPGit\Command\StatusCommand::setDefaultOptions() must be an instance of Symfony\Component\OptionsResolver\OptionsResolverInterface, instance of Symfony\Component\OptionsResolver\OptionsResolver given, called in vendor/kzykhys/git/src/PHPGit/Command.php on line 40 and defined in vendor/kzykhys/git/src/PHPGit/Command/StatusCommand.php on line 140

Thorbijoern avatar Aug 17 '16 13:08 Thorbijoern