Allow the renderer argument to be null #197
Annotations
10 warnings
Run infection:
src/Generator/ValueBasedFingerprintGenerator.php#L16
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
private readonly string $hashAlgorithm;
public function __construct(string $hashAlgorithm = 'md5')
{
- Assert::oneOf($hashAlgorithm, hash_algos());
+
$this->hashAlgorithm = $hashAlgorithm;
}
public function generate(TagInterface $tag, string $renderedValue) : string
|
Run infection:
src/Renderer/AttributesAwareRendererTrait.php#L11
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
use Setono\TagBag\Tag\AttributesAwareInterface;
trait AttributesAwareRendererTrait
{
- public function renderAttributes(AttributesAwareInterface $tag) : string
+ protected function renderAttributes(AttributesAwareInterface $tag) : string
{
$attributes = '';
foreach ($tag->getAttributes() as $attribute => $value) {
|
Run infection:
src/Renderer/CompositeRenderer.php#L17
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
private array $renderers = [];
public function __construct(RendererInterface ...$renderers)
{
- foreach ($renderers as $renderer) {
+ foreach (array() as $renderer) {
$this->add($renderer);
}
}
|
Run infection:
src/Renderer/ContentAwareRenderer.php#L23
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function render(TagInterface $tag) : string
{
- Assert::true($this->supports($tag));
+
return $tag->getContent();
}
}
|
Run infection:
src/Renderer/ElementRenderer.php#L28
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
*/
public function render(TagInterface $tag) : string
{
- Assert::true($this->supports($tag));
+
if ($tag->hasClosingElement()) {
return sprintf('<%s%s>%s</%s>', $tag->getElement(), $this->renderAttributes($tag), $tag->getContent(), $tag->getElement());
}
|
Run infection:
src/Tag/AttributesAwareTrait.php#L14
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
{
/** @var array<string, string|null> */
protected array $attributes = [];
- public function hasAttribute(string $attribute) : bool
+ protected function hasAttribute(string $attribute) : bool
{
return array_key_exists($attribute, $this->attributes);
}
|
Run infection:
src/Tag/AttributesAwareTrait.php#L36
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
{
return $this->attributes;
}
- public function withAttribute(string $attribute, \Stringable|string|int|float $val = null) : static
+ protected function withAttribute(string $attribute, \Stringable|string|int|float $val = null) : static
{
$obj = clone $this;
$obj->attributes[$attribute] = null === $val ? null : (string) $val;
|
Run infection:
src/Tag/AttributesAwareTrait.php#L39
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
public function withAttribute(string $attribute, \Stringable|string|int|float $val = null) : static
{
$obj = clone $this;
- $obj->attributes[$attribute] = null === $val ? null : (string) $val;
+ $obj->attributes[$attribute] = null === $val ? null : $val;
return $obj;
}
}
|
Run infection:
src/Tag/ElementTag.php#L25
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
{
return new static($element, $content, true);
}
- public static function createWithoutContent(string $element, bool $hasClosingElement = true) : static
+ public static function createWithoutContent(string $element, bool $hasClosingElement = false) : static
{
return new static($element, '', $hasClosingElement);
}
|
Run infection:
src/Tag/ElementTag.php#L45
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
{
return $this->closingElement;
}
- public function withClosingElement(bool $closingElement) : static
+ protected function withClosingElement(bool $closingElement) : static
{
return $this->with('closingElement', $closingElement);
}
|
Loading