-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add Pagination and missing fields/endpoints [#15] #43
Conversation
@OGKevin Please check if it is good with PHP 5.6 and assign to @andrederoos once reviewed (don't merge yet!) Yeeah, that's a lot :D |
@OGKevin oh yep, that was 5.6! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments and questions 🤔
*/ | ||
protected $pinCodeAssignment; | ||
|
||
/** | ||
* ID of the MA to be used as fallback for this card if insufficient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not generated right ? 😁 Please spell out monetary account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OGKevin What makes you think it is not generated? src/Model/Generated/Card.php
:D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaahhhhh .gitattributes, will make PR tonight.
src/Http/Pagination.php
Outdated
protected $count; | ||
|
||
/** | ||
* @param string[][] $paginationJson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a nested array correct ?
{ | ||
$this->pinCodeAssignment = $pinCodeAssignment; | ||
} | ||
|
||
/** | ||
* ID of the MA to be used as fallback for this card if insufficient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Model/Generated/Card.php
protected $pinCodeAssignment; | ||
|
||
/** | ||
* ID of the MA to be used as fallback for this card if insufficient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Model/Generated/CardDebit.php
} | ||
|
||
/** | ||
* ID of the MA to be used as fallback for this card if insufficient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Monterey account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Model/Generated/CardDebit.php
@OGKevin Please take a look and assign to @andrederoos if it is OK :) |
Ok LGTM, @andrederoos please review, but do not merge yet. Need to run tests after your review 🥇 |
@dnl-blkv all tests passing on 7.1, please include tests for pagination as we discussed. |
@OGKevin this is now also ready for review; tests passing! Please take a look and then assign to @andrederoos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tests passing.
src/Http/ApiClient.php
Outdated
$headers = []; | ||
|
||
foreach ($response->getHeaders() as $headerKey => $headerValues) { | ||
$headers[$headerKey] = join(self::GLUE_HEADER_VALUE, $headerValues); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was not familiar with this alias, please use implode(). why php introduces aliases is a big mystery ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
/** | ||
* @return Pagination|null | ||
*/ | ||
public function getPagination() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getPaginationOrNull? I think really helps making code breaks less... your call..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the problem with the absence of proper notion of nullability in PHP. With PHP 7.1 we will have it, and IDE will be able to say "hey, it can be null!". I'd just leave it as is because then with PHP 7.1 this won't need to be changed back.
In Java, for instance, we do not need to say orNull
because IDEs do it for us :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed
Fixes #15