File tree Expand file tree Collapse file tree 1 file changed +0
-8
lines changed
Expand file tree Collapse file tree 1 file changed +0
-8
lines changed Original file line number Diff line number Diff line change 1111 */
1212class 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 }
You can’t perform that action at this time.
0 commit comments