Skip to content

Commit

Permalink
Fix the factory methods to return instead of throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
rybakit committed Jun 28, 2021
1 parent 7a63d90 commit 8143d71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Annotation/InvalidAnnotationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ final class InvalidAnnotationException extends Exception
{
public static function unknownName(string $name) : self
{
throw new self(sprintf('Unknown annotation "%s"', $name));
return new self(sprintf('Unknown annotation "%s"', $name));
}

public static function invalidSyntax(string $annotation, string $reason = '') : self
{
throw new self(sprintf('Unable to parse "%s": %s', $annotation, $reason));
return new self(sprintf('Unable to parse "%s": %s', $annotation, $reason));
}

public static function unresolvedPlaceholder(string $placeholder) : self
{
throw new self(sprintf('Unresolved placeholder "%s"', $placeholder));
return new self(sprintf('Unresolved placeholder "%s"', $placeholder));
}

public static function unknownRequirement(string $requirement) : self
{
throw new self(sprintf('Unknown requirement "%s"', $requirement));
return new self(sprintf('Unknown requirement "%s"', $requirement));
}
}

0 comments on commit 8143d71

Please sign in to comment.