bunq / tinker_php

Install Tinker by just running this command: bash <(curl -s https://tinker.bunq.com/php/setup.sh)
MIT License
7 stars 8 forks source link

fixing UserPerson:update call #28

Closed goergisn closed 6 years ago

goergisn commented 6 years ago

adding the user id to the update call to actually make it work

OGKevin commented 6 years ago

Are you sure everything is up to date ?

The SDK auto determines the User id.

See: https://github.com/bunq/sdk_php/blob/master/src/Model/Generated/Endpoint/UserPerson.php#L698-L734

And hiiiiii btw 😁

goergisn commented 6 years ago

Hi :P

I ran the tinker "install" script from the website about half an hour ago and was faced with:

`PHP Fatal error: Uncaught TypeError: Argument 1 passed to bunq\Model\Generated\Endpoint\UserPerson::update() must be of the type integer, null given, called in /srv/bunq/src/BunqLib.php on line 468 and defined in /srv/bunq/vendor/bunq/sdk_php/src/Model/Generated/Endpoint/UserPerson.php:698 Stack trace:

0 /srv/bunq/src/BunqLib.php(468): bunq\Model\Generated\Endpoint\UserPerson::update(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, Array)`

when trying to add a callback url 😬

OGKevin commented 6 years ago

Ehh, can you check which version of the sdk it installed 🤔

goergisn commented 6 years ago

Mhh... ok I can see that it's not the most up to date version apparently as I still have this in there:

public static function update( int $userPersonId, string $firstName = null, string $middleName = null,

OGKevin commented 6 years ago

Oh I see whats is going on 🤦🏾‍♂️. So composer.lock is locked at 1.0.0 where in 1.0.1 it has been properly regenerated and auto determines the user id.

So to fix this for you locally, you must run composer update.

And make an MR that updates the composer.lock 😁

goergisn commented 6 years ago

ok cool, closing then :P