You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 15, 2025. It is now read-only.
This repository was archived by the owner on Feb 15, 2025. It is now read-only.
PHP Fatal error: Uncaught Error: Object of class PhpParser\Node\UnionType could not be converted to string in /vendor/php-censor/phpdoc-checker/src/FileProcessor.php:173 #49
PHPDOCCHECK
PHPDoc Checker
PHP Fatal error: Uncaught Error: Object of class PhpParser\Node\UnionType could not be converted to string in /vendor/php-censor/phpdoc-checker/src/FileProcessor.php:173
was caused by: public function getInstance(Class1|Class2 $item = null): self
and temporarily fixed by
either removal of null: public function getInstance(Class1|Class2 $item): self
either adding the null to types: public function factoryMethod(Class1|Class2|null $item = null): self
Acceptance Criteria:
PHPDoc Checker can read functions with union typed properties without the causing PHP error and output readable notice about deveoper's error. Something like:
Please add |null to $item in getInstance() to be able to set the value = null.
was caused by:
public function getInstance(Class1|Class2 $item = null): selfand temporarily fixed by
either removal of null:
public function getInstance(Class1|Class2 $item): selfeither adding the null to types:
public function factoryMethod(Class1|Class2|null $item = null): selfAcceptance Criteria:
PHPDoc Checker can read functions with union typed properties without the causing PHP error and output readable notice about deveoper's error. Something like:
Please add |null to $item in getInstance() to be able to set the value = null.