Parse field value by provided type #12
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
10 warnings
PHP 8.2:
src/Builder/ContactBuilder.php#L33
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
private ?DateTimeImmutable $dateModified = null;
public function __construct()
{
- $this->reset();
+
}
public function reset() : self
{
|
PHP 8.2:
src/Builder/ContactBuilder.php#L36
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
{
$this->reset();
}
- public function reset() : self
+ protected function reset() : self
{
$this->id = null;
$this->owner = null;
|
PHP 8.2:
src/Builder/ContactBuilder.php#L40
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
{
$this->id = null;
$this->owner = null;
- $this->isPublished = true;
+ $this->isPublished = false;
$this->points = 0;
$this->dateAdded = null;
$this->dateIdentified = null;
|
PHP 8.2:
src/Builder/ContactBuilder.php#L41
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
$this->id = null;
$this->owner = null;
$this->isPublished = true;
- $this->points = 0;
+ $this->points = -1;
$this->dateAdded = null;
$this->dateIdentified = null;
$this->dateModified = null;
|
PHP 8.2:
src/Builder/ContactBuilder.php#L94
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function build() : Contact
{
$result = new Contact(dateAdded: $this->dateAdded ?? throw new InvalidArgumentException('Missing dateAdded'), dateIdentified: $this->dateIdentified ?? throw new InvalidArgumentException('Missing dateIdentified'), dateModified: $this->dateModified, id: $this->id ?? throw new InvalidArgumentException('Missing id'), isPublished: $this->isPublished, owner: $this->owner, points: $this->points);
- $this->reset();
+
return $result;
}
}
|
PHP 8.2:
src/Builder/UserBuilder.php#L25
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
private ?string $username = null;
public function __construct()
{
- $this->reset();
+
}
public function reset() : self
{
|
PHP 8.2:
src/Builder/UserBuilder.php#L28
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
{
$this->reset();
}
- public function reset() : self
+ protected function reset() : self
{
$this->id = null;
$this->firstName = null;
|
PHP 8.2:
src/Builder/UserBuilder.php#L64
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function build() : User
{
$user = new User(id: $this->id ?? throw new InvalidArgumentException('Missing id'), firstName: $this->firstName, lastName: $this->lastName, username: $this->username ?? throw new InvalidArgumentException('Missing username'));
- $this->reset();
+
return $user;
}
}
|
PHP 8.2:
src/ContactParser.php#L25
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
private UserDirector $userDirector;
public function __construct(?UserDirector $userDirector = null)
{
- $this->userDirector = $userDirector ?? new UserDirector();
+ $this->userDirector = new UserDirector() ?? $userDirector;
}
/**
* @param array<string, mixed> $payload
|
PHP 8.2:
src/ContactParser.php#L36
Escaped Mutant for Mutator "IfNegation":
--- Original
+++ New
@@ @@
public function parse(array $payload) : Contact
{
$owner = null;
- if (is_array($payload["owner"])) {
+ if (!is_array($payload["owner"])) {
/** @var array<string, mixed> $ownerData */
$ownerData = $payload["owner"];
$owner = $this->userDirector->constructFromJson($ownerData);
|