Skip to content

Commit

Permalink
Add type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed Jun 2, 2024
1 parent be9c3da commit 9555d28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions web/lib/MRBS/Form/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct($tag, $self_closing=false)

// If $raw is true then the text will not be put through htmlspecialchars(). Only to
// be used for trusted text.
public function setText($text, $text_at_start=false, $raw=false)
public function setText($text, $text_at_start=false, bool $raw=false)
{
if ($this->self_closing)
{
Expand Down Expand Up @@ -456,7 +456,7 @@ public function toHTML($no_whitespace=false)
}


private static function escapeText($text, $raw=false)
private static function escapeText($text, bool $raw=false)
{
if ($raw || is_numeric($text))
{
Expand Down
2 changes: 1 addition & 1 deletion web/lib/MRBS/Form/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function removeControl()

// If $raw is true then the text will not be put through htmlspecialchars(). Only to
// be used for trusted text.
public function setLabel($text, $text_at_start=false, $raw=false)
public function setLabel($text, $text_at_start=false, bool $raw=false)
{
$label = $this->getElement('label');
$label->setText($text, $text_at_start, $raw);
Expand Down

0 comments on commit 9555d28

Please sign in to comment.