Skip to content

Commit

Permalink
Enforce string type for string operations
Browse files Browse the repository at this point in the history
split: b40122acb6c4acafd4e04ff3cef4f202876eb2cb
  • Loading branch information
kylekatarnls committed Nov 11, 2021
1 parent 91b2228 commit 53d06a3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public function peek($length = null, $start = null)
*/
public function match($pattern, $modifiers = null, $ignoredSuffixes = null)
{
$modifiers = $modifiers ?: '';
$modifiers = (string) $modifiers;
$ignoredSuffixes = $ignoredSuffixes ?: "\n";
$matches = null;
$this->lastMatchResult = null;
Expand Down Expand Up @@ -572,7 +572,7 @@ public function peekQuote()
*/
public function peekSpace()
{
return ctype_space($this->peek());
return ctype_space((string) $this->peek());
}

/**
Expand All @@ -584,7 +584,7 @@ public function peekSpace()
*/
public function peekDigit()
{
return ctype_digit($this->peek());
return ctype_digit((string) $this->peek());
}

/**
Expand All @@ -596,7 +596,7 @@ public function peekDigit()
*/
public function peekAlpha()
{
return ctype_alpha($this->peek());
return ctype_alpha((string) $this->peek());
}

/**
Expand All @@ -608,7 +608,7 @@ public function peekAlpha()
*/
public function peekAlphaNumeric()
{
return ctype_alnum($this->peek());
return ctype_alnum((string) $this->peek());
}

/**
Expand Down Expand Up @@ -658,7 +658,7 @@ public function readIndentation()
*/
public function readUntilNewLine()
{
return $this->readUntil([$this, 'peekNewLine']);
return (string) $this->readUntil([$this, 'peekNewLine']);
}

/**
Expand Down

0 comments on commit 53d06a3

Please sign in to comment.