Skip to content

Commit c887f2c

Browse files
authored
Update Resource.php
1 parent 8b91f73 commit c887f2c

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/Resource.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
*/
1212
class Resource implements JsonSerializable
1313
{
14-
/**
15-
* Resource name pattern regex - must contain only alphanumeric characters, underscores, and hyphens.
16-
*/
17-
private const RESOURCE_NAME_PATTERN = '/^[a-zA-Z0-9_-]+$/';
18-
1914
/**
2015
* URI pattern regex - requires a valid scheme, followed by colon and optional path.
2116
* Example patterns: config://, file://path, db://table, etc.
@@ -40,9 +35,6 @@ public function __construct(
4035
public readonly ?Annotations $annotations = null,
4136
public readonly ?int $size = null
4237
) {
43-
if (!preg_match(self::RESOURCE_NAME_PATTERN, $name)) {
44-
throw new \InvalidArgumentException("Invalid resource name: must contain only alphanumeric characters, underscores, and hyphens.");
45-
}
4638
if (!preg_match(self::URI_PATTERN, $uri)) {
4739
throw new \InvalidArgumentException("Invalid resource URI: must be a valid URI with a scheme and optional path.");
4840
}

0 commit comments

Comments
 (0)