feat: Add support for mapping Laravel Request params to Bag properties #81
tests.yaml
on: pull_request
Mutation Testing
2m 39s
Matrix: Tests
Annotations
10 warnings
Mutation Testing:
src/Bag/Attributes/Cast.php#L28
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
{
/** @var CastsPropertySet $cast */
$cast = new $this->casterClassname(...$this->parameters);
- if ($cast instanceof CastsPropertySet) {
+ if (true) {
return $cast->set($propertyType, $propertyName, $properties);
}
return (new MagicCast())->set($propertyName, $propertyName, $properties);
|
Mutation Testing:
src/Bag/Attributes/Cast.php#L40
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
{
/** @var CastsPropertyGet $cast */
$cast = new $this->casterClassname(...$this->parameters);
- if ($cast instanceof CastsPropertyGet) {
+ if (true) {
return $cast->get($propertyName, $properties);
}
return $properties->get($propertyName);
}
}
|
Mutation Testing:
src/Bag/Attributes/Validation/Email.php#L13
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class Email extends Rule
{
- public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
+ public function __construct(bool $rfc = false, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
{
$validators = [];
if ($rfc) {
|
Mutation Testing:
src/Bag/Attributes/Validation/Email.php#L14
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class Email extends Rule
{
- public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
+ public function __construct(bool $rfc = true, bool $strict = true, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
{
$validators = [];
if ($rfc) {
|
Mutation Testing:
src/Bag/Attributes/Validation/Email.php#L15
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class Email extends Rule
{
- public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
+ public function __construct(bool $rfc = true, bool $strict = false, bool $dns = true, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
{
$validators = [];
if ($rfc) {
|
Mutation Testing:
src/Bag/Attributes/Validation/Email.php#L16
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class Email extends Rule
{
- public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
+ public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = true, bool $filter = false, bool $filterUnicode = false)
{
$validators = [];
if ($rfc) {
|
Mutation Testing:
src/Bag/Attributes/Validation/Email.php#L17
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class Email extends Rule
{
- public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
+ public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = true, bool $filterUnicode = false)
{
$validators = [];
if ($rfc) {
|
Mutation Testing:
src/Bag/Attributes/Validation/Email.php#L18
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class Email extends Rule
{
- public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = false)
+ public function __construct(bool $rfc = true, bool $strict = false, bool $dns = false, bool $spoof = false, bool $filter = false, bool $filterUnicode = true)
{
$validators = [];
if ($rfc) {
|
Mutation Testing:
src/Bag/Bag.php#L40
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
}
public function with(mixed ...$values): Bag
{
- if (count($values) === 1 && isset($values[0])) {
+ if (count($values) === 1 || isset($values[0])) {
$values = $values[0];
}
$values = \array_merge($this->getRaw()->toArray(), $values);
|
Mutation Testing:
src/Bag/Casts/DateTime.php#L18
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
/**
* @param class-string<DateTimeInterface>|null $dateTimeClass
*/
- public function __construct(protected string $format = 'Y-m-d H:i:s', protected ?string $outputFormat = null, protected ?string $dateTimeClass = null, protected bool $strictMode = false)
+ public function __construct(protected string $format = 'Y-m-d H:i:s', protected ?string $outputFormat = null, protected ?string $dateTimeClass = null, protected bool $strictMode = true)
{
if ($this->outputFormat === null) {
$this->outputFormat = $this->format;
|