PHPGit icon indicating copy to clipboard operation
PHPGit copied to clipboard

When committing whithout setting options setting the default options throws exception.

Open macdoggie78 opened this issue 8 years ago • 4 comments

[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: Missing argument 2 for Symfony\Component\OptionsResolver\OptionsResolver::setAllowedValues(), called in /home/2revlect2/vendor/kzykhys/git/src/PHPGit/Command/CommitCommand.php on line 84 and defined

macdoggie78 avatar Dec 09 '16 15:12 macdoggie78

+1

jpcercal avatar Dec 15 '16 12:12 jpcercal

I found a solution to this problem.

I was running the Symfony 3 components here, and the API of the third version of Symfony isn't compatible with this library. So, to solve it just force your project to run in Symfony 2 compatible putting this in your composer.json file.

"symfony/options-resolver": "^2.8"

Just to know:

How Symfony2 defines the method:

OptionsResolverInterface setAllowedValues(array $allowedValues)

How Symfony3 defines the method:

OptionsResolverInterface setAllowedValues(string $option, array $allowedValues = null)

Mr. @kzykhys, I was thinking to make a pull request to this project to update the composer.json file or to upgrade this library to use Symfony3 components. What do you think about it?

jpcercal avatar Dec 15 '16 13:12 jpcercal

+1

jaapromijn avatar Jan 12 '17 14:01 jaapromijn

+1

tmloberon avatar Sep 19 '17 11:09 tmloberon