Skip to content

Commit

Permalink
added PHP 8 typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 1, 2021
1 parent 6a41623 commit 968932f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/Neon/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ final class Decoder

/**
* Decodes a NEON string.
* @return mixed
*/
public function decode(string $input)
public function decode(string $input): mixed
{
if (substr($input, 0, 3) === "\u{FEFF}") { // BOM
$input = substr($input, 3);
Expand Down Expand Up @@ -121,9 +120,8 @@ public function decode(string $input)

/**
* @param string|bool|null $indent indentation (for block-parser)
* @return mixed
*/
private function parse($indent, array $result = null, $key = null, bool $hasKey = false)
private function parse(string|bool|null $indent, array $result = null, $key = null, bool $hasKey = false): mixed
{
$inlineParser = $indent === false;
$value = null;
Expand Down
3 changes: 1 addition & 2 deletions src/Neon/Neon.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ public static function encode($value, int $flags = 0): string
/**
* Converts given NEON to PHP value.
* Returns scalars, arrays, DateTimeImmutable and Entity objects.
* @return mixed
*/
public static function decode(string $input)
public static function decode(string $input): mixed
{
$decoder = new Decoder;
return $decoder->decode($input);
Expand Down

0 comments on commit 968932f

Please sign in to comment.