Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ public function process( File $phpcsFile, $stackPtr ) {

$functionName = $tokens[ $functionNamePtr ]['content'];

// Check if function has a docblock.
$docblock = $this->findDocblock( $phpcsFile, $stackPtr );

if ( false === $docblock ) {
return;
}

// Get function parameters.
$params = $this->getParameters( $phpcsFile, $stackPtr );

if ( empty( $params ) ) {
return;
}

// Get existing @param tags with their types.
$existingParams = $this->getExistingParamTags( $phpcsFile, $docblock );
// Check if function has a docblock.
$docblock = $this->findDocblock( $phpcsFile, $stackPtr );
$hasDocblock = ( false !== $docblock );
$existingParams = array();

if ( $hasDocblock ) {
// Get existing @param tags with their types.
$existingParams = $this->getExistingParamTags( $phpcsFile, $docblock );
}
Comment on lines +78 to +86

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

git ls-files | grep -i "addmissingparamtypefromcallssniff"

Repository: Strategy11/formidable-forms

Length of output: 150


🏁 Script executed:

# Check if the file exists and get its line count
wc -l phpcs-sniffs/Formidable/Sniffs/Commenting/AddMissingParamTypeFromCallsSniff.php

Repository: Strategy11/formidable-forms

Length of output: 154


🏁 Script executed:

# Read the findDocblock method to understand its current implementation
sed -n '1,600p' phpcs-sniffs/Formidable/Sniffs/Commenting/AddMissingParamTypeFromCallsSniff.php | cat -n

Repository: Strategy11/formidable-forms

Length of output: 19995


🏁 Script executed:

# Search for any existing references to attributes in the codebase
rg -i "attribute" --type php | head -20

Repository: Strategy11/formidable-forms

Length of output: 2255


🌐 Web query:

PHP CodeSniffer T_ATTRIBUTE token PHP 8 attributes

💡 Result:

In PHP_CodeSniffer (PHPCS), PHP 8 attributes are represented using the tokenizer’s T_ATTRIBUTE token (marks the start of an attribute). PHPCS also defines an additional token T_ATTRIBUTE_END (marks the end of an attribute), and adds attribute_owner / attribute_closer indexes to tokens inside the attribute to help sniffs relate the attribute to the thing it decorates. This support was added in PHPCS 3.6.0 (released 2021-04-08), and PHPCS also “backfills” attribute tokenization when running on older PHP versions. [1] [2] [3]

Practical sniff notes:

  • To detect attributes, register for T_ATTRIBUTE (and often also use T_ATTRIBUTE_END to skip/scan cleanly). [1] [2]
  • In PHPCS code, these are exposed as PHPCS token constants (e.g. \PHP_CodeSniffer\Util\Tokens::T_ATTRIBUTE, ::T_ATTRIBUTE_END). [2]

Sources: [1] [2] [3]


🏁 Script executed:

# Check if there are any test cases or examples with PHP 8 attributes in the repo
find . -type f -name "*.php" -exec grep -l "#\[" {} \;

Repository: Strategy11/formidable-forms

Length of output: 143


🏁 Script executed:

# Check the files that use PHP 8 attributes to understand the pattern
head -50 classes/models/FrmSettings.php | grep -A 5 "#\["

Repository: Strategy11/formidable-forms

Length of output: 144


🏁 Script executed:

# Also check the addDocblock method more carefully for the same issue
sed -n '541,599p' phpcs-sniffs/Formidable/Sniffs/Commenting/AddMissingParamTypeFromCallsSniff.php | cat -n

Repository: Strategy11/formidable-forms

Length of output: 2148


🏁 Script executed:

# Check if there are any other places in the sniff that scan backward looking for tokens
rg "findPrevious" phpcs-sniffs/Formidable/Sniffs/Commenting/AddMissingParamTypeFromCallsSniff.php -B 2 -A 2

Repository: Strategy11/formidable-forms

Length of output: 1013


🏁 Script executed:

# Let's verify the PHPCS version or constants used in the project
rg -i "require.*phpcs" phpcs-sniffs/ composer.json composer.lock -A 2 | head -30

Repository: Strategy11/formidable-forms

Length of output: 949


🏁 Script executed:

# Check if T_ATTRIBUTE is referenced anywhere in the codebase already
rg "T_ATTRIBUTE" --type php

Repository: Strategy11/formidable-forms

Length of output: 53


🏁 Script executed:

# Look at the specific logic in findDocblock more carefully with context
sed -n '188,208p' phpcs-sniffs/Formidable/Sniffs/Commenting/AddMissingParamTypeFromCallsSniff.php | cat -n

Repository: Strategy11/formidable-forms

Length of output: 671


Add PHP 8 attribute token handling in both findDocblock() and addDocblock() methods.

When a docblock sits above PHP 8 attributes (e.g., #[SomeAttribute]), findDocblock() will currently miss it because the backward scan stops at the attribute token, causing a duplicate docblock to be inserted below the attributes. The same issue exists in addDocblock() which determines insertion position using an identical pattern. Add T_ATTRIBUTE and T_ATTRIBUTE_END to the ignore lists in both methods:

🔧 Required changes in two locations

Location 1: findDocblock() method (line 191-199)

 $ignore = array(
 	T_WHITESPACE,
+	T_ATTRIBUTE,
+	T_ATTRIBUTE_END,
 	T_STATIC,
 	T_PUBLIC,
 	T_PRIVATE,
 	T_PROTECTED,
 	T_ABSTRACT,
 	T_FINAL,
 );

Location 2: addDocblock() method (line 548)

 $prev = $phpcsFile->findPrevious(
-	array( T_WHITESPACE, T_STATIC, T_PUBLIC, T_PRIVATE, T_PROTECTED, T_ABSTRACT, T_FINAL ),
+	array( T_WHITESPACE, T_ATTRIBUTE, T_ATTRIBUTE_END, T_STATIC, T_PUBLIC, T_PRIVATE, T_PROTECTED, T_ABSTRACT, T_FINAL ),
 	$stackPtr - 1,
 	null,
 	true
 );
🤖 Prompt for AI Agents
In
`@phpcs-sniffs/Formidable/Sniffs/Commenting/AddMissingParamTypeFromCallsSniff.php`
around lines 78 - 86, Update the backward-scan ignore lists in both
findDocblock() and addDocblock() so PHP 8 attributes are skipped during docblock
detection/insertion: include T_ATTRIBUTE and T_ATTRIBUTE_END alongside the
existing ignored tokens used when scanning backwards from $stackPtr (in
findDocblock()) and when computing the insertion position (in addDocblock()),
ensuring the scan will pass over attribute blocks and prevent inserting a
duplicate docblock below attributes.


// Find parameters that are missing @param comments entirely.
$missingParamComments = array();
Expand Down Expand Up @@ -145,6 +145,21 @@ public function process( File $phpcsFile, $stackPtr ) {
return;
}

// If no docblock exists, create one with the detected @param tags.
if ( ! $hasDocblock ) {
$fix = $phpcsFile->addFixableError(
'Missing docblock with @param tags (detected types from call site literals)',
$stackPtr,
'MissingDocblockFromCalls'
);

if ( $fix ) {
$this->addDocblock( $phpcsFile, $stackPtr, $paramsToAdd );
}

return;
}

// Report and fix each missing @param.
foreach ( $paramsToAdd as $paramName => $info ) {
$typeString = implode( '|', $info['types'] );
Expand Down Expand Up @@ -513,4 +528,73 @@ private function addParamTag( File $phpcsFile, $docblock, $type, $paramName ) {
$phpcsFile->fixer->replaceToken( $lastParamEnd, $newContent );
$phpcsFile->fixer->endChangeset();
}

/**
* Add a new docblock with @param tags.
*
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The function token position.
* @param array $paramsToAdd Array of param name => array('types' => array, 'index' => int).
*
* @return void
*/
private function addDocblock( File $phpcsFile, $stackPtr, $paramsToAdd ) {
$tokens = $phpcsFile->getTokens();

// Find the position to insert the docblock (before any modifiers or the function keyword).
$insertBefore = $stackPtr;

$prev = $phpcsFile->findPrevious(
array( T_WHITESPACE, T_STATIC, T_PUBLIC, T_PRIVATE, T_PROTECTED, T_ABSTRACT, T_FINAL ),
$stackPtr - 1,
null,
true
);

if ( false !== $prev ) {
// Find the first modifier/keyword after $prev.
$next = $phpcsFile->findNext( T_WHITESPACE, $prev + 1, $stackPtr, true );

if ( false !== $next ) {
$insertBefore = $next;
}
}

// Determine indentation from the function line.
$indent = '';

for ( $i = $insertBefore - 1; $i >= 0; $i-- ) {
if ( $tokens[ $i ]['code'] === T_WHITESPACE ) {
if ( strpos( $tokens[ $i ]['content'], "\n" ) !== false || strpos( $tokens[ $i ]['content'], "\r" ) !== false ) {
// Get the part after the newline.
$indent = preg_replace( '/^.*[\r\n]/', '', $tokens[ $i ]['content'] );
break;
}
} else {
break;
}
}

// Build the docblock.
$docblock = "/**\n";

// Sort params by index to maintain order.
uasort(
$paramsToAdd,
function ( $a, $b ) {
return $a['index'] - $b['index'];
}
);

foreach ( $paramsToAdd as $paramName => $info ) {
$typeString = implode( '|', $info['types'] );
$docblock .= $indent . "\t * @param " . $typeString . ' ' . $paramName . "\n";
}

$docblock .= $indent . "\t */\n" . $indent . "\t";

Comment on lines +578 to +595

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix indentation in generated docblocks.

The current builder adds an extra tab for each * line and before the function, which will over-indent the block and the declaration.

🛠️ Adjust indentation to match the function line
-		foreach ( $paramsToAdd as $paramName => $info ) {
-			$typeString = implode( '|', $info['types'] );
-			$docblock  .= $indent . "\t * `@param` " . $typeString . ' ' . $paramName . "\n";
-		}
+		foreach ( $paramsToAdd as $paramName => $info ) {
+			$typeString = implode( '|', $info['types'] );
+			$docblock  .= $indent . " * `@param` " . $typeString . ' ' . $paramName . "\n";
+		}
 
-		$docblock .= $indent . "\t */\n" . $indent . "\t";
+		$docblock .= $indent . " */\n" . $indent;
🤖 Prompt for AI Agents
In
`@phpcs-sniffs/Formidable/Sniffs/Commenting/AddMissingParamTypeFromCallsSniff.php`
around lines 578 - 595, The generated docblock is over-indented because the
builder appends an extra "\t" before each "*" line and before the function
declaration; update the $docblock construction in
AddMissingParamTypeFromCallsSniff (around $paramsToAdd processing) to remove
those extra tabs—use $indent . ' * `@param` ...' instead of $indent . "\t * `@param`
..." and change the footer concatenation from $indent . "\t */\n" . $indent .
"\t" to $indent . " */\n" . $indent so the block lines align with the function
line.

$phpcsFile->fixer->beginChangeset();
$phpcsFile->fixer->addContentBefore( $insertBefore, $docblock );
$phpcsFile->fixer->endChangeset();
}
}
7 changes: 7 additions & 0 deletions tests/phpunit/emails/test_FrmEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ public function test_trigger_email_six() {
$this->check_senders( $expected, $mock_email );
}

/**
* @param string $subject
*/
protected function prepare_subject( $subject ) {
return wp_specialchars_decode( strip_tags( stripslashes( $subject ) ), ENT_QUOTES );
}
Expand Down Expand Up @@ -747,6 +750,10 @@ public function test_plain_text_message() {
}
}

/**
* @param string $setting_name
* @param string $property
*/
private function check_private_properties( $settings, $setting_name, $property = '' ) {
Comment on lines +753 to 757

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing @param for $settings parameter.

The docblock is missing the first parameter $settings. Based on usage throughout the file, it should be an array.

Proposed fix
 	/**
+	 * `@param` array $settings
 	 * `@param` string $setting_name
 	 * `@param` string $property
 	 */
 	private function check_private_properties( $settings, $setting_name, $property = '' ) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* @param string $setting_name
* @param string $property
*/
private function check_private_properties( $settings, $setting_name, $property = '' ) {
/**
* `@param` array $settings
* `@param` string $setting_name
* `@param` string $property
*/
private function check_private_properties( $settings, $setting_name, $property = '' ) {
🤖 Prompt for AI Agents
In `@tests/phpunit/emails/test_FrmEmail.php` around lines 753 - 757, The docblock
for the private method check_private_properties is missing the `@param` annotation
for the first argument $settings; update the docblock to include "@param array
$settings" (or the appropriate type if different) so it documents the method
signature correctly alongside the existing `@param` entries for $setting_name and
$property.

if ( ! $property ) {
$property = $setting_name;
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/entries/test_FrmEntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public function test_delete_entry_after_save() {
$this->assertEquals( 'publish', $post->post_status );
}

/**
* @param array $options
*/
private function create_form( $options = array() ) {
return $this->factory->form->create_and_get(
array(
Expand Down
12 changes: 12 additions & 0 deletions tests/phpunit/entries/test_FrmShowEntryShortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,9 @@ public function test_json_format() {
$this->assertSame( $expected_json, $actual_json );
}

/**
* @param bool $include_meta
*/
protected function get_test_entry( $include_meta ) {
$new_entry = array(
'form_id' => FrmForm::get_id_by_key( 'free_field_types' ),
Expand Down Expand Up @@ -1025,10 +1028,16 @@ protected function get_field_value( $entry, $field, $atts ) {
return $field_value;
}

/**
* @param string $type
*/
protected function set_included_fields( $type ) {
$this->include_fields = $this->set_field_array( $type );
}

/**
* @param string $type
*/
protected function set_excluded_fields( $type ) {
$this->exclude_fields = $this->set_field_array( $type );
}
Expand All @@ -1043,6 +1052,9 @@ protected function set_field_array( $type ) {
return $fields;
}

/**
* @param string $type
*/
protected function get_single_included_field( $type ) {
$include_fields = array(
'free-text-field' => 'free-text-field',
Expand Down
14 changes: 14 additions & 0 deletions tests/phpunit/fields/test_FrmFieldGridHelper.php.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function test_get_size_of_class() {
$this->assertEquals( 12, $this->get_size_of_class( 'frm_full' ) );
}

/**
* @param string $class
*/
private function get_size_of_class( $class ) {
return $this->run_private_method( array( 'FrmFieldGridHelper', 'get_size_of_class' ), array( $class ) );
}
Expand Down Expand Up @@ -57,6 +60,10 @@ public function test_basic_grouping() {
ob_end_clean();
}

/**
* @param false|int $assert_size
* @param string $assert_message
*/
private function sync_current_field_once( $assert_size = false, $assert_message = '' ) {
$this->helper->maybe_begin_field_wrapper();
$this->helper->sync_list_size();
Expand All @@ -70,6 +77,10 @@ private function assert_current_list_size( $expected, $message = '' ) {
$this->assertEquals( $expected, $this->get_private_property( $this->helper, 'current_list_size' ), $message );
}

/**
* @param string $type
* @param string $classes
*/
private function create_field_with_classes( $type, $classes = '' ) {
return $this->factory->field->create_and_get(
array(
Expand Down Expand Up @@ -129,6 +140,9 @@ public function test_with_sections() {
ob_end_clean();
}

/**
* @param int $expected
*/
private function assert_section_helper_size( $expected ) {
$this->assertEquals( $expected, $this->get_private_property( $this->section_helper, 'current_list_size' ) );
}
Expand Down
6 changes: 6 additions & 0 deletions tests/phpunit/fields/test_FrmFieldValidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,16 @@ protected function set_required_field( $field ) {
}
}

/**
* @param string $field_type
*/
protected function get_field_key( $field_type ) {
return $field_type . '-form' . $this->form->id;
}

/**
* @param array $item_meta
*/
protected function check_single_value( $item_meta ) {
$_POST = array(
'form_id' => $this->form->id,
Expand Down
11 changes: 11 additions & 0 deletions tests/phpunit/forms/test_FrmForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,20 @@ public function test_sanitize_field_opt() {
$this->assert_sanitize_field_opt_calc( $original_value, $original_value );
}

/**
* @param string $expected
* @param string $original_value
* @param string $message
*/
private function assert_sanitize_field_opt_calc( $expected, $original_value, $message = '' ) {
$value = $original_value;
$this->sanitize_field_opt( 'calc', $value );
$this->assertEquals( $expected, $value, $message );
}

/**
* @param string $opt
*/
Comment on lines +183 to +185

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add missing @param for $value (by-ref).

$value is still undocumented, which undercuts the goal of these docblock additions.

💡 Suggested docblock update
 /**
  * `@param` string $opt
+ * `@param` string &$value
  */
 private function sanitize_field_opt( $opt, &$value ) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* @param string $opt
*/
/**
* `@param` string $opt
* `@param` string &$value
*/
🤖 Prompt for AI Agents
In `@tests/phpunit/forms/test_FrmForm.php` around lines 183 - 185, The docblock
above the function is missing documentation for the by-reference parameter
$value; update the PHPDoc for the function in test_FrmForm.php (look for the
docblock containing "@param string $opt") to add an additional `@param` entry for
$value that includes the by-ref marker (&), an appropriate type (e.g. mixed or
string depending on usage) and a short description (for example: "@param mixed
&$value — value passed by reference to be modified"). Ensure the new `@param`
appears alongside the existing "@param string $opt" entry.

private function sanitize_field_opt( $opt, &$value ) {
return $this->run_private_method(
array( 'FrmForm', 'sanitize_field_opt' ),
Expand All @@ -196,6 +204,9 @@ public function test_normalize_calc_spaces() {
$this->assertEquals( '1 <= 2 && 3 <= 4 && 5 <= 6', $this->normalize_calc_spaces( '1<=2 && 3<=4 && 5<=6' ) );
}

/**
* @param string $calc
*/
private function normalize_calc_spaces( $calc ) {
return $this->run_private_method( array( 'FrmForm', 'normalize_calc_spaces' ), array( $calc ) );
}
Expand Down
6 changes: 6 additions & 0 deletions tests/phpunit/forms/test_FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ public function test_front_head() {
$this->assertEquals( FrmAppHelper::plugin_url() . '/js/' . $file, $formidable_js->src, $file . ' was not loaded' );
}

/**
* @param array $post_content
*/
Comment on lines +155 to +157

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Document $form_id in the helper docblock.

The new docblock only documents $post_content, so $form_id remains undocumented.

💡 Suggested docblock update
 /**
+ * `@param` int   $form_id
  * `@param` array $post_content
  */
 private function create_on_submit_action( $form_id, $post_content ) {
🤖 Prompt for AI Agents
In `@tests/phpunit/forms/test_FrmFormsController.php` around lines 155 - 157, The
docblock currently documents only $post_content; add a `@param` entry for $form_id
(e.g., "@param int $form_id" or the correct type used in the function) to the
same docblock so both parameters ($form_id and $post_content) are documented and
include a short description for $form_id; update the docblock immediately above
the helper/function that accepts $form_id and $post_content (referencing the
$form_id and $post_content symbols).

private function create_on_submit_action( $form_id, $post_content ) {
$post_data = array(
'post_type' => FrmFormActionsController::$action_post_type,
Expand Down Expand Up @@ -306,6 +309,9 @@ public function test_message_with_form_after_create() {
$this->run_message_after_create( 1 );
}

/**
* @param int $show_form
*/
public function run_message_after_create( $show_form = 0 ) {
$form = $this->factory->form->create_and_get(
array(
Expand Down
12 changes: 12 additions & 0 deletions tests/phpunit/forms/test_FrmFormsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public function test_maybe_add_sanitize_url_attr() {
);
}

/**
* @param string $expected
* @param string $url
* @param string $message
*/
private function assert_maybe_add_sanitize_url_attr( $expected, $url, $message = '' ) {
$this->assertEquals( $expected, FrmFormsHelper::maybe_add_sanitize_url_attr( $url, (int) $this->form->id ), $message );
}
Expand All @@ -78,6 +83,10 @@ public function test_get_plan_required() {
$this->assert_get_plan_required( 'Plus', array( 'Plus', 'Category2' ) );
}

/**
* @param string $expected
* @param array $categories
*/
private function assert_get_plan_required( $expected, $categories ) {
$link = compact( 'categories' );
$this->assertEquals( $expected, FrmFormsHelper::get_plan_required( $link ) );
Expand Down Expand Up @@ -125,6 +134,9 @@ public function test_get_form_style() {
$this->assertEquals( '0', FrmFormsHelper::get_form_style( $form ) );
}

/**
* @param string $custom_style
*/
private function create_form_with_custom_style_value( $custom_style ) {
return $this->factory->form->create_and_get(
array(
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/misc/test_FrmAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function test_block_menu() {
$this->check_menu( 'block' );
}

/**
* @param string $allow
*/
private function check_menu( $allow = 'allow' ) {
$url = get_option( 'siteurl', true );
do_action( 'admin_menu' );
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/misc/test_FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ public function test_is_a_valid_color() {
$this->assertFalse( $this->is_a_valid_color( 'Not a color' ) );
}

/**
* @param string $value
*/
private function is_a_valid_color( $value ) {
return $this->run_private_method( array( 'FrmAppHelper', 'is_a_valid_color' ), array( $value ) );
}
Expand Down
4 changes: 4 additions & 0 deletions tests/phpunit/misc/test_FrmInbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public function test_add_message() {
$this->assert_message_count( $initial_count + 1, 'Message count should not go up after an invalid message is added.' );
}

/**
* @param int $count
* @param string $message
*/
private function assert_message_count( $count, $message ) {
$this->assertEquals( $count, $this->get_message_count(), $message );
}
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/misc/test_FrmSpamCheckDenylist.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public function setUp(): void {
);
}

/**
* @param array $denylist_data
*/
private function set_denylist_data( $denylist_data ) {
$this->set_private_property( $this->spam_check, 'denylist', $denylist_data );
}
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/stripe/test_FrmStripeLiteAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function test_maybe_add_statement_descriptor() {
);
}

/**
* @param array $intent_data
*/
private function maybe_add_statement_descriptor( $intent_data ) {
return $this->run_private_method( array( 'FrmStrpLiteAuth', 'maybe_add_statement_descriptor' ), array( $intent_data ) );
}
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/styles/test_FrmStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public function test_strip_invalid_characters() {
$this->assertEquals( 'calc(100%/6)', $this->strip_invalid_characters( 'calc(100%/6)' ) );
}

/**
* @param string $input
*/
private function strip_invalid_characters( $input ) {
$frm_style = new FrmStyle();
return $this->run_private_method( array( $frm_style, 'strip_invalid_characters' ), array( $input ) );
Expand Down
Loading