mirror of
https://github.com/Respect/Validation.git
synced 2024-06-03 06:12:17 +02:00
Apply "SlevomatCodingStandard.ControlStructures.RequireTernaryOperator"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
e500222f5b
commit
3abf64f496
|
@ -65,17 +65,13 @@ class Domain extends AbstractComposite
|
|||
|
||||
public function tldCheck(bool $do = true): void
|
||||
{
|
||||
if (true === $do) {
|
||||
$this->tld = new Tld();
|
||||
} else {
|
||||
$this->tld = new AllOf(
|
||||
new Not(
|
||||
new StartsWith('-')
|
||||
),
|
||||
new NoWhitespace(),
|
||||
new Length(2, null)
|
||||
);
|
||||
}
|
||||
$this->tld = $do ? new Tld() : new AllOf(
|
||||
new Not(
|
||||
new StartsWith('-')
|
||||
),
|
||||
new NoWhitespace(),
|
||||
new Length(2, null)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,11 +59,7 @@ class Zend extends AbstractRule
|
|||
*/
|
||||
private function createZendValidator(string $name, array $params): ZendValidator
|
||||
{
|
||||
if (false === mb_stripos($name, 'Zend')) {
|
||||
$name = "Zend\\Validator\\{$name}";
|
||||
} else {
|
||||
$name = "\\{$name}";
|
||||
}
|
||||
$name = false === mb_stripos($name, 'Zend') ? "Zend\\Validator\\{$name}" : "\\{$name}";
|
||||
|
||||
$reflection = new ReflectionClass($name);
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator" />
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator" />
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
|
||||
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch" />
|
||||
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly" />
|
||||
|
|
Loading…
Reference in a new issue