Skip to content

Commit

Permalink
Specify some more types
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Sep 11, 2022
1 parent a099803 commit 40c89cf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions lib/PhpParser/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@
namespace PhpParser;

class Comment implements \JsonSerializable {
/** @var string string */
protected $text;
/** @var int */
protected $startLine;
/** @var int */
protected $startFilePos;
/** @var int */
protected $startTokenPos;
/** @var int */
protected $endLine;
/** @var int */
protected $endFilePos;
/** @var int */
protected $endTokenPos;

/**
Expand Down
1 change: 1 addition & 0 deletions lib/PhpParser/ConstExprEvaluator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* affected by the LC_NUMERIC locale.
*/
class ConstExprEvaluator {
/** @var callable|null */
private $fallbackEvaluator;

/**
Expand Down
2 changes: 2 additions & 0 deletions lib/PhpParser/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
namespace PhpParser;

class Error extends \RuntimeException {
/** @var string */
protected $rawMessage;
/** @var array<string, mixed> */
protected $attributes;

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/PhpParser/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function getType(): string;
/**
* Gets the names of the sub nodes.
*
* @return array Names of sub nodes
* @return string[] Names of sub nodes
*/
public function getSubNodeNames(): array;

Expand Down Expand Up @@ -137,7 +137,7 @@ public function getAttribute(string $key, $default = null);
/**
* Returns all the attributes of this node.
*
* @return array
* @return array<string, mixed>
*/
public function getAttributes(): array;

Expand Down

0 comments on commit 40c89cf

Please sign in to comment.