Skip to content

Commit

Permalink
Exclude PSR2.Methods.MethodDeclaration.Underscor in affected file.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilsoncc committed Jul 30, 2023
1 parent c4652e3 commit aac4e4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
18 changes: 9 additions & 9 deletions includes/class-wc-gateway-payfast.php
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ public function cart_contains_pre_order_fee() {
* @param string $token Payfast subscription token.
* @param WC_Subscription $subscription The subscription object.
*/
protected function _set_subscription_token( $token, $subscription ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _set_subscription_token( $token, $subscription ) {
$subscription->update_meta_data( '_payfast_subscription_token', $token );
$subscription->save_meta_data();
}
Expand All @@ -950,7 +950,7 @@ protected function _set_subscription_token( $token, $subscription ) { // phpcs:i
* @param WC_Subscription $subscription The subscription object.
* @return mixed Payfast subscription token.
*/
protected function _get_subscription_token( $subscription ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _get_subscription_token( $subscription ) {
return $subscription->get_meta( '_payfast_subscription_token', true );
}

Expand All @@ -960,7 +960,7 @@ protected function _get_subscription_token( $subscription ) { // phpcs:ignore PS
* @param WC_Subscription $subscription The subscription object.
* @return mixed
*/
protected function _delete_subscription_token( $subscription ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _delete_subscription_token( $subscription ) {
return $subscription->delete_meta_data( '_payfast_subscription_token' );
}

Expand All @@ -971,7 +971,7 @@ protected function _delete_subscription_token( $subscription ) { // phpcs:ignore
*
* @param WC_Subscription $subscription The subscription object.
*/
protected function _set_renewal_flag( $subscription ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _set_renewal_flag( $subscription ) {
$subscription->update_meta_data( '_payfast_renewal_flag', 'true' );
$subscription->save_meta_data();
}
Expand All @@ -984,7 +984,7 @@ protected function _set_renewal_flag( $subscription ) { // phpcs:ignore PSR2.Met
* @param WC_Subscription $subscription The subscription object.
* @return bool
*/
protected function _has_renewal_flag( $subscription ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _has_renewal_flag( $subscription ) {
return 'true' === $subscription->get_meta( '_payfast_renewal_flag', true );
}

Expand All @@ -995,7 +995,7 @@ protected function _has_renewal_flag( $subscription ) { // phpcs:ignore PSR2.Met
*
* @param WC_Subscription $subscription The subscription object.
*/
protected function _delete_renewal_flag( $subscription ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _delete_renewal_flag( $subscription ) {
$subscription->delete_meta_data( '_payfast_renewal_flag' );
$subscription->save_meta_data();
}
Expand All @@ -1006,7 +1006,7 @@ protected function _delete_renewal_flag( $subscription ) { // phpcs:ignore PSR2.
* @param string $token Pre-order token.
* @param WC_Order $order Order object.
*/
protected function _set_pre_order_token( $token, $order ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _set_pre_order_token( $token, $order ) {
$order->update_meta_data( '_payfast_pre_order_token', $token );
$order->save_meta_data();
}
Expand All @@ -1017,7 +1017,7 @@ protected function _set_pre_order_token( $token, $order ) { // phpcs:ignore PSR2
* @param WC_Order $order Order object.
* @return mixed
*/
protected function _get_pre_order_token( $order ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _get_pre_order_token( $order ) {
return $order->get_meta( '_payfast_pre_order_token', true );
}

Expand Down Expand Up @@ -1281,7 +1281,7 @@ public function cancel_pre_order_subscription( $token ) {
*
* @return string
*/
protected function _generate_parameter_string( $api_data, $sort_data_before_merge = true, $skip_empty_values = true ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function _generate_parameter_string( $api_data, $sort_data_before_merge = true, $skip_empty_values = true ) {

// if sorting is required the passphrase should be added in before sort.
if ( ! empty( $this->pass_phrase ) && $sort_data_before_merge ) {
Expand Down
5 changes: 5 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>/includes/class-wc-gateway-payfast-blocks-support\.php</exclude-pattern>
</rule>

<!-- Exclude methods with underscore prefix that won't be renamed. -->
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<exclude-pattern>/includes/class-wc-gateway-payfast\.php</exclude-pattern>
</rule>
</ruleset>

0 comments on commit aac4e4d

Please sign in to comment.