Skip to content

Commit

Permalink
More phpstan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Jun 18, 2024
1 parent 4f926fb commit a184cf2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
20 changes: 2 additions & 18 deletions classes/PodsInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ public function register_assets() {
*
* @since 2.7.23
*
* @param bool $suffix_min Minimized script suffix.
* @param string $suffix_min Minimized script suffix.
*/
do_action( 'pods_before_enqueue_scripts', $suffix_min );

Expand Down Expand Up @@ -844,7 +844,7 @@ public function register_assets() {
*
* @since 2.7.23
*
* @param bool $suffix_min Minimized script suffix.
* @param string $suffix_min Minimized script suffix.
*/
do_action( 'pods_after_enqueue_scripts', $suffix_min );
}
Expand Down Expand Up @@ -2343,22 +2343,6 @@ public function reset( $_blog_id = null ) {
}
}

$helpers = $api->load_helpers();

foreach ( $helpers as $helper ) {
try {
$api->delete_helper( array( 'name' => $helper['name'] ) );
} catch ( Exception $exception ) {
pods_debug_log( $exception );

pods_message( sprintf(
// translators: %s: Pod helper label.
__( 'Cannot delete pod helper "%s"', 'pods' ),
$helper['name']
), 'error' );
}
}

$tables = $wpdb->get_results( "SHOW TABLES LIKE '{$wpdb->prefix}pods%'", ARRAY_N );

if ( ! empty( $tables ) ) {
Expand Down
18 changes: 9 additions & 9 deletions includes/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ function pods_v( $var = null, $type = 'get', $default = null, $strict = false, $
* @param object $params Additional arguments for pods_v().
* @param string $type The type of var given.
*/
$output = apply_filters( "pods_var_{$type}", $default, $var, $strict, $params );
$output = apply_filters( "pods_var_{$type}", $default, $var, $strict, $paams, $type );

Check failure on line 912 in includes/data.php

View workflow job for this annotation

GitHub Actions / phpstan / phpstan (8.2)

Undefined variable: $paams

Check failure on line 912 in includes/data.php

View workflow job for this annotation

GitHub Actions / phpstan / phpstan (8.3)

Undefined variable: $paams

/**
* Filter to handle custom variable types.
Expand All @@ -923,7 +923,7 @@ function pods_v( $var = null, $type = 'get', $default = null, $strict = false, $
* @param object $params Additional arguments for pods_v().
* @param string $type The type of var given.
*/
$output = apply_filters( 'pods_v_custom', $output, $default, $var, $strict, $params );
$output = apply_filters( 'pods_v_custom', $output, $default, $var, $strict, $params, $type );
}//end switch
}//end if

Expand Down Expand Up @@ -2163,10 +2163,10 @@ function pods_serial_comma( $value, $field = null, $fields = null, $and = null,
*
* @since unknown
*
* @param string $serial_comma The serial comma content used, return an empty string to disable (default ", ").
* @param array $value The formatted value.
* @param string $original_value The original value input into pods_serial_comma.
* @param object $params The list of the setup parameters for pods_serial_comma.
* @param string $serial_comma The serial comma content used, return an empty string to disable (default ", ").
* @param string $value The formatted string value.
* @param string|array $original_value The original value input into pods_serial_comma.
* @param object $params The list of the setup parameters for pods_serial_comma.
*/
$serial_comma = apply_filters( 'pods_serial_comma', $params->separator, $value, $original_value, $params );

Expand Down Expand Up @@ -2196,9 +2196,9 @@ function pods_serial_comma( $value, $field = null, $fields = null, $and = null,
*
* @since unknown
*
* @param string $value The formatted value.
* @param string $original_value The original value input into pods_serial_comma.
* @param object $params The list of the setup parameters for pods_serial_comma.
* @param string $value The formatted value.
* @param string|array $original_value The original value input into pods_serial_comma.
* @param object $params The list of the setup parameters for pods_serial_comma.
*/
return (string) apply_filters( 'pods_serial_comma_value', $value, $original_value, $params );
}
Expand Down

0 comments on commit a184cf2

Please sign in to comment.