Enhancement: Synchronize with ergebnis/php-package-template
#2078
Annotations
10 warnings
src/ChainNormalizer.php#L31
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
private readonly array $normalizers;
public function __construct(Normalizer ...$normalizers)
{
- $this->normalizers = \array_values($normalizers);
+ $this->normalizers = $normalizers;
}
public function normalize(Json $json) : Json
{
|
src/Exception/InvalidIndentStyle.php#L43
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
{
$exception = new self(\sprintf('Style needs to be one of "%s", but "%s" is not.', \implode('", "', $allowedStyles), $style));
$exception->style = $style;
- $exception->allowedStyles = \array_values($allowedStyles);
+ $exception->allowedStyles = $allowedStyles;
return $exception;
}
public function style() : string
|
src/Exception/NormalizedInvalidAccordingToSchema.php#L39
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
{
$exception = new self(\sprintf('Normalized JSON is not valid according to schema "%s".', $schemaUri));
$exception->schemaUri = $schemaUri;
- $exception->errors = \array_values($errors);
+ $exception->errors = $errors;
return $exception;
}
public function schemaUri() : string
|
src/Exception/OriginalInvalidAccordingToSchema.php#L39
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
{
$exception = new self(\sprintf('Original JSON is not valid according to schema "%s".', $schemaUri));
$exception->schemaUri = $schemaUri;
- $exception->errors = \array_values($errors);
+ $exception->errors = $errors;
return $exception;
}
public function schemaUri() : string
|
src/Format/Indent.php#L65
Escaped Mutant for Mutator "UnwrapArrayKeys":
--- Original
+++ New
@@ @@
throw Exception\InvalidIndentSize::fromSizeAndMinimumSize($size, $minimumSize);
}
if (!\array_key_exists($style, self::CHARACTERS)) {
- throw Exception\InvalidIndentStyle::fromStyleAndAllowedStyles($style, ...\array_keys(self::CHARACTERS));
+ throw Exception\InvalidIndentStyle::fromStyleAndAllowedStyles($style, ...self::CHARACTERS);
}
$value = \str_repeat(self::CHARACTERS[$style], $size);
return new self($value);
|
src/Format/JsonEncodeOptions.php#L50
Escaped Mutant for Mutator "Assignment":
--- Original
+++ New
@@ @@
{
$jsonEncodeOptions = 0;
if (!\str_contains($json->encoded(), '\\/')) {
- $jsonEncodeOptions |= \JSON_UNESCAPED_SLASHES;
+ $jsonEncodeOptions = \JSON_UNESCAPED_SLASHES;
}
if (1 !== \preg_match('/(\\\\+)u([0-9a-f]{4})/i', $json->encoded())) {
$jsonEncodeOptions |= \JSON_UNESCAPED_UNICODE;
|
src/Format/JsonEncodeOptions.php#L53
Escaped Mutant for Mutator "PregMatchRemoveFlags":
--- Original
+++ New
@@ @@
if (!\str_contains($json->encoded(), '\\/')) {
$jsonEncodeOptions |= \JSON_UNESCAPED_SLASHES;
}
- if (1 !== \preg_match('/(\\\\+)u([0-9a-f]{4})/i', $json->encoded())) {
+ if (1 !== \preg_match('/(\\\\+)u([0-9a-f]{4})/', $json->encoded())) {
$jsonEncodeOptions |= \JSON_UNESCAPED_UNICODE;
}
return self::fromInt($jsonEncodeOptions);
|
src/Format/NewLine.php#L33
Escaped Mutant for Mutator "PregMatchRemoveCaret":
--- Original
+++ New
@@ @@
*/
public static function fromString(string $value) : self
{
- if (1 !== \preg_match('/^(?>\\r\\n|\\n|\\r)$/', $value)) {
+ if (1 !== \preg_match('/(?>\\r\\n|\\n|\\r)$/', $value)) {
throw Exception\InvalidNewLineString::fromString($value);
}
return new self($value);
|
src/Format/NewLine.php#L33
Escaped Mutant for Mutator "PregMatchRemoveDollar":
--- Original
+++ New
@@ @@
*/
public static function fromString(string $value) : self
{
- if (1 !== \preg_match('/^(?>\\r\\n|\\n|\\r)$/', $value)) {
+ if (1 !== \preg_match('/^(?>\\r\\n|\\n|\\r)/', $value)) {
throw Exception\InvalidNewLineString::fromString($value);
}
return new self($value);
|
src/SchemaNormalizer.php#L198
Escaped Mutant for Mutator "UnwrapArrayIntersectKey":
--- Original
+++ New
@@ @@
*/
if ($dataShouldBeSorted && \property_exists($schema, 'properties') && \is_object($schema->properties)) {
/** @var array<string, object> $objectPropertiesThatAreDefinedBySchema */
- $objectPropertiesThatAreDefinedBySchema = \array_intersect_key(\get_object_vars($schema->properties), \get_object_vars($data));
+ $objectPropertiesThatAreDefinedBySchema = \get_object_vars($schema->properties);
foreach ($objectPropertiesThatAreDefinedBySchema as $name => $valueSchema) {
$value = $data->{$name};
$valueSchema = $this->resolveSchema($value, $valueSchema);
|
The logs for this run have expired and are no longer available.
Loading