|
1 |
| -# SPHERE.IO PHP SDK Changelog |
| 1 | +<a name"1.0.0-RC1"></a> |
| 2 | +### 1.0.0-RC1 (2015-07-27) |
2 | 3 |
|
3 |
| -### 1.0.0 Milestone 3 |
| 4 | + |
| 5 | +#### Bug Fixes |
| 6 | + |
| 7 | +* **CustomerCreateRequest:** set correct return object class ([d1c100c9](https://github.com/sphereio/sphere-php-sdk/commit/d1c100c9), closes [#109](https://github.com/sphereio/sphere-php-sdk/issues/109)) |
| 8 | +* **Requests:** fix the usage of relative path by requests ([e32d0150](https://github.com/sphereio/sphere-php-sdk/commit/e32d0150)) |
| 9 | +* **Order:** set correct return type for order discountCodes ([5bbf4f14](https://github.com/sphereio/sphere-php-sdk/commit/5bbf4f14)) |
| 10 | + |
| 11 | + |
| 12 | +#### Features |
| 13 | + |
| 14 | +* **AnnotationGenerator:** add magic method getAt and current with correct type hint to collections ([324886db](https://github.com/sphereio/sphere-php-sdk/commit/324886db)) |
| 15 | +* **Attribute:** add feature to set attribute type definitions to attributes ([37546b33](https://github.com/sphereio/sphere-php-sdk/commit/37546b33)) |
| 16 | +* **AttributeCollection:** add feature to set attribute type definitions to attribute collection ([af3b558a](https://github.com/sphereio/sphere-php-sdk/commit/af3b558a)) |
| 17 | +* **CartDiscount:** add update actions ([c0e27dd5](https://github.com/sphereio/sphere-php-sdk/commit/c0e27dd5)) |
| 18 | +* **Channel:** |
| 19 | + * add product distribution channel to line items and channel roles ([fdc4ed82](https://github.com/sphereio/sphere-php-sdk/commit/fdc4ed82), closes [#120](https://github.com/sphereio/sphere-php-sdk/issues/120)) |
| 20 | + * add update actions ([b355e9aa](https://github.com/sphereio/sphere-php-sdk/commit/b355e9aa)) |
| 21 | +* **Client:** add named constructor to Client and Config object ([1a0c350f](https://github.com/sphereio/sphere-php-sdk/commit/1a0c350f), closes [#101](https://github.com/sphereio/sphere-php-sdk/issues/101)) |
| 22 | +* **Comments:** add update actions ([54804bf1](https://github.com/sphereio/sphere-php-sdk/commit/54804bf1)) |
| 23 | +* **CustomerGroups:** add update actions ([30789b76](https://github.com/sphereio/sphere-php-sdk/commit/30789b76)) |
| 24 | +* **DiscountCodes:** add update actions ([e3357965](https://github.com/sphereio/sphere-php-sdk/commit/e3357965)) |
| 25 | +* **Exceptions:** wrap http client exceptions ([a169611b](https://github.com/sphereio/sphere-php-sdk/commit/a169611b)) |
| 26 | +* **Inventory:** add update actions ([12ea56d5](https://github.com/sphereio/sphere-php-sdk/commit/12ea56d5)) |
| 27 | +* **JsonObject:** add magic getter to access object data as property ([7a22cfa7](https://github.com/sphereio/sphere-php-sdk/commit/7a22cfa7)) |
| 28 | +* **ProductDiscounts:** add update actions ([24bd9afb](https://github.com/sphereio/sphere-php-sdk/commit/24bd9afb)) |
| 29 | +* **ProductTypes:** add update actions ([50616ef8](https://github.com/sphereio/sphere-php-sdk/commit/50616ef8)) |
| 30 | +* **Project:** add project fetch request ([4e8d232c](https://github.com/sphereio/sphere-php-sdk/commit/4e8d232c), closes [#35](https://github.com/sphereio/sphere-php-sdk/issues/35)) |
| 31 | +* **Requests:** |
| 32 | + * add executeWithClient and mapResponse function with correct type hints ([8cb1b2cc](https://github.com/sphereio/sphere-php-sdk/commit/8cb1b2cc)) |
| 33 | + * add withTotal flag for query speed optimization ([b7892401](https://github.com/sphereio/sphere-php-sdk/commit/b7892401)) |
| 34 | +* **Review:** add update actions ([4f1d55c8](https://github.com/sphereio/sphere-php-sdk/commit/4f1d55c8)) |
| 35 | +* **ShippingMethod:** |
| 36 | + * add update actions ([46993be2](https://github.com/sphereio/sphere-php-sdk/commit/46993be2)) |
| 37 | + * add shipping method getByCartId and getByLocation ([cb522923](https://github.com/sphereio/sphere-php-sdk/commit/cb522923)) |
| 38 | +* **State:** add update actions ([3833ad1d](https://github.com/sphereio/sphere-php-sdk/commit/3833ad1d)) |
| 39 | +* **TaxCategory:** add update actions ([428ba25a](https://github.com/sphereio/sphere-php-sdk/commit/428ba25a)) |
| 40 | +* **Zones:** add update actions ([a74c3517](https://github.com/sphereio/sphere-php-sdk/commit/a74c3517)) |
| 41 | + |
| 42 | + |
| 43 | +#### Breaking Changes |
| 44 | + |
| 45 | +* QueryRequests renamed to singular form |
| 46 | + |
| 47 | + To streamline the naming schemes between the SDKs QueryRequests have been renamed to their singular form. E.g.: |
| 48 | + |
| 49 | + Before: |
| 50 | + |
| 51 | + ``` |
| 52 | + $request = CategoriesQueryRequest::of(); |
| 53 | + ``` |
| 54 | + |
| 55 | + After: |
| 56 | + |
| 57 | + ``` |
| 58 | + $request = CategoryQueryRequest::of(); |
| 59 | + ``` |
| 60 | + |
| 61 | + ([8de23283](https://github.com/sphereio/sphere-php-sdk/commit/8de23283)) |
| 62 | +* SingleResourceResponse renamed to ResourceResponse |
| 63 | + |
| 64 | + To streamline the naming schemes between the SDKs SingleResourceResponse has been renamed to ResourceResponse |
| 65 | + |
| 66 | + ([4199c815](https://github.com/sphereio/sphere-php-sdk/commit/4199c815)) |
| 67 | +* ImportLineItem renamed to LineItemImportDraft |
| 68 | + |
| 69 | + To streamline the naming schemes between the SDKs ImportProductVariant, ImportLineItem and ImportLineItemCollection |
| 70 | + have been renamed to ProductVariantImportDraft, LineItemImportDraft and LineItemImportDraftCollection. |
| 71 | + |
| 72 | + ([018c7493](https://github.com/sphereio/sphere-php-sdk/commit/018c7493)) |
| 73 | +* CartDiscountCodeReference renamed to DiscountCodeInfo |
| 74 | + |
| 75 | + To streamline the naming schemes between the SDKs CartDiscountCodeReference has been renamed to DiscountCodeInfo |
| 76 | + |
| 77 | + ([db14db07](https://github.com/sphereio/sphere-php-sdk/commit/db14db07)) |
| 78 | +* DeleteById requests renamed to Delete requests |
| 79 | + |
| 80 | + To streamline the naming schemes between the SDKs delete requests have been renamed. E.g.: |
| 81 | + |
| 82 | + Before: |
| 83 | + |
| 84 | + ``` |
| 85 | + $request = ProductDeleteByIdRequest::ofIdAndVersion('<id>', <version>); |
| 86 | + ``` |
| 87 | + |
| 88 | + After: |
| 89 | + |
| 90 | + ``` |
| 91 | + $request = ProductDeleteRequest::ofIdAndVersion('<id>', <version>); |
| 92 | + ``` |
| 93 | + |
| 94 | + ([896e95a9](https://github.com/sphereio/sphere-php-sdk/commit/896e95a9)) |
| 95 | +* FetchBy requests renamed to ByGetRequest |
| 96 | + |
| 97 | + To streamline the naming schemes between the SDKs FetchBy requests have been renamed to ByGet requests. E.g.: |
| 98 | + |
| 99 | + Before: |
| 100 | + |
| 101 | + ``` |
| 102 | + $request = ProductFetchByIdRequest::ofId('<id>'); |
| 103 | + ``` |
| 104 | + |
| 105 | + After: |
| 106 | + |
| 107 | + ``` |
| 108 | + $request = ProductByIdGetRequest::ofId('<id>'); |
| 109 | + ``` |
| 110 | + |
| 111 | + ([d601dcfc](https://github.com/sphereio/sphere-php-sdk/commit/d601dcfc)) |
| 112 | +* Document has been renamed to Resource |
| 113 | + |
| 114 | + To streamline the naming schemes between the SDKs Document has been renamed to Resource. Type checks have to be adjusted |
| 115 | + |
| 116 | + Before: |
| 117 | + |
| 118 | + ``` |
| 119 | + if ($object instanceof \Sphere\Core\Model\Common\Document) |
| 120 | + ``` |
| 121 | + |
| 122 | + After: |
| 123 | + |
| 124 | + ``` |
| 125 | + if ($object instanceof \Sphere\Core\Model\Common\Resource) |
| 126 | + ``` |
| 127 | + |
| 128 | + ([5704fa3e](https://github.com/sphereio/sphere-php-sdk/commit/5704fa3e)) |
| 129 | +* ProductSearchEndpoint has been renamed |
| 130 | + |
| 131 | + Before: |
| 132 | + |
| 133 | + ``` |
| 134 | + $endpoint = ProductSearchEndpoint::endpoint(); |
| 135 | + ``` |
| 136 | + |
| 137 | + After: |
| 138 | + |
| 139 | + ``` |
| 140 | + $endpoint = ProductProjectionEndpoint::endpoint(); |
| 141 | + ``` |
| 142 | + |
| 143 | + closes [#103](https://github.com/sphereio/sphere-php-sdk/issues/103) |
| 144 | + |
| 145 | + ([e1b6989f](https://github.com/sphereio/sphere-php-sdk/commit/e1b6989f)) |
| 146 | +* ProductsSearchRequest has been renamed |
| 147 | + |
| 148 | + Before: |
| 149 | + |
| 150 | + ``` |
| 151 | + $request = ProductsSearchRequest::of(); |
| 152 | + ``` |
| 153 | + |
| 154 | + After: |
| 155 | + |
| 156 | + ``` |
| 157 | + $request = ProductProjectionSearchRequest::of(); |
| 158 | + ``` |
| 159 | + |
| 160 | + closes [#103](https://github.com/sphereio/sphere-php-sdk/issues/103) |
| 161 | + |
| 162 | + ([bd1bf7b1](https://github.com/sphereio/sphere-php-sdk/commit/bd1bf7b1)) |
| 163 | +* config object fromArray method is declared static |
| 164 | + |
| 165 | + Before: |
| 166 | + |
| 167 | + ``` |
| 168 | + $config = new Config(); |
| 169 | + $config->fromArray($configArray); |
| 170 | + ``` |
| 171 | + |
| 172 | + After: |
| 173 | + |
| 174 | + ``` |
| 175 | + $config = Config::fromArray($configArray); |
| 176 | + ``` |
| 177 | + |
| 178 | + closes [#101](https://github.com/sphereio/sphere-php-sdk/issues/101) |
| 179 | + |
| 180 | + ([1a0c350f](https://github.com/sphereio/sphere-php-sdk/commit/1a0c350f)) |
| 181 | +* ext-intl is now mandatory |
| 182 | + |
| 183 | + ([2afea8ad](https://github.com/sphereio/sphere-php-sdk/commit/2afea8ad)) |
| 184 | +* getters return null if value is not set |
| 185 | + |
| 186 | + To have a more reliable return values the implied instantiation of empty objects has been removed. This means before using a value is must be set explicit. Example for collections |
| 187 | + |
| 188 | + Before: |
| 189 | + |
| 190 | + ``` |
| 191 | + $obj = ProductTypeDraft::ofNameAndDescription('test', 'test'); |
| 192 | + $obj->getAttributes()->add(AttributeDefinition::of()->setName('test')); |
| 193 | + ``` |
| 194 | + |
| 195 | + After: |
| 196 | + |
| 197 | + ``` |
| 198 | + $obj = ProductTypeDraft::ofNameAndDescription('test', 'test'); |
| 199 | + $obj->setAttributes(AttributeDefinitionCollection::of()->add(AttributeDefinition::of()->setName('test'))); |
| 200 | + ``` |
| 201 | + |
| 202 | + Closes [#113](https://github.com/sphereio/sphere-php-sdk/issues/113) |
| 203 | + |
| 204 | + ([8b138e7b](https://github.com/sphereio/sphere-php-sdk/commit/8b138e7b)) |
| 205 | +* all http client exceptions are now wrapped inside the SphereException hierarchy |
| 206 | + |
| 207 | + Before: |
| 208 | + |
| 209 | + ``` |
| 210 | + try { |
| 211 | + $response = $client->execute($request) |
| 212 | + } catch(\GuzzleHttp\Exception\RequestException $e) { |
| 213 | + ... |
| 214 | + } |
| 215 | + ``` |
| 216 | + |
| 217 | + After: |
| 218 | + |
| 219 | + ``` |
| 220 | + try { |
| 221 | + $response = $client->execute($request) |
| 222 | + } catch(\Sphere\Core\Error\SphereException $e) { |
| 223 | + ... |
| 224 | + } |
| 225 | + ``` |
| 226 | + |
| 227 | + ([a169611b](https://github.com/sphereio/sphere-php-sdk/commit/a169611b)) |
| 228 | +* rename client method future to executeAsync |
| 229 | + |
| 230 | + To streamline the request executing methods the future method has been renamed. To migrate the code follow the example: |
| 231 | + |
| 232 | + Before: |
| 233 | + |
| 234 | + ``` |
| 235 | + $response = $client->future($request); |
| 236 | + ``` |
| 237 | + |
| 238 | + After: |
| 239 | + |
| 240 | + ``` |
| 241 | + $response = $client->executeAsync($request); |
| 242 | + ``` |
| 243 | + |
| 244 | + ([51da11fa](https://github.com/sphereio/sphere-php-sdk/commit/51da11fa)) |
| 245 | +* changes the static "of" constructor to named constructors |
| 246 | + |
| 247 | + The static constructor "of" for models and requests needs magic methods in the class header to provide proper IDE support. By using the library as a dependency the magic methods were not correctly used by the IDE. Also the reflection used inside the OfTrait is not the best solution. So now all models and requests should have one or more named constructors which can be properly read by most IDE, don't require reflection for instantiation and can create instances without parameters which is helpful for testing purposes. |
| 248 | + |
| 249 | + * constructor of Models and Requests doesn't have required values anymore |
| 250 | + * static "of" constructor instantiates class with given context object. Use named constructors for instantiating models or requests with arguments |
| 251 | + |
| 252 | + ([d19a83c1](https://github.com/sphereio/sphere-php-sdk/commit/d19a83c1)) |
| 253 | + |
| 254 | +### 1.0.0-beta.2 (Milestone 3) |
4 | 255 | Major refactoring of the http client handling. Sphere client uses now PSR http messages for internal request and response representation and ships with a guzzle5 and guzzle6 http client adapter which will be automatically used. It's also possible to register new http client adapters implementing Sphere\Core\Client\Adapter\AdapterInterface
|
5 | 256 |
|
6 | 257 | * switch composer to caret operator
|
@@ -50,7 +301,7 @@ Major refactoring of the http client handling. Sphere client uses now PSR http m
|
50 | 301 | * fix multi facet and filter params
|
51 | 302 | * fix type of TaxRate
|
52 | 303 |
|
53 |
| -### 1.0.0 Milestone 2 |
| 304 | +### 1.0.0-beta.1 (Milestone 2) |
54 | 305 | * add unit tests for query, fetch and delete requests
|
55 | 306 | * add tests for order and product update actions
|
56 | 307 | * add customer, category and cart update action tests
|
|
0 commit comments