Skip to content

Commit

Permalink
Merge pull request #16 from atarime/remove-unnecessary-function-args
Browse files Browse the repository at this point in the history
Remove unnecessary function args
  • Loading branch information
kznakata authored Nov 21, 2024
2 parents 6dc033d + 9653169 commit ce80941
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions admin/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ public function __construct() {
/**
* Set property
*
* @param array $properties .
* @param WPCF7_ContactForm $contact_form .
* @param array $properties .
* @return array
*/
public function add_fmpress_property( $properties, $contact_form ) {
public function add_fmpress_property( $properties ) {
$properties = wp_parse_args(
$properties,
array(
Expand Down Expand Up @@ -240,7 +239,7 @@ private function script_settings_section( $cf7_settings ) {
*/
private function assign_fields_section( $contact_form ) {

Check failure on line 240 in admin/class-admin.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (2)

Parameter $contact_form of method Emic\FMPress\Forms\Admin::assign_fields_section() has invalid type Emic\FMPress\Forms\WPCF7_ContactForm.
echo '<hr style="margin: 1em 0 2em;">',
'<h2>', esc_html__( 'Assign fields', 'fmpress-forms' ), '</h2>','<table class="table fmpress-admin-table"><tbody>',
'<h2>', esc_html__( 'Assign fields', 'fmpress-forms' ), '</h2>', '<table class="table fmpress-admin-table"><tbody>',
'<p><small>', esc_html__( 'To specify fields, you must add fm_field- as a prefix to the beginning of the form-tag name in the Form tab panel. (e.g. fm_field-company_name)', 'fmpress-forms' ), '</small></p>';

// Generate fields for field assignment.
Expand Down Expand Up @@ -406,11 +405,10 @@ private function is_fm_field( $tag ) {
* Remove prefix and return field name
*
* @param WPCF7_FormTag|array $tag CF7 tag.
* @param bool $array true if the arg is an array.
* @return string|null
*/
private function get_fm_field( $tag, $array = false ) {
$name = $array ? $tag['name'] : $tag->name;
private function get_fm_field( $tag ) {
$name = is_array( $tag ) ? $tag['name'] : $tag->name;
return isset( $name ) ? mb_substr( $name, mb_strlen( self::FM_FIELD_PREFIX ) ) : null;
}
}

0 comments on commit ce80941

Please sign in to comment.