Skip to content

Commit

Permalink
fix: improve antigen validation error message
Browse files Browse the repository at this point in the history
  • Loading branch information
SOF3 committed Jun 13, 2024
1 parent 7507440 commit 35fcb05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Virion/VirionProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class VirionProcessor implements Processor {
*/
public function __construct(string $antigen, private string $epitope, private ?string $shared, private ?array $sourceRoots) {
if (!preg_match('#^[a-zA-Z0-9_]+(\\\\[a-zA-Z0-9_]+)+$#', $antigen, $matches)) {
echo "\"$antigen\" is not a valid class name";
echo "\"$antigen\" is not a valid namespace root. Namespace root must have at least two path components, e.g. `SOF3\\Pharynx`.";
exit(1);
}
if (str_ends_with($epitope, "\\")) {
Expand Down

0 comments on commit 35fcb05

Please sign in to comment.