Skip to content

Commit

Permalink
fix: phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
kryswoj committed Aug 14, 2023
1 parent eeab05e commit 49a9d85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Defaults/Field/CodeEditorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public function field()
wp_enqueue_script('code-editor');
wp_enqueue_style('code-editor');

$value = is_string($this->getValue()) ? $this->getValue() : '';

return sprintf(
'<textarea
id="%s"
Expand All @@ -69,7 +71,7 @@ class="widefat notification-field notification-code-editor-field"
esc_attr($this->getId()),
esc_attr(wp_json_encode($settings)),
esc_attr($this->getName()),
esc_textarea($this->getValue())
esc_textarea($value)
);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Defaults/Field/TextareaField.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public function __construct($params = [])
*/
public function field()
{
$value = is_string($this->getValue()) ? $this->getValue() : '';

return sprintf(
'<textarea name="%s" rows="%s" id="%s" placeholder="%s" class="widefat %s" %s>%s</textarea>',
esc_attr($this->getName()),
Expand All @@ -76,7 +78,7 @@ public function field()
esc_attr($this->placeholder),
esc_attr($this->cssClass()),
$this->maybeDisable(),
esc_textarea($this->getValue())
esc_textarea($value)
);
}

Expand Down

0 comments on commit 49a9d85

Please sign in to comment.