Fixed code style.

This commit is contained in:
Jan Böhmer 2020-08-21 21:36:22 +02:00
parent 2853e471c4
commit d0b1024d80
212 changed files with 495 additions and 1005 deletions

View file

@ -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;
}