-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Make code loadable #18
Conversation
@@ -13,8 +13,6 @@ class Payment extends BaseModel | |||
protected $casts = [ | |||
]; | |||
|
|||
protected $refund = app('refund'); |
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 legal PHP - can't use a function in member assignment. I'm updating the checkout packages to require their true dependencies and stumbled on this trying to run tests.
@@ -94,7 +92,9 @@ public function generateAmountRefunded() | |||
*/ | |||
public function requestRefund($amount = null, $method = 'Stripe') | |||
{ | |||
return $this->refund::create([ | |||
$refundModel = app('refund'); |
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.
You can add /** @var Model $refundModel */
above and it should be ok. Per discussion yesterday, this package should add an explicit dependency on the refund package and then use the Refund model directly and then work to move that dependency into a service / model interface later.
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.
Thanks
@@ -1,5 +1,6 @@ | |||
<?php namespace TipOff\Payments\Models; | |||
|
|||
use Illuminate\Database\Eloquent\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.
Thank you. That makes sense.
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.
Thank you, Patrick! 🛃
No description provided.