Skip to content

Commit

Permalink
Documented when Badge::__construct() could throw
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jul 21, 2021
1 parent 3c1e4da commit fc5634d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Configuration/Entry/Badge.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ final class Badge
{
private string $branchMatch;

/**
* @throws InvalidArgumentException when the provided $branch looks like a regular expression, but is not a valid one
*/
public function __construct(string $branch)
{
if (preg_match('#^/.+/$#', $branch) === 0) {
Expand Down

0 comments on commit fc5634d

Please sign in to comment.