Skip to content

Commit

Permalink
style: fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Oct 4, 2024
1 parent f919ad8 commit 70512c2
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 43 deletions.
7 changes: 6 additions & 1 deletion src/App/Cart/Service/CartCalculationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,14 @@ protected function hasDeliveryOptions(PdkCart $cart): bool
return $anyItemIsDeliverable && ! $deliveryOptionsDisabled;
}

/**
* @param null|string $cc
*
* @return bool
*/
private function allowMailboxToCountry(?string $cc): bool
{
if ($cc === null) {
if (null === $cc) {
return false;
}

Expand Down
5 changes: 1 addition & 4 deletions tests/Bootstrap/MockPdkAuditRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ public function retrieve(string $key, ?callable $callback = null, bool $force =
*
* @return void
*/
public function save(string $key, $data): void
{
return;
}
public function save(string $key, $data): void { }

/**
* @param \MyParcelNL\Pdk\Audit\Model\Audit $audit
Expand Down
3 changes: 0 additions & 3 deletions tests/Integration/Context/Concern/ValidatesValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ protected function getMatchers(): array
*/
protected function validateByCurrentFirstOrLast(string $value, array $body, string $key): void
{
$type = Str::before($value, '_');
$entity = Str::after($value, "{$type}_");

$actualValue = Arr::get($body, $key);

$this->validateByType($value, $key, $actualValue);
Expand Down
2 changes: 0 additions & 2 deletions tests/Mocks/MockTraitModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
class MockTraitModel extends Model
{
use MockHasCatsTrait;

protected $attributes = [];
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
->and($response->getStatusCode())
->toBe(204);

if ($result === null) {
if (null === $result) {
expect($updates)->toBeEmpty();
} else {
expect($updates)->toBe([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
$service = Pdk::get(PdkOrderOptionsServiceInterface::class);
$newOrder = $service->calculate($order);

if ($expectation === null) {
if (null === $expectation) {
expect($newOrder->customsDeclaration)->toBeNull();
} else {
expect($newOrder->customsDeclaration->toArrayWithoutNull())->toEqual($expectation);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/App/Webhook/Hook/ShopWebhookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
'level' => 'debug',
'message' => '[PDK]: Webhook processed',
'context' => ['hook' => $expectedClass],
], $logs->toArray())
], $logs->toArray(), true)
)
->toBeTrue();
})->with([
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Audit/Collection/AuditCollectionTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
/** @noinspection StaticClosureCanBeUsedInspection */

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Audit/Service/AuditServiceTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
/** @noinspection StaticClosureCanBeUsedInspection */

declare(strict_types=1);

Expand Down

This file was deleted.

0 comments on commit 70512c2

Please sign in to comment.