- Some minor on request debugger
This commit is contained in:
1 parent
c3e3d6a73a
commit
ba74c5a38e
17 files changed
+255
-202
No files matched your search
@@ -17,8 +17,8 @@ class ContextField
|
||||
public ?int $maxLength = null,
|
||||
public ?string $regexFormat = null,
|
||||
public ?string $example = null,
|
||||
public bool $hidden = false,
|
||||
public mixed $default = null,
|
||||
public bool $hidden = false,
|
||||
) {}
|
||||
|
||||
public function assertValueSpecs(mixed $value, bool $isNew) : void
|
||||
@@ -39,10 +39,7 @@ class ContextField
|
||||
}
|
||||
|
||||
if ($this->regexFormat) {
|
||||
if (! is_string($value)) {
|
||||
throw new RegexFormatException("Property type must be a string if a regexFormat is provided.");
|
||||
}
|
||||
elseif (! preg_match($this->regexFormat, $value)) {
|
||||
if (! preg_match($this->regexFormat, $value)) {
|
||||
throw new RegexFormatException("Regex format {$this->regexFormat} is not valid for value {$value}.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user