Skip to content

Introduce serializer and introduce json serialization instead of php serialization #199

Introduce serializer and introduce json serialization instead of php serialization

Introduce serializer and introduce json serialization instead of php serialization #199

Triggered via pull request May 14, 2024 12:55
Status Failure
Total duration 7m 59s
Artifacts

build.yaml

on: pull_request
Matrix: Code Coverage
Matrix: Coding Standards
Matrix: Dependency Analysis
Matrix: Mutation tests
Matrix: Static Code Analysis
Matrix: Unit tests
Fit to window
Zoom out
Zoom in

Annotations

18 errors and 10 warnings
MixedArgument: src/Tag/RenderedTag.php#L40
src/Tag/RenderedTag.php:40:13: MixedArgument: Argument 1 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting string (see https://psalm.dev/030)
MixedArgument: src/Tag/RenderedTag.php#L41
src/Tag/RenderedTag.php:41:13: MixedArgument: Argument 2 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting string (see https://psalm.dev/030)
MixedArgument: src/Tag/RenderedTag.php#L42
src/Tag/RenderedTag.php:42:13: MixedArgument: Argument 3 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting int (see https://psalm.dev/030)
MixedArgument: src/Tag/RenderedTag.php#L43
src/Tag/RenderedTag.php:43:13: MixedArgument: Argument 4 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting bool (see https://psalm.dev/030)
MixedArgument: src/Tag/RenderedTag.php#L44
src/Tag/RenderedTag.php:44:13: MixedArgument: Argument 5 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting string (see https://psalm.dev/030)
Static Code Analysis (8.1, highest)
Process completed with exit code 2.
Static Code Analysis (8.2, highest)
The job was canceled because "_8_1_highest" failed.
MixedArgument: src/Tag/RenderedTag.php#L40
src/Tag/RenderedTag.php:40:13: MixedArgument: Argument 1 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting string (see https://psalm.dev/030)
MixedArgument: src/Tag/RenderedTag.php#L41
src/Tag/RenderedTag.php:41:13: MixedArgument: Argument 2 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting string (see https://psalm.dev/030)
MixedArgument: src/Tag/RenderedTag.php#L42
src/Tag/RenderedTag.php:42:13: MixedArgument: Argument 3 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting int (see https://psalm.dev/030)
MixedArgument: src/Tag/RenderedTag.php#L43
src/Tag/RenderedTag.php:43:13: MixedArgument: Argument 4 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting bool (see https://psalm.dev/030)
MixedArgument: src/Tag/RenderedTag.php#L44
src/Tag/RenderedTag.php:44:13: MixedArgument: Argument 5 of Setono\TagBag\Tag\RenderedTag::__construct cannot be mixed, expecting string (see https://psalm.dev/030)
Static Code Analysis (8.2, highest)
Process completed with exit code 2.
Static Code Analysis (8.1, lowest)
The job was canceled because "_8_1_highest" failed.
Static Code Analysis (8.1, lowest)
The operation was canceled.
Static Code Analysis (8.3, lowest)
The job was canceled because "_8_1_highest" failed.
Static Code Analysis (8.2, lowest)
The job was canceled because "_8_1_highest" failed.
Static Code Analysis (8.3, highest)
The job was canceled because "_8_1_highest" failed.
Mutation tests (8.3, highest): 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
Mutation tests (8.3, highest): 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) {
Mutation tests (8.3, highest): 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); } }
Mutation tests (8.3, highest): 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(); } }
Mutation tests (8.3, highest): 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()); }
Mutation tests (8.3, highest): src/Serializer/CompositeSerializer.php#L21
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ $this->add($serializer); } } - public function add(SerializerInterface $serializer) : void + protected function add(SerializerInterface $serializer) : void { $this->serializers[] = $serializer; }
Mutation tests (8.3, highest): src/Serializer/JsonSerializer.php#L28
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ { try { /** @var mixed $data */ - $data = json_decode($data, true, 512, \JSON_THROW_ON_ERROR); + $data = json_decode($data, true, 511, \JSON_THROW_ON_ERROR); Assert::isArray($data); $tags = []; foreach ($data as $section => $sectionTags) {
Mutation tests (8.3, highest): src/Serializer/JsonSerializer.php#L28
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ { try { /** @var mixed $data */ - $data = json_decode($data, true, 512, \JSON_THROW_ON_ERROR); + $data = json_decode($data, true, 513, \JSON_THROW_ON_ERROR); Assert::isArray($data); $tags = []; foreach ($data as $section => $sectionTags) {
Mutation tests (8.3, highest): src/Serializer/JsonSerializer.php#L29
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ try { /** @var mixed $data */ $data = json_decode($data, true, 512, \JSON_THROW_ON_ERROR); - Assert::isArray($data); + $tags = []; foreach ($data as $section => $sectionTags) { Assert::string($section);
Mutation tests (8.3, highest): src/Serializer/JsonSerializer.php#L34
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ Assert::isArray($data); $tags = []; foreach ($data as $section => $sectionTags) { - Assert::string($section); + Assert::isArray($sectionTags); /** @var mixed $tag */ foreach ($sectionTags as $tag) {