@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | { |
39 | 39 | public function validate($value, Constraint $constraint): void |
40 | 40 | { |
41 | - if (! $constraint instanceof UrlOrBuiltin) { |
|
41 | + if (!$constraint instanceof UrlOrBuiltin) { |
|
42 | 42 | throw new UnexpectedTypeException($constraint, UrlOrBuiltin::class); |
43 | 43 | } |
44 | 44 | |
45 | 45 | if (null === $value || '' === $value) { |
46 | 46 | return; |
47 | 47 | } |
48 | - if (! is_scalar($value) && ! (\is_object($value) && method_exists($value, '__toString'))) { |
|
48 | + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { |
|
49 | 49 | throw new UnexpectedValueException($value, 'string'); |
50 | 50 | } |
51 | 51 | $value = (string) $value; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | //After the %PLACEHOLDER% comes a slash, so we can check if we have a placholder via explode |
57 | 57 | $tmp = explode('/', $value); |
58 | 58 | //Builtins must have a %PLACEHOLDER% construction |
59 | - if (! empty($tmp) && \in_array($tmp[0], $constraint->allowed_placeholders, false)) { |
|
59 | + if (!empty($tmp) && \in_array($tmp[0], $constraint->allowed_placeholders, false)) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function validate($value, Constraint $constraint): void |
45 | 45 | { |
46 | - if (! $constraint instanceof ValidGoogleAuthCode) { |
|
46 | + if (!$constraint instanceof ValidGoogleAuthCode) { |
|
47 | 47 | throw new UnexpectedTypeException($constraint, ValidGoogleAuthCode::class); |
48 | 48 | } |
49 | 49 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | - if (! \is_string($value)) { |
|
54 | + if (!\is_string($value)) { |
|
55 | 55 | throw new UnexpectedValueException($value, 'string'); |
56 | 56 | } |
57 | 57 | |
58 | - if (! ctype_digit($value)) { |
|
58 | + if (!ctype_digit($value)) { |
|
59 | 59 | $this->context->addViolation('validator.google_code.only_digits_allowed'); |
60 | 60 | } |
61 | 61 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $user = $this->context->getObject()->getParent()->getData(); |
72 | 72 | |
73 | 73 | //Check if the given code is valid |
74 | - if (! $this->googleAuthenticator->checkCode($user, $value)) { |
|
74 | + if (!$this->googleAuthenticator->checkCode($user, $value)) { |
|
75 | 75 | $this->context->addViolation('validator.google_code.wrong_code'); |
76 | 76 | } |
77 | 77 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function validate($value, Constraint $constraint): void |
49 | 49 | { |
50 | - if (! $constraint instanceof ValidFileFilter) { |
|
50 | + if (!$constraint instanceof ValidFileFilter) { |
|
51 | 51 | throw new UnexpectedTypeException($constraint, ValidFileFilter::class); |
52 | 52 | } |
53 | 53 | |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
58 | - if (! \is_string($value)) { |
|
58 | + if (!\is_string($value)) { |
|
59 | 59 | // throw this exception if your validator cannot handle the passed type so that it can be marked as invalid |
60 | 60 | throw new UnexpectedValueException($value, 'string'); |
61 | 61 | } |
62 | 62 | |
63 | - if (! $this->filterTools->validateFilterString($value)) { |
|
63 | + if (!$this->filterTools->validateFilterString($value)) { |
|
64 | 64 | $this->context->buildViolation('validator.file_type_filter.invalid') |
65 | 65 | ->addViolation(); |
66 | 66 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | public function validate($value, Constraint $constraint): void |
58 | 58 | { |
59 | - if (! $constraint instanceof NoLockout) { |
|
59 | + if (!$constraint instanceof NoLockout) { |
|
60 | 60 | throw new UnexpectedTypeException($constraint, NoLockout::class); |
61 | 61 | } |
62 | 62 |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function validate($value, Constraint $constraint): void |
49 | 49 | { |
50 | - if (! $constraint instanceof ValidPartLot) { |
|
50 | + if (!$constraint instanceof ValidPartLot) { |
|
51 | 51 | throw new UnexpectedTypeException($constraint, ValidPartLot::class); |
52 | 52 | } |
53 | 53 | |
54 | - if (! $value instanceof PartLot) { |
|
54 | + if (!$value instanceof PartLot) { |
|
55 | 55 | throw new UnexpectedTypeException($value, PartLot::class); |
56 | 56 | } |
57 | 57 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | ->atPath('amount')->addViolation(); |
72 | 72 | } |
73 | 73 | |
74 | - if (! $parts->contains($value->getPart())) { |
|
74 | + if (!$parts->contains($value->getPart())) { |
|
75 | 75 | $this->context->buildViolation('validator.part_lot.location_full') |
76 | 76 | ->atPath('storage_location')->addViolation(); |
77 | 77 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | //Check for onlyExisting |
81 | 81 | if ($value->getStorageLocation()->isLimitToExistingParts()) { |
82 | - if (! $parts->contains($value->getPart())) { |
|
82 | + if (!$parts->contains($value->getPart())) { |
|
83 | 83 | $this->context->buildViolation('validator.part_lot.only_existing') |
84 | 84 | ->atPath('storage_location')->addViolation(); |
85 | 85 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | //Check for only single part |
89 | 89 | if ($value->getStorageLocation()->isLimitToExistingParts()) { |
90 | - if (($parts->count() > 0) && ! $parts->contains($value->getPart())) { |
|
90 | + if (($parts->count() > 0) && !$parts->contains($value->getPart())) { |
|
91 | 91 | $this->context->buildViolation('validator.part_lot.single_part') |
92 | 92 | ->atPath('storage_location')->addViolation(); |
93 | 93 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function validate($value, Constraint $constraint): void |
51 | 51 | { |
52 | - if (! $constraint instanceof AllowedFileExtension) { |
|
52 | + if (!$constraint instanceof AllowedFileExtension) { |
|
53 | 53 | throw new UnexpectedTypeException($constraint, AllowedFileExtension::class); |
54 | 54 | } |
55 | 55 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | return; |
71 | 71 | } |
72 | 72 | |
73 | - if (! $this->filterTools->isExtensionAllowed( |
|
73 | + if (!$this->filterTools->isExtensionAllowed( |
|
74 | 74 | $attachment_type->getFiletypeFilter(), |
75 | 75 | $value->getClientOriginalExtension() |
76 | 76 | )) { |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | public function onKernelResponse(FilterResponseEvent $event): void |
64 | 64 | { |
65 | - if (! $this->kernel->getParameter('kernel.debug')) { |
|
65 | + if (!$this->kernel->getParameter('kernel.debug')) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 |
@@ -50,12 +50,12 @@ |
||
50 | 50 | |
51 | 51 | //Check if the user has set a timezone |
52 | 52 | $user = $this->security->getUser(); |
53 | - if ($user instanceof User && ! empty($user->getTimezone())) { |
|
53 | + if ($user instanceof User && !empty($user->getTimezone())) { |
|
54 | 54 | $timezone = $user->getTimezone(); |
55 | 55 | } |
56 | 56 | |
57 | 57 | //Fill with default value if needed |
58 | - if (null === $timezone && ! empty($this->default_timezone)) { |
|
58 | + if (null === $timezone && !empty($this->default_timezone)) { |
|
59 | 59 | $timezone = $this->default_timezone; |
60 | 60 | } |
61 | 61 |
@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | $user = $this->security->getUser(); |
75 | 75 | $request = $event->getRequest(); |
76 | 76 | |
77 | - if (! $event->isMasterRequest()) { |
|
77 | + if (!$event->isMasterRequest()) { |
|
78 | 78 | return; |
79 | 79 | } |
80 | - if (! $user instanceof User) { |
|
80 | + if (!$user instanceof User) { |
|
81 | 81 | return; |
82 | 82 | } |
83 | 83 | |
84 | 84 | //Abort if we dont need to redirect the user. |
85 | - if (! $user->isNeedPwChange() && ! static::TFARedirectNeeded($user)) { |
|
85 | + if (!$user->isNeedPwChange() && !static::TFARedirectNeeded($user)) { |
|
86 | 86 | return; |
87 | 87 | } |
88 | 88 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | $tfa_enabled = $user->isU2FAuthEnabled() || $user->isGoogleAuthenticatorEnabled(); |
127 | 127 | |
128 | - if (null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && ! $tfa_enabled) { |
|
128 | + if (null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && !$tfa_enabled) { |
|
129 | 129 | return true; |
130 | 130 | } |
131 | 131 |