Skip to content

Commit

Permalink
Fix PHPStan issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed Jul 17, 2024
1 parent c40b2a3 commit 26774d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ public function rcp_membership_payment_profile_cancelled( $success, $gateway, $g
* Subscription action links HTML.
*
* @param string $actions Formatted HTML links.
* @param array $links Links.
* @param array<string> $links Links.
* @param int $user_id Current user ID.
* @param RCP_Membership $rcp_membership Membership object.
* @return string
Expand Down Expand Up @@ -664,7 +664,7 @@ public function maybe_update_membership_gateway( $post_id ) {
return;
}

$rcp_membership = \rcp_get_membership( $subscription->get_source_id() );
$rcp_membership = \rcp_get_membership( (int) $subscription->get_source_id() );

if ( false === $rcp_membership ) {
return;
Expand Down
6 changes: 5 additions & 1 deletion src/Gateways/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function init() {
// Set supported features based on gateway.
$gateway = $this->get_pronamic_gateway();

if ( null !== $gateway ) {
if ( null !== $gateway && null !== $this->payment_method ) {
$payment_method = $gateway->get_payment_method( $this->payment_method );

if ( null !== $payment_method && $payment_method->supports( 'recurring' ) ) {
Expand Down Expand Up @@ -260,6 +260,10 @@ public function fields() {
return '';
}

if ( null === $this->payment_method ) {
return '';
}

$payment_method = $gateway->get_payment_method( $this->payment_method );

if ( null === $payment_method ) {
Expand Down

0 comments on commit 26774d7

Please sign in to comment.