Added test for sales order #4
build.yaml
on: push
Matrix: Code Coverage
Matrix: Coding Standards
Matrix: Dependency Analysis
Matrix: Mutation tests
Matrix: Static Code Analysis
Matrix: Unit tests
Annotations
10 errors and 8 warnings
InvalidFalsableReturnType:
src/DataTransferObject/AbstractDataTransferObject.php#L38
src/DataTransferObject/AbstractDataTransferObject.php:38:90: InvalidFalsableReturnType: The declared return type 'DateTimeImmutable|null' for Setono\PeakWMS\DataTransferObject\AbstractDataTransferObject::convertDateTime does not allow false, but 'DateTimeImmutable|false|null' contains false (see https://psalm.dev/143)
|
FalsableReturnStatement:
src/DataTransferObject/AbstractDataTransferObject.php#L47
src/DataTransferObject/AbstractDataTransferObject.php:47:16: FalsableReturnStatement: The declared return type 'DateTimeImmutable|null' for Setono\PeakWMS\DataTransferObject\AbstractDataTransferObject::convertDateTime does not allow false, but the function returns 'DateTimeImmutable|false' (see https://psalm.dev/137)
|
Static Code Analysis (8.1, lowest)
Process completed with exit code 2.
|
Static Code Analysis (8.3, lowest)
The job was canceled because "_8_1_lowest" failed.
|
InvalidFalsableReturnType:
src/DataTransferObject/AbstractDataTransferObject.php#L38
src/DataTransferObject/AbstractDataTransferObject.php:38:90: InvalidFalsableReturnType: The declared return type 'DateTimeImmutable|null' for Setono\PeakWMS\DataTransferObject\AbstractDataTransferObject::convertDateTime does not allow false, but 'DateTimeImmutable|false|null' contains false (see https://psalm.dev/143)
|
FalsableReturnStatement:
src/DataTransferObject/AbstractDataTransferObject.php#L47
src/DataTransferObject/AbstractDataTransferObject.php:47:16: FalsableReturnStatement: The declared return type 'DateTimeImmutable|null' for Setono\PeakWMS\DataTransferObject\AbstractDataTransferObject::convertDateTime does not allow false, but the function returns 'DateTimeImmutable|false' (see https://psalm.dev/137)
|
Static Code Analysis (8.3, lowest)
Process completed with exit code 2.
|
Static Code Analysis (8.1, highest)
The job was canceled because "_8_1_lowest" failed.
|
Static Code Analysis (8.2, lowest)
The job was canceled because "_8_1_lowest" failed.
|
Mutation tests (8.3, highest)
Process completed with exit code 1.
|
Mutation tests (8.3, highest):
src/DataTransferObject/AbstractDataTransferObject.php#L40
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
}
protected static function convertDateTime(null|\DateTimeImmutable|string $dateTime) : ?\DateTimeImmutable
{
- if (null === $dateTime || $dateTime instanceof \DateTimeImmutable) {
+ if (null === $dateTime || false) {
return $dateTime;
}
$dateTime = \DateTimeImmutable::createFromFormat(\DATE_ATOM, $dateTime);
|
Mutation tests (8.3, highest):
src/DataTransferObject/AbstractDataTransferObject.php#L45
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
return $dateTime;
}
$dateTime = \DateTimeImmutable::createFromFormat(\DATE_ATOM, $dateTime);
- Assert::notFalse($dateTime);
+
return $dateTime;
}
/**
|
Mutation tests (8.3, highest):
src/DataTransferObject/AbstractDataTransferObject.php#L64
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
if (null === $value) {
return null;
}
- if ($value instanceof \BackedEnum) {
+ if (false) {
Assert::isInstanceOf($value, $enumClass);
return $value;
}
|
Mutation tests (8.3, highest):
src/DataTransferObject/SalesOrder/SalesOrder.php#L78
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
* Otherwise, PeakWMS will not be able to find and capture the order in the payment integration.
*/
public ?string $transactionNumber = null,
- public bool $giftWrap = false,
+ public bool $giftWrap = true,
public ?string $customerReference = null,
int|PaymentStatus $paymentStatus = null,
int|PickAgainReason $pickAgainReason = null,
|
Mutation tests (8.3, highest):
src/DataTransferObject/SalesOrder/SalesOrder.php#L86
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
public ?Address $shippingAddress = null,
public ?Address $senderAddress = null,
public ?string $sendWithOrder = null,
- public bool $generateAndPrintDeliveryNote = false,
+ public bool $generateAndPrintDeliveryNote = true,
array $orderLines = []
)
{
|
Mutation tests (8.3, highest):
src/DataTransferObject/SalesOrder/SalesOrder.php#L90
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
)
{
$this->orderId = (string) $orderId;
- $this->orderNumber = (string) $orderNumber;
+ $this->orderNumber = $orderNumber;
$this->orderDateTime = self::convertDateTime($orderDateTime);
$this->requestedDeliveryDate = self::convertDateTime($requestedDeliveryDate);
$this->state = self::convertEnum($state, State::class);
|
Mutation tests (8.3, highest):
src/DataTransferObject/SalesOrder/SalesOrder.php#L98
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
$this->onHoldReason = self::convertEnum($onHoldReason, OnHoldReason::class);
$this->paymentStatus = self::convertEnum($paymentStatus, PaymentStatus::class);
$this->pickAgainReason = self::convertEnum($pickAgainReason, PickAgainReason::class);
- foreach ($orderLines as $orderLine) {
+ foreach (array() as $orderLine) {
$this->addOrderLine($orderLine);
}
}
|
Code Coverage (8.3, highest)
Codecov: Failed to properly create commit: The process '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov' failed with exit code 1
|