Skip to content

Commit

Permalink
Added null check for __toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerzabek committed Oct 26, 2024
1 parent 00876af commit 624dde5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Annotation/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ public function appendJson(object $json): self
*/
public function __toString()
{
return $this->alias . '=' . $this->namespace;
return is_null($this->alias) ? $this->namespace : $this->alias . '=' . $this->namespace;
}
}

0 comments on commit 624dde5

Please sign in to comment.