Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Exception when no coordinates are given #66

Closed
wants to merge 28 commits into from
Closed
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
composer.lock
/logs/
/tests/tmp/*
*tmp*
*tmp*
.phpunit.result.cache
1 change: 1 addition & 0 deletions .php_cs.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"7.4.0","version":"2.16.1:v2.16.1#c8afb599858876e95e8ebfcd97812d383fa23f02","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":{"allow_single_line_closure":true},"class_definition":{"single_line":true},"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":true,"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":true,"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"binary_operator_spaces":true,"blank_line_after_opening_tag":true,"blank_line_before_statement":{"statements":["return"]},"cast_spaces":true,"class_attributes_separation":{"elements":["method"]},"concat_space":true,"declare_equal_normalize":true,"function_typehint_space":true,"include":true,"increment_style":true,"lowercase_cast":true,"lowercase_static_reference":true,"magic_constant_casing":true,"magic_method_casing":true,"native_function_casing":true,"native_function_type_declaration_casing":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["curly_brace_block","extra","parenthesis_brace_block","square_brace_block","throw","use"]},"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":true,"no_multiline_whitespace_around_double_arrow":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_superfluous_phpdoc_tags":{"allow_mixed":true,"allow_unused_params":true},"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_unneeded_control_parentheses":true,"no_unneeded_curly_braces":true,"no_unneeded_final_method":true,"no_unused_imports":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"ordered_imports":true,"php_unit_fqcn_annotation":true,"phpdoc_align":{"tags":["method","param","property","return","throws","type","var"]},"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":true,"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true,"phpdoc_separation":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_trim_consecutive_blank_line_separation":true,"phpdoc_types":true,"phpdoc_types_order":{"null_adjustment":"always_last","sort_algorithm":"none"},"phpdoc_var_without_name":true,"return_type_declaration":true,"semicolon_after_instruction":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_line_comment_style":{"comment_types":["hash"]},"single_line_throw":true,"single_quote":true,"single_trait_insert_per_statement":true,"space_after_semicolon":{"remove_in_empty_for_expressions":true},"standardize_increment":true,"standardize_not_equals":true,"ternary_operator_spaces":true,"trailing_comma_in_multiline_array":true,"trim_array_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"yoda_style":true},"hashes":{"src\\AccessToken.php":3022530932,"src\\Client.php":2533637922,"src\\CredentialInterface.php":2592478719,"src\\CursorBasedPagination.php":4246520430,"src\\Exception\\ClientException.php":2624552910,"src\\Exception\\InvalidArgumentException.php":197676351,"src\\Exception\\RuntimeException.php":3732727930,"src\\Hydrator\\Hydrator.php":461254325,"src\\Hydrator\\HydratorInterface.php":3204639452,"src\\Model\\Address.php":3542209542,"src\\Model\\AddressTrait.php":880007153,"src\\Model\\AdminGraphqlApiId.php":2015937222,"src\\Model\\Article.php":2237336920,"src\\Model\\Asset.php":2928284121,"src\\Model\\Blog.php":2886512688,"src\\Model\\CarrierService.php":4159455239,"src\\Model\\ClientDetails.php":1719986027,"src\\Model\\Collect.php":381995377,"src\\Model\\Comment.php":1501028096,"src\\Model\\Country.php":196323893,"src\\Model\\CustomCollection.php":3145899849,"src\\Model\\CustomCollectionImage.php":2194189259,"src\\Model\\Customer.php":340406206,"src\\Model\\CustomerInvite.php":2634147430,"src\\Model\\CustomerSavedSearch.php":3590182065,"src\\Model\\DiscountAllocation.php":3316838789,"src\\Model\\DiscountApplication.php":892837652,"src\\Model\\DiscountCode.php":2551338049,"src\\Model\\DraftOrder.php":3884173703,"src\\Model\\Fulfillment.php":4168655393,"src\\Model\\FulfillmentService.php":4241859399,"src\\Model\\Image.php":1404083199,"src\\Model\\InventoryItem.php":1587952866,"src\\Model\\InventoryLevel.php":1678847330,"src\\Model\\LineItem.php":2382478732,"src\\Model\\Location.php":3726325376,"src\\Model\\Model.php":3017583090,"src\\Model\\ModelInterface.php":3875582988,"src\\Model\\Option.php":3195270014,"src\\Model\\Order.php":4115989303,"src\\Model\\OrderAddress.php":3885025408,"src\\Model\\Page.php":1047224158,"src\\Model\\PaymentDetails.php":4045207634,"src\\Model\\Policy.php":3108957698,"src\\Model\\PriceRule.php":1563308235,"src\\Model\\Product.php":3712416815,"src\\Model\\Province.php":959726,"src\\Model\\RecurringApplicationCharge.php":3062274005,"src\\Model\\Redirect.php":3533969526,"src\\Model\\Refund.php":2034544242,"src\\Model\\RefundLineItem.php":1483597100,"src\\Model\\Risk.php":1079704639,"src\\Model\\ScriptTag.php":2594639510,"src\\Model\\ShippingLine.php":3476743707,"src\\Model\\ShippingZone.php":1908990228,"src\\Model\\Shop.php":2675749123,"src\\Model\\SmartCollection.php":2179029304,"src\\Model\\SmartCollectionImage.php":1711176814,"src\\Model\\TaxLine.php":3149690376,"src\\Model\\Theme.php":64216406,"src\\Model\\Transaction.php":2352833530,"src\\Model\\Variant.php":1631207914,"src\\Model\\Webhook.php":57740793,"src\\PrivateAppCredential.php":173845750,"src\\PublicAppCredential.php":3072998776,"src\\Service\\AbstractManager.php":713186711,"src\\Service\\AddressManager.php":2964430291,"src\\Service\\ArticleManager.php":3480416439,"src\\Service\\AssetManager.php":2966193095,"src\\Service\\BlogManager.php":3609921599,"src\\Service\\CarrierServiceManager.php":1762861588,"src\\Service\\CollectManager.php":562512962,"src\\Service\\CommentManager.php":3591366012,"src\\Service\\Contracts\\AddressManagerInterface.php":2426199702,"src\\Service\\Contracts\\ArticleManagerInterface.php":1674713170,"src\\Service\\Contracts\\AssetManagerInterface.php":2274217231,"src\\Service\\Contracts\\BlogManagerInterface.php":770885632,"src\\Service\\Contracts\\CarrierServiceManagerInterface.php":4228242032,"src\\Service\\Contracts\\CollectManagerInterface.php":3503570680,"src\\Service\\Contracts\\CommentManagerInterface.php":3849536202,"src\\Service\\Contracts\\CountryManagerInterface.php":2205352961,"src\\Service\\Contracts\\CustomCollectionManagerInterface.php":2441727567,"src\\Service\\Contracts\\CustomerManagerInterface.php":2425853838,"src\\Service\\Contracts\\CustomerSavedSearchManagerInterface.php":2827185687,"src\\Service\\Contracts\\DiscountCodeManagerInterface.php":2917282522,"src\\Service\\Contracts\\DraftOrderManagerInterface.php":3280951270,"src\\Service\\Contracts\\FulfillmentManagerInterface.php":3394809206,"src\\Service\\Contracts\\FulfillmentServiceManagerInterface.php":1560486479,"src\\Service\\Contracts\\ImageManagerInterface.php":784883179,"src\\Service\\Contracts\\InventoryItemManagerInterface.php":920102597,"src\\Service\\Contracts\\InventoryLevelManagerInterface.php":1335687932,"src\\Service\\Contracts\\LocationManagerInterface.php":197335094,"src\\Service\\Contracts\\ManagerInterface.php":1703429806,"src\\Service\\Contracts\\OrderManagerInterface.php":3748551237,"src\\Service\\Contracts\\PageManagerInterface.php":335673575,"src\\Service\\Contracts\\PolicyManagerInterface.php":2917033725,"src\\Service\\Contracts\\PriceRuleManagerInterface.php":1098503596,"src\\Service\\Contracts\\ProductManagerInterface.php":1037753301,"src\\Service\\Contracts\\ProvinceManagerInterface.php":3578025786,"src\\Service\\Contracts\\RecurringApplicationChargeManagerInterface.php":88859631,"src\\Service\\Contracts\\RedirectManagerInterface.php":1310871652,"src\\Service\\Contracts\\RefundManagerInterface.php":3210851862,"src\\Service\\Contracts\\RiskManagerInterface.php":2133225196,"src\\Service\\Contracts\\ScriptTagManagerInterface.php":3700338078,"src\\Service\\Contracts\\ShippingZoneManagerInterface.php":1782168425,"src\\Service\\Contracts\\ShopManagerInterface.php":4094618796,"src\\Service\\Contracts\\SmartCollectionManagerInterface.php":3621487387,"src\\Service\\Contracts\\ThemeManagerInterface.php":829115745,"src\\Service\\Contracts\\TransactionManagerInterface.php":1651071542,"src\\Service\\Contracts\\VariantManagerInterface.php":1580607751,"src\\Service\\Contracts\\WebhookManagerInterface.php":2694459680,"src\\Service\\CountryManager.php":392805000,"src\\Service\\CustomCollectionManager.php":597213324,"src\\Service\\CustomerManager.php":1370773914,"src\\Service\\CustomerSavedSearchManager.php":2264990333,"src\\Service\\DiscountCodeManager.php":3692280229,"src\\Service\\DraftOrderManager.php":3570776596,"src\\Service\\FulfillmentManager.php":496933219,"src\\Service\\FulfillmentServiceManager.php":3902086614,"src\\Service\\GeneralCurdable.php":699862766,"src\\Service\\ImageManager.php":4194275731,"src\\Service\\InventoryItemManager.php":3869920151,"src\\Service\\InventoryLevelManager.php":2853057476,"src\\Service\\LocationManager.php":4115663258,"src\\Service\\NestCrudable.php":1116356340,"src\\Service\\OrderManager.php":772797073,"src\\Service\\PageManager.php":1809658005,"src\\Service\\PolicyManager.php":730819921,"src\\Service\\PriceRuleManager.php":3780530284,"src\\Service\\ProductManager.php":2310278969,"src\\Service\\ProvinceManager.php":1500230012,"src\\Service\\RecurringApplicationChargeManager.php":1300104948,"src\\Service\\RedirectManager.php":1656734119,"src\\Service\\RefundManager.php":1406983861,"src\\Service\\RiskManager.php":2781351292,"src\\Service\\ScriptTagManager.php":662337241,"src\\Service\\ShippingZoneManager.php":3257255247,"src\\Service\\ShopManager.php":2563401071,"src\\Service\\SmartCollectionManager.php":592546439,"src\\Service\\ThemeManager.php":3730307658,"src\\Service\\TransactionManager.php":3248938701,"src\\Service\\VariantManager.php":761372561,"src\\Service\\WebhookManager.php":2856211423}}
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
language: php

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

before_script:
- composer install
Expand Down
83 changes: 44 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ $client = new Slince\Shopify\Client($credential, 'your-store.myshopify.com', [
```php
$products = $client->getProductManager()->findAll([
// Filter your product
'collection_id' => 841564295
'page' => 2 // deprecated
'collection_id' => 841564295,
]);
```

Expand All @@ -74,6 +73,12 @@ $currentProducts = $pagination->current(); //current page
while ($pagination->hasNext()) {
$nextProducts = $pagination->next();
}

# to persist across requests you can use next_page_info and previous_page_info
$nextPageInfo = $pagination->getNextPageInfo();
$prevPageInfo = $pagination->getPrevPageInfo();

$products = $pagination->current($nextPageInfo);
```

* Get the specified product
Expand Down Expand Up @@ -115,43 +120,43 @@ print_r($product->getImages());

Available managers:

- [Article](./src/Manager/Article/ArticleManagerInterface.php)
- [Asset](./src/Manager/Asset/AssetManagerInterface.php)
- [Blog](./src/Manager/Blog/BlogManagerInterface.php)
- [CarrierService](./src/Manager/CarrierService/CarrierServiceManagerInterface.php)
- [Collect](./src/Manager/Collect/CollectManagerInterface.php)
- [Comment](./src/Manager/Comment/CommentManagerInterface.php)
- [Country](./src/Manager/Country/CountryManagerInterface.php)
- [CustomCollection](./src/Manager/CustomCollection/CustomCollectionManagerInterface.php)
- [Customer](./src/Manager/Customer/CustomerManagerInterface.php)
- [CustomerAddress](./src/Manager/CustomerAddress/AddressManagerInterface.php)
- [CustomerSavedSearch](./src/Manager/CustomerSavedSearch/CustomerSavedSearchManagerInterface.php)
- [DiscountCode](./src/Manager/DiscountCode/DiscountCodeManagerInterface.php)
- [DraftOrder](./src/Manager/DraftOrder/DraftOrderManagerInterface.php)
- [Fulfillment](./src/Manager/Fulfillment/FulfillmentManagerInterface.php)
- [FulfillmentService](./src/Manager/FulfillmentService/FulfillmentServiceManagerInterface.php)
- [InventoryItem](./src/Manager/InventoryItem/InventoryItemManagerInterface.php)
- [InventoryLevel](./src/Manager/InventoryLevel/InventoryLevelManagerInterface.php)
- [Location](./src/Manager/Location/LocationManagerInterface.php)
- [Order](./src/Manager/Order/OrderManagerInterface.php)
- [OrderRisk](./src/Manager/OrderRisk/RiskManagerInterface.php)
- [Page](./src/Manager/Page/PageManagerInterface.php)
- [Policy](./src/Manager/Policy/PolicyManagerInterface.php)
- [PriceRule](./src/Manager/PriceRule/PriceRuleManagerInterface.php)
- [Product](./src/Manager/Product/ProductManagerInterface.php)
- [ProductImage](./src/Manager/ProductImage/ImageManagerInterface.php)
- [ProductVariant](./src/Manager/ProductVariant/VariantManagerInterface.php)
- [Province](./src/Manager/Province/ProvinceManagerInterface.php)
- [RecurringApplicationCharge](./src/Manager/RecurringApplicationCharge/RecurringApplicationChargeManagerInterface.php)
- [Redirect](./src/Manager/Redirect/RedirectManagerInterface.php)
- [Refund](./src/Manager/Refund/RefundManagerInterface.php)
- [ScriptTag](./src/Manager/ScriptTag/ScriptTagManagerInterface.php)
- [ShippingZone](./src/Manager/ShippingZone/ShippingZoneManagerInterface.php)
- [Shop](./src/Manager/Shop/ShopManagerInterface.php)
- [SmartCollection](./src/Manager/SmartCollection/SmartCollectionManagerInterface.php)
- [Theme](./src/Manager/Theme/ThemeManagerInterface.php)
- [Transaction](./src/Manager/Transaction/TransactionManagerInterface.php)
- [Webhook](./src/Manager/Webhook/WebhookManagerInterface.php)
- [Article](./src/Service/Contracts/ArticleManagerInterface.php)
- [Asset](./src/Service/Contracts/AssetManagerInterface.php)
- [Blog](./src/Service/Contracts/BlogManagerInterface.php)
- [CarrierService](./src/Service/Contracts/CarrierServiceManagerInterface.php)
- [Collect](./src/Service/Contracts/CollectManagerInterface.php)
- [Comment](./src/Service/Contracts/CommentManagerInterface.php)
- [Country](./src/Service/Contracts/CountryManagerInterface.php)
- [CustomCollection](./src/Service/Contracts/CustomCollectionManagerInterface.php)
- [Customer](./src/Service/Contracts/CustomerManagerInterface.php)
- [CustomerAddress](./src/Service/Contracts/AddressManagerInterface.php)
- [CustomerSavedSearch](./src/Service/Contracts/CustomerSavedSearchManagerInterface.php)
- [DiscountCode](./src/Service/Contracts/DiscountCodeManagerInterface.php)
- [DraftOrder](./src/Service/Contracts/DraftOrderManagerInterface.php)
- [Fulfillment](./src/Service/Contracts/FulfillmentManagerInterface.php)
- [FulfillmentService](./src/Service/Contracts/FulfillmentServiceManagerInterface.php)
- [InventoryItem](./src/Service/Contracts/InventoryItemManagerInterface.php)
- [InventoryLevel](./src/Service/Contracts/InventoryLevelManagerInterface.php)
- [Location](./src/Service/Contracts/LocationManagerInterface.php)
- [Order](./src/Service/Contracts/OrderManagerInterface.php)
- [OrderRisk](./src/Service/Contracts/RiskManagerInterface.php)
- [Page](./src/Service/Contracts/PageManagerInterface.php)
- [Policy](./src/Service/Contracts/PolicyManagerInterface.php)
- [PriceRule](./src/Service/Contracts/PriceRuleManagerInterface.php)
- [Product](./src/Service/Contracts/ProductManagerInterface.php)
- [Image](./src/Service/Contracts/ImageManagerInterface.php)
- [Variant](./src/Service/Contracts/VariantManagerInterface.php)
- [Province](./src/Service/Contracts/ProvinceManagerInterface.php)
- [RecurringApplicationCharge](./src/Service/Contracts/RecurringApplicationChargeManagerInterface.php)
- [Redirect](./src/Service/Contracts/RedirectManagerInterface.php)
- [Refund](./src/Service/Contracts/RefundManagerInterface.php)
- [ScriptTag](./src/Service/Contracts/ScriptTagManagerInterface.php)
- [ShippingZone](./src/Service/Contracts/ShippingZoneManagerInterface.php)
- [Shop](./src/Service/Contracts/ShopManagerInterface.php)
- [SmartCollection](./src/Service/Contracts/SmartCollectionManagerInterface.php)
- [Theme](./src/Service/Contracts/ThemeManagerInterface.php)
- [Transaction](./src/Service/Contracts/TransactionManagerInterface.php)
- [Webhook](./src/Service/Contracts/WebhookManagerInterface.php)

You can access the manager like `$client->getProductManager()`, `$client->getOrderManager()`.

Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@
}
],
"require": {
"php": ">=5.6.0",
"php": "^7.1.3",
"guzzlehttp/guzzle": "^6.0",
"doctrine/inflector": "^1.0",
"doctrine/cache": "^1.0",
"slince/di": "^3.0",
"jms/serializer": "^1.0",
"symfony/yaml": "^2.0|^3.0|^4.0"
"symfony/yaml": "^3.4|^4.2|^5.0",
"symfony/serializer": "^3.4|^4.2|^5.0",
"symfony/property-info": "^3.4|^4.2|^5.0",
"symfony/finder": "^5.0",
"jms/serializer": "^3.5"
},
"require-dev": {
"phpunit/phpunit": "^5.0|^6.0",
"symfony/property-access": "^2.0|^3.0|^4.0",
"symfony/filesystem": "^2.0|^3.0|^4.0"
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"symfony/property-access": "^3.4|^4.2|^5.0",
"symfony/filesystem": "^3.4|^4.2|^5.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading