mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-11 19:04:31 +02:00
Fixed code style.
This commit is contained in:
parent
2853e471c4
commit
d0b1024d80
212 changed files with 495 additions and 1005 deletions
|
@ -56,14 +56,14 @@ class UrlOrBuiltinValidator extends UrlValidator
|
|||
{
|
||||
public function validate($value, Constraint $constraint): void
|
||||
{
|
||||
if (! $constraint instanceof UrlOrBuiltin) {
|
||||
if (!$constraint instanceof UrlOrBuiltin) {
|
||||
throw new UnexpectedTypeException($constraint, UrlOrBuiltin::class);
|
||||
}
|
||||
|
||||
if (null === $value || '' === $value) {
|
||||
return;
|
||||
}
|
||||
if (! is_scalar($value) && ! (\is_object($value) && method_exists($value, '__toString'))) {
|
||||
if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) {
|
||||
throw new UnexpectedValueException($value, 'string');
|
||||
}
|
||||
$value = (string) $value;
|
||||
|
@ -74,7 +74,7 @@ class UrlOrBuiltinValidator extends UrlValidator
|
|||
//After the %PLACEHOLDER% comes a slash, so we can check if we have a placholder via explode
|
||||
$tmp = explode('/', $value);
|
||||
//Builtins must have a %PLACEHOLDER% construction
|
||||
if (! empty($tmp) && \in_array($tmp[0], $constraint->allowed_placeholders, false)) {
|
||||
if (!empty($tmp) && \in_array($tmp[0], $constraint->allowed_placeholders, false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue