Skip to content

Merge Request created_after not valid. #262

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

Closed
piegus opened this issue Oct 4, 2017 · 0 comments · Fixed by #297
Closed

Merge Request created_after not valid. #262

piegus opened this issue Oct 4, 2017 · 0 comments · Fixed by #297

Comments

@piegus
Copy link

piegus commented Oct 4, 2017

[Wed Oct  4 22:11:47 2017] PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Gitlab\Api\MergeRequests::Gitlab\Api\{closure}() must implement interface DateTimeInterface, instance of Symfony\Component\OptionsResolver\OptionsResolver given, called in project/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php on line 885 in project/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/MergeRequests.php:39
Stack trace:
#0 project/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php(885): Gitlab\Api\MergeRequests->Gitlab\Api\{closure}(Object(Symfony\Component\OptionsResolver\OptionsResolver), Object(DateTime))
#1 project/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php(716): Symfony\Component\OptionsResolver\OptionsResolver->offsetGet('created_a in project/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/MergeRequests.php on line 39

Apparenty setNOrmalizer i MegreRequest is throwing flatal error With Option Resolver.
Changing from:

$datetimeNormalizer = function (\DateTimeInterface $value) { return $value->format('c'); };
to:
$datetimeNormalizer = function (Options $options, $value) { return $value->format('c'); }; seems to fix the issue.

https://symfony.com/doc/current/components/options_resolver.html#option-normalization
Im using symfony3.3

m-bymike added a commit to m-bymike/php-gitlab-api that referenced this issue Feb 22, 2018
m-bymike added a commit to m-bymike/php-gitlab-api that referenced this issue Feb 23, 2018
thomxc pushed a commit to thomxc/php-gitlab-api that referenced this issue Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant