PHPGit
PHPGit copied to clipboard
PHP Catchable fatal error in vendor/kzykhys/git/src/PHPGit/Command/LogCommand.php
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));
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