| @@ -76,9 +76,9 @@ | ||
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Light_Switch_Presenter constructor. |
| 79 | 79 | * |
| 80 | - * @param string $var The variable to create the checkbox for. | |
| 80 | + * @param string $variable The variable to create the checkbox for. | |
| 81 | 81 | * @param string $label The visual label text for the toggle. |
| 82 | 82 | * @param array $buttons Array of two visual labels for the buttons (defaults Disabled/Enabled). |
| 83 | 83 | * @param string $name The name of the underlying checkbox. |
| 84 | 84 | * @param string|bool $value The variable current value, to determine the checked attribute. |
| @@ -88,9 +88,9 @@ | ||
| 88 | 88 | * Starting from Yoast SEO 16.5, the visual label is forced to bold via CSS. |
| 89 | 89 | * @param string $disabled_attribute Optional. The disabled HTML attribute. Default is empty. |
| 90 | 90 | */ |
| 91 | 91 | public function __construct( |
| 92 | - $var, | |
| 92 | + $variable, | |
| 93 | 93 | $label, |
| 94 | 94 | $buttons, |
| 95 | 95 | $name, |
| 96 | 96 | $value, |
| @@ -98,9 +98,9 @@ | ||
| 98 | 98 | $help = '', |
| 99 | 99 | $strong = false, |
| 100 | 100 | $disabled_attribute = '' |
| 101 | 101 | ) { |
| 102 | - $this->var = $var; | |
| 102 | + $this->var = $variable; | |
| 103 | 103 | $this->label = $label; |
| 104 | 104 | $this->buttons = $buttons; |
| 105 | 105 | $this->name = $name; |
| 106 | 106 | $this->value = $value; |
| @@ -136,9 +136,9 @@ | ||
| 136 | 136 | '<span class="switch-light-visual-label%1$s" id="%2$s">%3$s</span>%4$s', |
| 137 | 137 | $strong_class, // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $strong_class output is hardcoded. |
| 138 | 138 | \esc_attr( $this->var . '-label' ), |
| 139 | 139 | \esc_html( $this->label ), |
| 140 | - $this->help // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: The help contains HTML. | |
| 140 | + $this->help, // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: The help contains HTML. | |
| 141 | 141 | ); |
| 142 | 142 | $output .= '<label class="' . $class . '"><b class="switch-yoast-seo-jaws-a11y"> </b>'; |
| 143 | 143 | $output .= \sprintf( |
| 144 | 144 | '<input type="checkbox" aria-labelledby="%1$s" id="%2$s" name="%3$s" value="on"%4$s%5$s/>', |
| @@ -145,9 +145,9 @@ | ||
| 145 | 145 | \esc_attr( $this->var . '-label' ), |
| 146 | 146 | \esc_attr( $this->var ), |
| 147 | 147 | \esc_attr( $this->name ), |
| 148 | 148 | \checked( $this->value, 'on', false ), // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: The output is hardcoded by WordPress. |
| 149 | - $this->disabled_attribute // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $disabled_attribute output is hardcoded. | |
| 149 | + $this->disabled_attribute, // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $disabled_attribute output is hardcoded. | |
| 150 | 150 | ); |
| 151 | 151 | $output .= '<span aria-hidden="true">'; |
| 152 | 152 | $output .= '<span>' . \esc_html( $off_button ) . '</span>'; |
| 153 | 153 | $output .= '<span>' . \esc_html( $on_button ) . '</span>'; |