Use new %TagClass%() instead of %TagClass%::tag() #1039
Annotations
10 warnings
|
mutation / PHP 8.5-ubuntu-latest:
src/Tag/Select.php#L276
Escaped Mutant for Mutator "CastString":
@@ @@
protected function before(): string
{
- $name = (string) ($this->attributes['name'] ?? '');
+ $name = $this->attributes['name'] ?? '';
if (
empty($name)
|| (
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Tag/Select.php#L74
Escaped Mutant for Mutator "Ternary":
@@ @@
*/
public function values(iterable $values): self
{
- $values = is_array($values) ? $values : iterator_to_array($values);
+ $values = is_array($values) ? iterator_to_array($values) : $values;
return $this->value(...$values);
}
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Tag/Input/Range.php#L141
Escaped Mutant for Mutator "CastString":
@@ @@
*/
private function fillOutputId(): void
{
- $id = (string) ($this->outputAttributes['id'] ?? '');
+ $id = $this->outputAttributes['id'] ?? '';
$this->outputId = $id === '' ? Html::generateId('rangeOutput') : $id;
}
}
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Tag/Input/File.php#L82
Escaped Mutant for Mutator "CastString":
@@ @@
return '';
}
- $name = (string) ($this->attributes['name'] ?? '');
+ $name = $this->attributes['name'] ?? '';
if (empty($name)) {
return '';
}
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Tag/Form.php#L47
Escaped Mutant for Mutator "CloneRemoval":
@@ @@
public function csrf(string|Stringable|null $token, string $name = '_csrf'): self
{
- $new = clone $this;
+ $new = $this;
$new->csrfToken = $token === null ? null : (string) $token;
$new->csrfName = $name;
return $new;
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Tag/Base/MediaTag.php#L52
Escaped Mutant for Mutator "CastString":
@@ @@
final public function fallback(string|Stringable|null $fallback): static
{
$new = clone $this;
- $new->fallback = $fallback === null ? null : (string) $fallback;
+ $new->fallback = $fallback === null ? null : $fallback;
return $new;
}
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Tag/Base/BooleanInputTag.php#L130
Escaped Mutant for Mutator "CastString":
@@ @@
private function renderUncheckInput(): string
{
- $name = (string) ($this->attributes['name'] ?? '');
+ $name = $this->attributes['name'] ?? '';
if (empty($name) || $this->uncheckValue === null) {
return '';
}
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Html.php#L1711
Escaped Mutant for Mutator "Assignment":
@@ @@
}
$fullName = "$name-$n";
if (in_array($fullName, self::ATTRIBUTES_WITH_CONCATENATED_VALUES, true)) {
- $html .= self::renderAttribute(
+ $html = self::renderAttribute(
$fullName,
self::encodeAttribute(
is_array($v) ? implode(' ', $v) : $v,
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Html.php#L1707
Escaped Mutant for Mutator "Continue_":
@@ @@
/** @psalm-var array<array-key, scalar[]|string|Stringable|null> $value */
foreach ($value as $n => $v) {
if (!isset($v)) {
- continue;
+ break;
}
$fullName = "$name-$n";
if (in_array($fullName, self::ATTRIBUTES_WITH_CONCATENATED_VALUES, true)) {
|
|
mutation / PHP 8.5-ubuntu-latest:
src/Html.php#L1683
Escaped Mutant for Mutator "GreaterThan":
@@ @@
*/
public static function renderTagAttributes(array $attributes): string
{
- if (count($attributes) > 1) {
+ if (count($attributes) >= 1) {
$sorted = [];
foreach (self::ATTRIBUTE_ORDER as $name) {
if (isset($attributes[$name])) {
|