Skip to content
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

Merged
merged 7 commits into from
Feb 11, 2021
Merged

Make code loadable #18

merged 7 commits into from
Feb 11, 2021

Conversation

pdbreen
Copy link
Contributor

@pdbreen pdbreen commented Feb 11, 2021

No description provided.

@@ -13,8 +13,6 @@ class Payment extends BaseModel
protected $casts = [
];

protected $refund = app('refund');
Copy link
Contributor Author

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');
Copy link
Contributor Author

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.

Copy link
Member

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;
Copy link
Member

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.

Copy link
Member

@drewroberts drewroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Patrick! 🛃

@drewroberts drewroberts merged commit 654ff55 into main Feb 11, 2021
@drewroberts drewroberts deleted the pbdreen/bugfix/fix-code branch February 11, 2021 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants