Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"BoldApps\\Common\\Test\\Services\\Shopify\\CartTest::testClearCartWillClearAttributes":6,"BoldApps\\Common\\Test\\Services\\Shopify\\CartTest::testClearCartWithPassword":6,"Tests\\Services\\CustomerSavedSearchTest::testGetCallsCorrectEndpointAndReturnsUnserializedModel":6},"times":{"CollectTest::shopifyCollectSerializesProperly":0.012,"CollectTest::shopifyCollectDeserializesProperly":0.002,"CountryTest::shopifyCountrySerializesProperly":0.003,"CountryTest::shopifyCountryDeserializesProperly":0.003,"CustomerSavedSearchTest::shopifyCustomerSavedSearchSerializesProperly":0.001,"CustomerSavedSearchTest::shopifyCustomerSavedSearchDeserializesProperly":0.001,"CustomerTest::shopifyCustomerSerializesProperly":0.006,"CustomerTest::shopifyCustomerDeserializesProperly":0.005,"DiscountCodeTest::shopifyDiscountCodeSerializesProperly":0.001,"DiscountCodeTest::shopifyDiscountCodeDeserializesProperly":0.001,"FulfillmentTest::shopifyFulfillmentSerializesProperly":0.007,"FulfillmentTest::shopifyFulfillmentDeserializesProperly":0.007,"ImageTest::shopifyImageSerializesProperly":0.002,"ImageTest::shopifyImageDeserializesProperly":0.001,"InventoryItemTest::shopifyInventoryItemSerializesProperly":0.001,"InventoryItemTest::shopifyInventoryItemDeserializesProperly":0.001,"InventoryLevelTest::shopifyInventoryLevelSerializesProperly":0.001,"InventoryLevelTest::shopifyInventoryLevelDeserializesProperly":0.001,"LocationTest::shopifyLocationSerializesProperly":0.002,"LocationTest::shopifyLocationDeserializesProperly":0.002,"PriceRuleTest::shopifyPriceRuleSerializesProperly":0.003,"PriceRuleTest::shopifyPriceRuleDeserializesProperly":0.003,"PriceRuleTest::shopifyPriceRuleDeserializesProperlyWithCustomerSegments":0.003,"ProductTest::shopifyProductSerializesProperly":0.017,"ProductTest::shopifyProductDeserializesProperly":0.015,"RecurringApplicationChargeTest::shopifyRecurringApplicationChargeSerializesProperly":0.002,"RecurringApplicationChargeTest::shopifyRecurringApplicationChargeDeserializesProperly":0.002,"RefundTest::shopifyRefundSerializesProperly":0.004,"RefundTest::shopifyRefundDeserializesProperly":0.005,"BoldApps\\Common\\Test\\Services\\Shopify\\CartTest::testClearCartWillClearAttributes":0.016,"BoldApps\\Common\\Test\\Services\\Shopify\\CartTest::testClearCartWithPassword":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrottleWhenUsingARateLimiterWhenConfigured":0.016,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #0":0.003,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #1":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #2":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #3":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #4":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #5":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #6":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #7":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #8":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #9":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #10":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #11":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #12":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #13":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #14":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #15":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #16":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #17":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #18":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillThrowExceptions with data set #19":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #0":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #1":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #2":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #3":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #4":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #5":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #6":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #7":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testGetRedirectLocation with data set #8":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillApplyPostHeadersProperly":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientWillApplyPollingInfoHeaders":0.003,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testPostWithPasswordSendsPasswordAuthenticationRequest":0.003,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientParsePageInfo with data set \"previous_and_next\"":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientParsePageInfo with data set \"no_previous\"":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientParsePageInfo with data set \"no_next\"":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientParseHeader with data set \"previous_and_next\"":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientParseHeader with data set \"no_previous\"":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ClientTest::testClientParseHeader with data set \"no_next\"":0.001,"Tests\\Services\\CustomerSavedSearchTest::testGetCallsCorrectEndpointAndReturnsUnserializedModel":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\InstallAndLoginTest::testAuthorizeUrlNoRedirect":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\InstallAndLoginTest::testAuthorizeUrlWithRedirect":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\InstallAndLoginTest::testGetAccessTokenSuccess":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\InstallAndLoginTest::testGetAccessTokenBadToken":0.002,"BoldApps\\Common\\Test\\Services\\Shopify\\InstallAndLoginTest::testValidateSignature":0.001,"BoldApps\\ShopifyToolkit\\Test\\Services\\OrderTest::testSerializeCancelOrder":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ShopifyBaseServiceTest::unserializeModel":0.001,"BoldApps\\Common\\Test\\Services\\Shopify\\ShopifyBaseServiceTest::serializeModel":0,"BoldApps\\Common\\Test\\Services\\Shopify\\ShopifyBaseServiceTest::unserializeSerializedModel":0,"BoldApps\\Common\\Test\\Services\\Shopify\\ShopifyBaseServiceTest::unserializeSerializedModelWithExtraField":0,"BoldApps\\Common\\Test\\Services\\Shopify\\ShopifyBaseServiceTest::unserializeSerializedModelThatIsNull":0,"BoldApps\\Common\\Test\\Services\\Shopify\\ShopifyBaseServiceTest::unserializeModelThrowsExceptionOnInvalidData":0,"SmartCollectionTest::shopifySmartCollectionSerializesProperly":0.003,"SmartCollectionTest::shopifySmartCollectionDeserializesProperly":0.002,"HasAttributesTraitTest::testHasAttribute":0.001,"HasAttributesTraitTest::testHasAttributeFails":0,"HasAttributesTraitTest::testHasMutator":0,"HasAttributesTraitTest::testHasMutatorFails":0,"HasAttributesTraitTest::testIsset":0,"HasAttributesTraitTest::testIssetFails":0,"HasAttributesTraitTest::testToArray":0,"HasAttributesTraitTest::testJsonSerialize":0.001,"UserTest::shopifyRefundSerializesProperly":0.002,"UserTest::shopifyUserDeserializesProperly":0.002,"VariantTest::shopifyVariantSerializesProperly":0.002,"VariantTest::shopifyVariantDeserializesProperly":0.002,"VariantTest::shopifyVariantWithoutInventorySerializesProperly":0.002}}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"require": {
"guzzlehttp/guzzle": "^6.2 || ^7.1",
"illuminate/support": "5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10 || ^11",
"illuminate/support": "5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || ^13",
"ext-json": "*"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(ShopifyClient $client, ShopifyThemeService $theme)
*
* @param int $themeId (optional)
*/
public function loadTheme($themeId = null)
public function loadTheme(?int $themeId = null)
{
if (null === $themeId) {
$this->currentTheme = $this->shopifyTheme->getMain();
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(ShopifyClient $client)
/**
* @return array
*/
public function serializeModel(Serializeable $entity = null)
public function serializeModel(?Serializeable $entity = null)
{
if (null === $entity) {
return null;
Expand Down
8 changes: 4 additions & 4 deletions src/Services/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Cart extends Base
/**
* @return CartModel
*/
public function get($cartToken, $password = null)
public function get($cartToken, ?string $password = null)
{
$raw = $this->client->get('cart.json', [], $this->getCartCookie($cartToken), $password, true);

Expand All @@ -39,7 +39,7 @@ public function get($cartToken, $password = null)
*
* @return CartModel|object
*/
public function clear($cartToken, $password = null)
public function clear($cartToken, ?string $password = null)
{
$cookies = $this->getCartCookie($cartToken);

Expand Down Expand Up @@ -87,7 +87,7 @@ public function clear($cartToken, $password = null)
*
* @return object
*/
public function update(CartModel $cart, $cartToken, $password = null)
public function update(CartModel $cart, $cartToken, ?string $password = null)
{
$raw = $this->client->post('cart/update.json', [], $this->serializeModel($cart), $this->getCartCookie($cartToken), $password, true);

Expand All @@ -97,7 +97,7 @@ public function update(CartModel $cart, $cartToken, $password = null)
/**
* @param null $password
*/
public function switchCartCurrency($cartToken, $currency, $password = null)
public function switchCartCurrency($cartToken, $currency, ?string $password = null)
{
$this->client->get('cart', ['currency' => $currency], $this->getCartCookie($cartToken), $password, true);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Services/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct(ShopBaseInfo $shopBaseInfo, ShopAccessInfo $shopAcce
*
* @return array
*/
public function get($path, $params = [], array $cookies = [], $password = null, $frontendApi = false)
public function get($path, $params = [], array $cookies = [], ?string $password = null, $frontendApi = false)
{
$headers = ['X-Shopify-Access-Token' => $this->shopAccessInfo->getToken()];

Expand Down Expand Up @@ -111,7 +111,7 @@ public function getRedirectLocation($path, $params = [])
*
* @return array
*/
public function post($path, $params, $body, array $cookies = [], $password = null, $frontendApi = false, $extraHeaders = [])
public function post($path, $params, $body, array $cookies = [], ?string $password = null, $frontendApi = false, $extraHeaders = [])
{
$headers = ['X-Shopify-Access-Token' => $this->shopAccessInfo->getToken(), 'Content-Type' => 'application/json', 'charset' => 'utf-8'];
$headers = array_merge($headers, $extraHeaders);
Expand Down Expand Up @@ -178,7 +178,7 @@ public function delete($path, $params = [])
* @throws BadRequestException
* @throws SeverErrorException
*/
private function sendRequestToShopify(Request $request, array $cookies = [], $password = null)
private function sendRequestToShopify(Request $request, array $cookies = [], ?string $password = null)
{
$result = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Services/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function createTest($order)
*
* @return ShopifyOrder|object
*/
public function cancel($id, $cancelOrder = null)
public function cancel($id, ?CancelOrder $cancelOrder = null)
{
$serializedModel = $this->serializeModel($cancelOrder);
$raw = $this->client->post("{$this->getApiBasePath()}/orders/{$id}/cancel.json", [], $serializedModel);
Expand Down