Fix docs (#92) #563
Annotations
10 warnings
mutation / PHP 8.1-ubuntu-latest:
src/Dropdown.php#L494
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
/** @var array */
$items = $item['items'] ?? [];
/** @var array */
- $urlAttributes = $item['urlAttributes'] ?? [];
+ $urlAttributes = [] ?? $item['urlAttributes'];
/** @var string */
$iconText = $item['iconText'] ?? '';
/** @var string */
|
mutation / PHP 8.1-ubuntu-latest:
src/Dropdown.php#L500
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
/** @var string */
$iconText = $item['iconText'] ?? '';
/** @var string */
- $iconCssClass = $item['iconCssClass'] ?? '';
+ $iconCssClass = '' ?? $item['iconCssClass'];
/** @var array */
$iconAttributes = $item['iconAttributes'] ?? [];
/** @var string */
|
mutation / PHP 8.1-ubuntu-latest:
src/Dropdown.php#L503
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
/** @var string */
$iconCssClass = $item['iconCssClass'] ?? '';
/** @var array */
- $iconAttributes = $item['iconAttributes'] ?? [];
+ $iconAttributes = [] ?? $item['iconAttributes'];
/** @var string */
$url = $item['url'] ?? '';
/** @var bool */
|
mutation / PHP 8.1-ubuntu-latest:
src/Dropdown.php#L518
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
/** @var bool */
$enclose = $item['enclose'] ?? true;
/** @var bool */
- $submenu = $item['submenu'] ?? false;
+ $submenu = $item['submenu'] ?? true;
$itemLabel = $this->renderLabelItem($itemLabel, $iconText, $iconCssClass, $iconAttributes);
Html::addCssClass($urlAttributes, $this->itemCssClass);
if ($disabled) {
|
mutation / PHP 8.1-ubuntu-latest:
src/Dropdown.php#L555
Escaped Mutant for Mutator "UnwrapArrayMerge":
--- Original
+++ New
@@ @@
}
$lines[] = $content;
} else {
- $submenuAttributes = isset($item['submenuAttributes']) && is_array($item['submenuAttributes']) ? array_merge($this->submenuAttributes, $item['submenuAttributes']) : $this->submenuAttributes;
+ $submenuAttributes = isset($item['submenuAttributes']) && is_array($item['submenuAttributes']) ? $this->submenuAttributes : $this->submenuAttributes;
$lines[] = self::widget()->attributes($this->attributes)->dividerCssClass($this->dividerCssClass)->itemCssClass($this->itemCssClass)->items($items)->submenu($submenu)->submenuAttributes($submenuAttributes)->render();
}
}
|
mutation / PHP 8.1-ubuntu-latest:
src/Dropdown.php#L555
Escaped Mutant for Mutator "UnwrapArrayMerge":
--- Original
+++ New
@@ @@
}
$lines[] = $content;
} else {
- $submenuAttributes = isset($item['submenuAttributes']) && is_array($item['submenuAttributes']) ? array_merge($this->submenuAttributes, $item['submenuAttributes']) : $this->submenuAttributes;
+ $submenuAttributes = isset($item['submenuAttributes']) && is_array($item['submenuAttributes']) ? $item['submenuAttributes'] : $this->submenuAttributes;
$lines[] = self::widget()->attributes($this->attributes)->dividerCssClass($this->dividerCssClass)->itemCssClass($this->itemCssClass)->items($items)->submenu($submenu)->submenuAttributes($submenuAttributes)->render();
}
}
|
mutation / PHP 8.1-ubuntu-latest:
src/Dropdown.php#L585
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
{
$html = '';
if ($label !== '') {
- $html = PHP_EOL . Span::tag()->attributes($labelAttributes)->content($label)->encode(false)->render();
+ $html = PHP_EOL . Span::tag()->attributes($labelAttributes)->content($label)->encode(true)->render();
}
if ($iconText !== '' || $iconCssClass !== '') {
$html .= PHP_EOL . Span::tag()->attributes($iconAttributes)->content(CustomTag::name('i')->class($iconCssClass)->content($iconText)->encode(false)->render())->encode(false)->render();
|
mutation / PHP 8.1-ubuntu-latest:
src/Dropdown.php#L589
Escaped Mutant for Mutator "LogicalOrAllSubExprNegation":
--- Original
+++ New
@@ @@
if ($label !== '') {
$html = PHP_EOL . Span::tag()->attributes($labelAttributes)->content($label)->encode(false)->render();
}
- if ($iconText !== '' || $iconCssClass !== '') {
+ if (!($iconText !== '') || !($iconCssClass !== '')) {
$html .= PHP_EOL . Span::tag()->attributes($iconAttributes)->content(CustomTag::name('i')->class($iconCssClass)->content($iconText)->encode(false)->render())->encode(false)->render();
}
return $html . PHP_EOL;
|
mutation / PHP 8.1-ubuntu-latest:
src/Menu.php#L154
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function hiddenEmptyItems() : self
{
- $new = clone $this;
+ $new = $this;
$new->hiddenEmptyItems = true;
return $new;
}
|
mutation / PHP 8.1-ubuntu-latest:
src/Menu.php#L237
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
if ($value === '') {
throw new InvalidArgumentException('Tag for item container cannot be empty.');
}
- $new = clone $this;
+ $new = $this;
$new->itemsTag = $value;
return $new;
}
|