-
Notifications
You must be signed in to change notification settings - Fork 12
Modified Product model according to v19 API #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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #54 +/- ##
============================================
- Coverage 99.10% 98.79% -0.32%
- Complexity 397 481 +84
============================================
Files 52 67 +15
Lines 1009 1243 +234
============================================
+ Hits 1000 1228 +228
- Misses 9 15 +6
Continue to review full report at Codecov.
|
…ng to code standard
…ordingly to avoid Model collisions
…v workarround to clean columns, now not needed
|
|
||
| use Connect\Model; | ||
|
|
||
| class PCBilling extends Model |
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.
PC prefix is really required here?
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.
Yes, 100% due collisions on how Connect models same models in different places
src/Model.php
Outdated
| case 'object': | ||
|
|
||
| $namespaces = ['\Connect\\', '\Connect\Usage\\']; | ||
| $namespaces = ['\Connect\\', '\Connect\Usage\\', '\Connect\Product\Capabilities\\', 'Connect\Product\Actions\\', 'Connect\Subscription\\']; |
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.
line too long? probably worth to put every namespace on own line
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.
OK
src/Modules/Directory.php
Outdated
| public function getProduct($productID) | ||
| { | ||
| $body = $this->sendRequest('GET', '/products/'.$productID); | ||
| $body = $this->sendRequest('GET', '/products/' . $productID); |
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.
why not via constant like in tier-configs?
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.
Sure.....this had been introduced and i'm adopting everywhere when possible....
i added in Directory usage of constants now.
| if ($filters instanceof \Connect\RQL\Query) { | ||
| $query = $filters; | ||
| } elseif (is_array($filters)) { | ||
| $query = new \Connect\RQL\Query($filters); | ||
| } else { | ||
| $query = new \Connect\RQL\Query(); | ||
| } |
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.
probably worth to simplify it as
$query = new \Connect\RQL\Query($filters)
and hide all logic in Query constructor, I seen exactly such block in other places
| if ($filters instanceof \Connect\RQL\Query) { | ||
| $query = $filters; | ||
| } elseif (is_array($filters)) { | ||
| $query = new \Connect\RQL\Query($filters); | ||
| } else { | ||
| $query = new \Connect\RQL\Query(); | ||
| } |
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.
see above about query
| $query = new \Connect\RQL\Query(); | ||
|
|
||
| if (is_array($filters)) { | ||
| $query = new \Connect\RQL\Query($filters); | ||
| } elseif ($filters instanceof \Connect\RQL\Query) { | ||
| $query = $filters; | ||
| } |
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.
see above about Query
| $query = new \Connect\RQL\Query(); | ||
|
|
||
| if (is_array($filters)) { | ||
| $query = new \Connect\RQL\Query($filters); | ||
| } elseif ($filters instanceof \Connect\RQL\Query) { | ||
| $query = $filters; | ||
| } | ||
|
|
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.
Query again
| if (!$filter) { | ||
| $filter = new \Connect\RQL\Query(); | ||
| } |
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.
Query again
|
Kudos, SonarCloud Quality Gate passed!
|
No description provided.