Skip to content

Commit

Permalink
Short array syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Oct 31, 2023
1 parent d68d9d6 commit f1e6884
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Payments/PaymentsDataStoreCPT.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ public function update( Payment $payment ) {
public function save( $payment ) {
$id = $payment->get_id();

\add_filter( 'wp_insert_post_data', array( $this, 'preserve_post_content' ), 5, 3 );
\add_filter( 'wp_insert_post_data', [ $this, 'preserve_post_content' ], 5, 3 );

$result = empty( $id ) ? $this->create( $payment ) : $this->update( $payment );

\remove_filter( 'wp_insert_post_data', array( $this, 'preserve_post_content' ), 5, 3 );
\remove_filter( 'wp_insert_post_data', [ $this, 'preserve_post_content' ], 5, 3 );

Check failure on line 289 in src/Payments/PaymentsDataStoreCPT.php

View workflow job for this annotation

GitHub Actions / phpstan / phpstan

Function remove_filter invoked with 4 parameters, 2-3 required.

$this->update_post_meta( $payment );

Expand Down
4 changes: 2 additions & 2 deletions src/Subscriptions/SubscriptionsDataStoreCPT.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ public function update( $subscription ) {
public function save( $subscription ) {
$id = $subscription->get_id();

\add_filter( 'wp_insert_post_data', array( $this, 'preserve_post_content' ), 5, 3 );
\add_filter( 'wp_insert_post_data', [ $this, 'preserve_post_content' ], 5, 3 );

$result = empty( $id ) ? $this->create( $subscription ) : $this->update( $subscription );

\remove_filter( 'wp_insert_post_data', array( $this, 'preserve_post_content' ), 5, 3 );
\remove_filter( 'wp_insert_post_data', [ $this, 'preserve_post_content' ], 5, 3 );

Check failure on line 298 in src/Subscriptions/SubscriptionsDataStoreCPT.php

View workflow job for this annotation

GitHub Actions / phpstan / phpstan

Function remove_filter invoked with 4 parameters, 2-3 required.

$this->update_post_meta( $subscription );

Expand Down

0 comments on commit f1e6884

Please sign in to comment.