Skip to content

Commit

Permalink
non-empty-string in Identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Apr 13, 2024
1 parent 999135f commit e244286
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/PhpParser/Node/Identifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
* Represents a non-namespaced name. Namespaced names are represented using Name nodes.
*/
class Identifier extends NodeAbstract {
/** @var string Identifier as string */
/**
* @psalm-var non-empty-string
* @var string Identifier as string
*/
public string $name;

/** @var array<string, bool> */
Expand All @@ -21,6 +24,7 @@ class Identifier extends NodeAbstract {
/**
* Constructs an identifier node.
*
* @psalm-param non-empty-string $name
* @param string $name Identifier as string
* @param array<string, mixed> $attributes Additional attributes
*/
Expand All @@ -36,6 +40,7 @@ public function getSubNodeNames(): array {
/**
* Get identifier as string.
*
* @psalm-return non-empty-string
* @return string Identifier as string.
*/
public function toString(): string {
Expand All @@ -45,6 +50,7 @@ public function toString(): string {
/**
* Get lowercased identifier as string.
*
* @psalm-return non-empty-string
* @return string Lowercased identifier as string
*/
public function toLowerString(): string {
Expand All @@ -63,6 +69,7 @@ public function isSpecialClassName(): bool {
/**
* Get identifier as string.
*
* @psalm-return non-empty-string
* @return string Identifier as string
*/
public function __toString(): string {
Expand Down

0 comments on commit e244286

Please sign in to comment.