Skip to content

Fix expression in testing matrix with ternary operator #9

Fix expression in testing matrix with ternary operator

Fix expression in testing matrix with ternary operator #9

Triggered via push November 4, 2023 23:07
Status Failure
Total duration 1m 54s
Artifacts

ci.yaml

on: push
Matrix: run
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 18 warnings
PHP 8.3 PHP upcoming
Process completed with exit code 1.
PHP 8.4 PHP nightly
Process completed with exit code 1.
PHP 8.2: src/DependencyInjection/AntiSpamExtension.php#L42
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $container->register($id, Profile::class)->addTag('antispam.profile')->addArgument($name)->addArgument($profile); } unset($mergedConfig['profiles']); - $container->register(AntiSpam::class, AntiSpam::class)->setArgument(1, $mergedConfig)->setAutowired(true); + } public function prepend(ContainerBuilder $container) {
PHP 8.2: src/DependencyInjection/AntiSpamExtension.php#L45
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ $container->register($id, Profile::class)->addTag('antispam.profile')->addArgument($name)->addArgument($profile); } unset($mergedConfig['profiles']); - $container->register(AntiSpam::class, AntiSpam::class)->setArgument(1, $mergedConfig)->setAutowired(true); + $container->register(AntiSpam::class, AntiSpam::class)->setArgument(1, $mergedConfig)->setAutowired(false); } public function prepend(ContainerBuilder $container) {
PHP 8.2: src/Form/Extension/FormTypeAntiSpamExtension.php#L76
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ $config = $child->getConfig(); $type = $config->getType(); while (null !== $type) { - if ($type->getInnerType() instanceof TextType) { + if (true) { $options = $config->getOptions(); $this->applyTextTypeProfile($options, $profile); $event->getForm()->add($name, $type->getInnerType()::class, $options);
PHP 8.2: src/Form/Extension/FormTypeAntiSpamExtension.php#L114
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ // Add hidden and signed timer field if ($timer = $profile->getTimerConfig()) { if ($form->isRoot()) { - $form->add(self::uniqueFieldName($form, $timer['field']), SubmitTimerType::class, ['min' => $timer['min'], 'max' => $timer['max']]); + $form->add(self::uniqueFieldName($form, $timer['field']), SubmitTimerType::class, ['max' => $timer['max']]); } else { $this->logger?->info(sprintf('Ignoring timer configuration from profile "%s" on embedded form', $profile->getName())); }
PHP 8.2: src/Form/Type/SubmitTimerType.php#L82
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } $currentIp = $this->requestStack->getMainRequest()?->getClientIp() ?? self::NO_IP; if (null !== $currentIp && $ip !== $currentIp) { - $this->createFormError($form, 'form.timer.mismatch_ip', ['original' => $ip, 'current' => $currentIp], cause: "The client IP address changed from {$ip} to {$currentIp}"); + $this->createFormError($form, 'form.timer.mismatch_ip', ['current' => $currentIp], cause: "The client IP address changed from {$ip} to {$currentIp}"); } $age = $this->now()->getTimestamp() - intval($ts); if ($age < $options['min']) {
PHP 8.2: src/Profile.php#L80
Escaped Mutant for Mutator "Coalesce": --- Original +++ New @@ @@ */ public function getTextTypeConstraints() : array { - return $this->constraints ?? $this->buildTextTypeConstraints(); + return $this->buildTextTypeConstraints() ?? $this->constraints; } /** * Note that constraints are added in order of increasing cost/effectiveness balance so the resulting array
PHP 8.2: src/Validator/Constraints/BannedMarkup.php#L19
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class BannedMarkup extends AntiSpamConstraint { - public function __construct(public bool $html = true, public bool $bbcode = true, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) + public function __construct(public bool $html = false, public bool $bbcode = true, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) { parent::__construct($passive, $stealth, $groups, $payload); } }
PHP 8.2: src/Validator/Constraints/BannedMarkup.php#L20
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class BannedMarkup extends AntiSpamConstraint { - public function __construct(public bool $html = true, public bool $bbcode = true, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) + public function __construct(public bool $html = true, public bool $bbcode = false, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) { parent::__construct($passive, $stealth, $groups, $payload); } }
PHP 8.2: src/Validator/Constraints/BannedPhrases.php#L38
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ #[HasNamedArguments] public function __construct(string|array $phrases, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) { - $this->phrases = is_array($phrases) ? $phrases : [$phrases]; + $this->phrases = is_array($phrases) ? $phrases : []; parent::__construct($passive, $stealth, $groups, $payload); } public function getRegularExpression() : string
PHP 8.1: src/DependencyInjection/AntiSpamExtension.php#L42
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $container->register($id, Profile::class)->addTag('antispam.profile')->addArgument($name)->addArgument($profile); } unset($mergedConfig['profiles']); - $container->register(AntiSpam::class, AntiSpam::class)->setArgument(1, $mergedConfig)->setAutowired(true); + } public function prepend(ContainerBuilder $container) {
PHP 8.1: src/DependencyInjection/AntiSpamExtension.php#L45
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ $container->register($id, Profile::class)->addTag('antispam.profile')->addArgument($name)->addArgument($profile); } unset($mergedConfig['profiles']); - $container->register(AntiSpam::class, AntiSpam::class)->setArgument(1, $mergedConfig)->setAutowired(true); + $container->register(AntiSpam::class, AntiSpam::class)->setArgument(1, $mergedConfig)->setAutowired(false); } public function prepend(ContainerBuilder $container) {
PHP 8.1: src/Form/Extension/FormTypeAntiSpamExtension.php#L76
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ $config = $child->getConfig(); $type = $config->getType(); while (null !== $type) { - if ($type->getInnerType() instanceof TextType) { + if (true) { $options = $config->getOptions(); $this->applyTextTypeProfile($options, $profile); $event->getForm()->add($name, $type->getInnerType()::class, $options);
PHP 8.1: src/Form/Extension/FormTypeAntiSpamExtension.php#L114
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ // Add hidden and signed timer field if ($timer = $profile->getTimerConfig()) { if ($form->isRoot()) { - $form->add(self::uniqueFieldName($form, $timer['field']), SubmitTimerType::class, ['min' => $timer['min'], 'max' => $timer['max']]); + $form->add(self::uniqueFieldName($form, $timer['field']), SubmitTimerType::class, ['max' => $timer['max']]); } else { $this->logger?->info(sprintf('Ignoring timer configuration from profile "%s" on embedded form', $profile->getName())); }
PHP 8.1: src/Form/Type/SubmitTimerType.php#L82
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } $currentIp = $this->requestStack->getMainRequest()?->getClientIp() ?? self::NO_IP; if (null !== $currentIp && $ip !== $currentIp) { - $this->createFormError($form, 'form.timer.mismatch_ip', ['original' => $ip, 'current' => $currentIp], cause: "The client IP address changed from {$ip} to {$currentIp}"); + $this->createFormError($form, 'form.timer.mismatch_ip', ['current' => $currentIp], cause: "The client IP address changed from {$ip} to {$currentIp}"); } $age = $this->now()->getTimestamp() - intval($ts); if ($age < $options['min']) {
PHP 8.1: src/Profile.php#L80
Escaped Mutant for Mutator "Coalesce": --- Original +++ New @@ @@ */ public function getTextTypeConstraints() : array { - return $this->constraints ?? $this->buildTextTypeConstraints(); + return $this->buildTextTypeConstraints() ?? $this->constraints; } /** * Note that constraints are added in order of increasing cost/effectiveness balance so the resulting array
PHP 8.1: src/Validator/Constraints/BannedMarkup.php#L19
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class BannedMarkup extends AntiSpamConstraint { - public function __construct(public bool $html = true, public bool $bbcode = true, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) + public function __construct(public bool $html = false, public bool $bbcode = true, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) { parent::__construct($passive, $stealth, $groups, $payload); } }
PHP 8.1: src/Validator/Constraints/BannedMarkup.php#L20
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class BannedMarkup extends AntiSpamConstraint { - public function __construct(public bool $html = true, public bool $bbcode = true, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) + public function __construct(public bool $html = true, public bool $bbcode = false, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) { parent::__construct($passive, $stealth, $groups, $payload); } }
PHP 8.1: src/Validator/Constraints/BannedPhrases.php#L38
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ #[HasNamedArguments] public function __construct(string|array $phrases, bool $passive = null, bool $stealth = null, array $groups = null, mixed $payload = null) { - $this->phrases = is_array($phrases) ? $phrases : [$phrases]; + $this->phrases = is_array($phrases) ? $phrases : []; parent::__construct($passive, $stealth, $groups, $payload); } public function getRegularExpression() : string