Skip to content

Commit

Permalink
improved phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 10, 2022
1 parent 44abd50 commit d3868db
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Neon/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function valueToNode($val, bool $blockMode = false): Node
}


/** @return Node\ArrayItemNode[] */
private function arrayToNodes($val, bool $blockMode = false): array
{
$res = [];
Expand Down
3 changes: 2 additions & 1 deletion src/Neon/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class Entity extends \stdClass
/** @var mixed */
public $value;

/** @var array */
/** @var mixed[] */
public $attributes;


Expand All @@ -29,6 +29,7 @@ public function __construct($value, array $attrs = [])
}


/** @param mixed[] $properties */
public static function __set_state(array $properties)
{
return new self($properties['value'], $properties['attributes']);
Expand Down
5 changes: 4 additions & 1 deletion src/Neon/Node/ArrayItemNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ final class ArrayItemNode extends Node
public $value;


/** @param self[] $items */
/**
* @param self[] $items
* @return mixed[]
*/
public static function itemsToArray(array $items): array
{
$res = [];
Expand Down
1 change: 1 addition & 0 deletions src/Neon/Node/ArrayNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abstract class ArrayNode extends Node
public $items = [];


/** @return mixed[] */
public function toValue(): array
{
return ArrayItemNode::itemsToArray($this->items);
Expand Down
1 change: 1 addition & 0 deletions src/Neon/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ private function parseBraces(): Node\InlineArrayNode
}


/** @param true[] $arr */
private function checkArrayKey(Node $key, array &$arr): void
{
if ((!$key instanceof Node\StringNode && !$key instanceof Node\LiteralNode) || !is_scalar($key->value)) {
Expand Down

0 comments on commit d3868db

Please sign in to comment.