Skip to content

Commit

Permalink
fix #63 and provide better exception message when tags is not formatt…
Browse files Browse the repository at this point in the history
…ed correct
  • Loading branch information
Sebastix committed Nov 24, 2024
1 parent d7a93b1 commit 0d84bfb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Filter/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
use swentel\nostr\FilterInterface;
use swentel\nostr\Key\Key;

use function PHPUnit\Framework\throwException;

#[\AllowDynamicProperties]
class Filter implements FilterInterface
{
/**
Expand Down Expand Up @@ -46,7 +45,7 @@ class Filter implements FilterInterface
*/
public int $since;

/**
/**t
* An integer unix timestamp in seconds, events must be older than this to pass
*/
public int $until;
Expand Down Expand Up @@ -160,7 +159,7 @@ private function validateTagName($tag): void
{
// Check if tag starts with #.
if (!str_starts_with($tag, '#')) {
throw new \RuntimeException('All tags must start with #');
throw new \RuntimeException('All tags on a filter must start with #');
}
// Check if tag has valid value.
$pattern = '/^#[a-z_-]+$/i';
Expand Down

0 comments on commit 0d84bfb

Please sign in to comment.