-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): upgrade myparcelnl/pdk to v2.24.2
Compare changes: - myparcelnl/pdk@v2.23.0...v2.24.2
- Loading branch information
1 parent
bf5b2aa
commit 3a2cb60
Showing
6 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace MyParcelNL\PrestaShop\Migration\Util; | ||
|
||
final class ToDeliveryTypeName extends TransformValue | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct([$this, 'convert']); | ||
} | ||
|
||
/** | ||
* @param mixed $value | ||
* | ||
* @return string | ||
*/ | ||
protected function convert($value): string | ||
{ | ||
if (is_numeric($value)) { | ||
if (in_array((int) $value, DeliveryOptions::DELIVERY_TYPES_IDS, true)) { | ||
return array_flip(DeliveryOptions::DELIVERY_TYPES_NAMES_IDS_MAP)[$value]; | ||
} | ||
|
||
return DeliveryOptions::DEFAULT_DELIVERY_TYPE_NAME; | ||
} | ||
|
||
return in_array($value, DeliveryOptions::DELIVERY_TYPES_NAMES, true) | ||
? $value | ||
: DeliveryOptions::DEFAULT_DELIVERY_TYPE_NAME; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace MyParcelNL\PrestaShop\Migration\Util; | ||
|
||
final class ToPackageTypeName extends TransformValue | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(static function ($value) { | ||
if (is_numeric($value)) { | ||
if (in_array((int) $value, DeliveryOptions::PACKAGE_TYPES_IDS, true)) { | ||
return array_flip(DeliveryOptions::PACKAGE_TYPES_NAMES_IDS_MAP)[$value]; | ||
} | ||
|
||
return DeliveryOptions::DEFAULT_PACKAGE_TYPE_NAME; | ||
} | ||
|
||
return in_array($value, DeliveryOptions::PACKAGE_TYPES_NAMES, true) | ||
? $value | ||
: DeliveryOptions::DEFAULT_PACKAGE_TYPE_NAME; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace MyParcelNL\PrestaShop\Migration\Util; | ||
|
||
final class ToTriStateValue extends TransformValue | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct([$this, 'convert']); | ||
} | ||
|
||
/** | ||
* @param mixed $value | ||
* | ||
* @return mixed | ||
*/ | ||
protected function convert($value) | ||
{ | ||
$triStateService = Pdk::get(TriStateServiceInterface::class); | ||
|
||
return $triStateService->cast($value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use MyParcelNL\PrestaShop\Tests\Factory\AbstractPsObjectModelFactory; | ||
|
||
/** | ||
*/ | ||
final class LangFactory extends AbstractPsObjectModelFactory | ||
{ | ||
protected function getObjectModelClass(): string | ||
{ | ||
return Lang::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// GENERATED BY vite-plugin-custom-tsconfig | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"include": ["./src/**/*", "!./src/__test__/**"] | ||
} |