Skip to content

Add @throws annotations #7

Add @throws annotations

Add @throws annotations #7

Triggered via push June 6, 2024 10:23
Status Failure
Total duration 1m 24s
Artifacts

build.yaml

on: push
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

13 errors and 7 warnings
InvalidFalsableReturnType: src/DataTransferObject/AbstractDataTransferObject.php#L41
src/DataTransferObject/AbstractDataTransferObject.php:41:87: 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#L50
src/DataTransferObject/AbstractDataTransferObject.php:50: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#L41
src/DataTransferObject/AbstractDataTransferObject.php:41:87: 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#L50
src/DataTransferObject/AbstractDataTransferObject.php:50: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.3, 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.
InvalidFalsableReturnType: src/DataTransferObject/AbstractDataTransferObject.php#L41
src/DataTransferObject/AbstractDataTransferObject.php:41:87: 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#L50
src/DataTransferObject/AbstractDataTransferObject.php:50: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.2, lowest)
The operation was canceled.
Mutation tests (8.3, highest)
Process completed with exit code 1.
Mutation tests (8.3, highest): src/DataTransferObject/AbstractDataTransferObject.php#L43
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ */ protected static function convertDateTime(null|\DateTimeImmutable|string $value) : ?\DateTimeImmutable { - if (null === $value || $value instanceof \DateTimeImmutable) { + if (null === $value || false) { return $value; } $value = \DateTimeImmutable::createFromFormat(\DATE_ATOM, $value);
Mutation tests (8.3, highest): src/DataTransferObject/AbstractDataTransferObject.php#L48
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ return $value; } $value = \DateTimeImmutable::createFromFormat(\DATE_ATOM, $value); - Assert::notFalse($value); + return $value; } /**
Mutation tests (8.3, highest): src/DataTransferObject/AbstractDataTransferObject.php#L69
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); } }