Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 19, 2014
1 parent 7db19c3 commit 44537fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Neon/Neon.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function encode($var, $options = NULL)
$s = '';
if ($options & self::BLOCK) {
if (count($var) === 0) {
return "[]";
return '[]';
}
foreach ($var as $k => $v) {
$v = self::encode($v, self::BLOCK);
Expand Down
6 changes: 3 additions & 3 deletions src/Neon/NeonDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class NeonDecoder
public function decode($input)
{
if (!is_string($input)) {
throw new \InvalidArgumentException("Argument must be a string, " . gettype($input) . " given.");
throw new \InvalidArgumentException(sprintf('Argument must be a string, %s given.', gettype($input)));

} elseif (substr($input, 0, 3) === "\xEF\xBB\xBF") { // BOM
$input = substr($input, 3);
Expand Down Expand Up @@ -281,7 +281,7 @@ private function addValue(& $result, $hasKey, $key, $value)

private function cbString($m)
{
static $mapping = array('t' => "\t", 'n' => "\n", 'r' => "\r", 'f' => "\x0C", 'b' => "\x08", '"' => '"', '\\' => '\\', '/' => '/', '_' => "\xc2\xa0");
static $mapping = array('t' => "\t", 'n' => "\n", 'r' => "\r", 'f' => "\x0C", 'b' => "\x08", '"' => '"', '\\' => '\\', '/' => '/', '_' => "\xc2\xa0");
$sq = $m[0];
if (isset($mapping[$sq[1]])) {
return $mapping[$sq[1]];
Expand All @@ -302,7 +302,7 @@ private function error($message = "Unexpected '%s'")
$text = substr($this->input, 0, $offset);
$line = substr_count($text, "\n") + 1;
$col = $offset - strrpos("\n" . $text, "\n") + 1;
$token = $last ? str_replace("\n", '<new line>', substr($last[0], 0, 40)) : 'end';
$token = $last ? str_replace("\n", '<new line>', substr($last[0], 0, 40)) : 'end';
throw new NeonException(str_replace('%s', $token, $message) . " on line $line, column $col.");
}

Expand Down

0 comments on commit 44537fa

Please sign in to comment.