Add checkbox/radio lists methods to set wrap classes #908
Annotations
10 warnings
mutation / PHP 8.3-ubuntu-latest:
src/Html.php#L1613
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
*/
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])) {
|
mutation / PHP 8.3-ubuntu-latest:
src/Html.php#L1637
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
/** @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.3-ubuntu-latest:
src/Html.php#L1641
Escaped Mutant for Mutator "Assignment":
--- Original
+++ New
@@ @@
}
$fullName = "{$name}-{$n}";
if (in_array($fullName, self::ATTRIBUTES_WITH_CONCATENATED_VALUES, true)) {
- $html .= self::renderAttribute($fullName, self::encodeAttribute(is_array($v) ? implode(' ', $v) : $v));
+ $html = self::renderAttribute($fullName, self::encodeAttribute(is_array($v) ? implode(' ', $v) : $v));
} else {
$html .= is_array($v) ? self::renderAttribute($fullName, Json::htmlEncode($v), '\'') : self::renderAttribute($fullName, self::encodeAttribute($v));
}
|
mutation / PHP 8.3-ubuntu-latest:
src/Html.php#L1744
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
}
} else {
/** @var string[] */
- $classes = preg_split('/\\s+/', (string) $options['class'], -1, PREG_SPLIT_NO_EMPTY);
+ $classes = preg_split('/\\s+/', $options['class'], -1, PREG_SPLIT_NO_EMPTY);
$classes = array_diff($classes, (array) $class);
if (empty($classes)) {
unset($options['class']);
|
mutation / PHP 8.3-ubuntu-latest:
src/Html.php#L1895
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
public static function cssStyleToArray(string|Stringable $style) : array
{
$result = [];
- foreach (explode(';', (string) $style) as $property) {
+ foreach (explode(';', $style) as $property) {
$property = explode(':', $property);
if (count($property) > 1) {
$result[trim($property[0])] = trim($property[1]);
|
mutation / PHP 8.3-ubuntu-latest:
src/Tag/Base/BooleanInputTag.php#L106
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
}
private function renderUncheckInput() : string
{
- $name = (string) ($this->attributes['name'] ?? '');
+ $name = $this->attributes['name'] ?? '';
if (empty($name) || $this->uncheckValue === null) {
return '';
}
|
mutation / PHP 8.3-ubuntu-latest:
src/Tag/Base/MediaTag.php#L52
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
public final 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;
}
public final function tracks(Track ...$tracks) : static
|
mutation / PHP 8.3-ubuntu-latest:
src/Tag/Base/Tag.php#L91
Escaped Mutant for Mutator "UnwrapArrayFilter":
--- Original
+++ New
@@ @@
public final function addClass(?string ...$class) : static
{
$new = clone $this;
- Html::addCssClass($new->attributes, array_filter($class, static fn($c) => $c !== null));
+ Html::addCssClass($new->attributes, $class);
return $new;
}
/**
|
mutation / PHP 8.3-ubuntu-latest:
src/Tag/Form.php#L47
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
}
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.3-ubuntu-latest:
src/Tag/Input/File.php#L82
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
if ($this->uncheckValue === null) {
return '';
}
- $name = (string) ($this->attributes['name'] ?? '');
+ $name = $this->attributes['name'] ?? '';
if (empty($name)) {
return '';
}
|