Skip to content

Commit bcfb983

Browse files
authored
Added rector rule that automatically fixes broken default boolean values (#111)
1 parent 50ab6e8 commit bcfb983

File tree

7 files changed

+203
-106
lines changed

7 files changed

+203
-106
lines changed

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
->files()
55
->in([
66
__DIR__ . '/src',
7+
__DIR__ . '/tools/src',
78
]);
89

910
if (!\file_exists(__DIR__ . '/var')) {

composer.lock

Lines changed: 30 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
__DIR__ . '/src/AmazonPHP/SellingPartner/AccessToken.php',
4242
]);
4343

44+
$services->set(\AmazonPHP\Rector\ClassMethod\FixArgumentDefaultValuesNotMatchingTypeRector::class);
45+
4446
// Define what rule sets will be applied
4547
$containerConfigurator->import(SetList::DEAD_CODE);
4648
$containerConfigurator->import(SetList::PHP_73);

src/AmazonPHP/SellingPartner/Api/VendorOrdersApi/VendorDirectFulfillmentOrdersSDK.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function getOrderRequest(AccessToken $accessToken, string $region, string
254254
* @throws \AmazonPHP\SellingPartner\Exception\ApiException on non-2xx response
255255
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
256256
*/
257-
public function getOrders(AccessToken $accessToken, string $region, \DateTime $created_after, \DateTime $created_before, string $ship_from_party_id = null, string $status = null, int $limit = null, string $sort_order = null, string $next_token = null, bool $include_details = 'true') : \AmazonPHP\SellingPartner\Model\VendorDirectFulfillmentOrders\GetOrdersResponse
257+
public function getOrders(AccessToken $accessToken, string $region, \DateTime $created_after, \DateTime $created_before, string $ship_from_party_id = null, string $status = null, int $limit = null, string $sort_order = null, string $next_token = null, bool $include_details = true) : \AmazonPHP\SellingPartner\Model\VendorDirectFulfillmentOrders\GetOrdersResponse
258258
{
259259
$request = $this->getOrdersRequest($accessToken, $region, $created_after, $created_before, $ship_from_party_id, $status, $limit, $sort_order, $next_token, $include_details);
260260

@@ -356,7 +356,7 @@ public function getOrders(AccessToken $accessToken, string $region, \DateTime $c
356356
*
357357
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
358358
*/
359-
public function getOrdersRequest(AccessToken $accessToken, string $region, \DateTime $created_after, \DateTime $created_before, string $ship_from_party_id = null, string $status = null, int $limit = null, string $sort_order = null, string $next_token = null, bool $include_details = 'true') : RequestInterface
359+
public function getOrdersRequest(AccessToken $accessToken, string $region, \DateTime $created_after, \DateTime $created_before, string $ship_from_party_id = null, string $status = null, int $limit = null, string $sort_order = null, string $next_token = null, bool $include_details = true) : RequestInterface
360360
{
361361
// verify the required parameter 'created_after' is set
362362
if ($created_after === null || (\is_array($created_after) && \count($created_after) === 0)) {

tools/composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "amazon-php/sp-api-sdk-tools",
33
"description": "Amazon PHP SP API SDK - Tools",
4+
"autoload": {
5+
"psr-4": { "AmazonPHP\\Rector\\" : "src/AmazonPHP/Rector/" }
6+
},
47
"require-dev": {
58
"friendsofphp/php-cs-fixer": "^3.1",
69
"phpunit/phpunit": "^9.4",

0 commit comments

Comments
 (0)