Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 4b4f2c6

Browse files
committed
make fields optional by default
1 parent 0ee68c2 commit 4b4f2c6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commercetools-php-sdk-changelog",
3-
"version": "2.17.0",
3+
"version": "2.17.1-beta.1",
44
"description": "commercetools PHP SDK changelog generator package description",
55
"homepage": "https://github.com/commercetools/commercetools-php-sdk",
66
"bugs": "https://github.com/commercetools/commercetools-php-sdk/issues",

src/Core/AbstractHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
abstract class AbstractHttpClient
1616
{
17-
const VERSION = '2.17.0';
17+
const VERSION = '2.17.1-beta.1';
1818

1919
/**
2020
* @var AdapterInterface

src/Core/Model/Common/JsonObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected function initialize($field)
192192

193193
public function isOptional($field)
194194
{
195-
return $this->fieldDefinitionValue($field, static::OPTIONAL, false);
195+
return $this->fieldDefinitionValue($field, static::OPTIONAL, true);
196196
}
197197

198198
protected function decorateField($field, $value)

tests/unit/Model/Common/JsonObjectTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function getObject()
3535
->will(
3636
$this->returnValue(
3737
[
38-
'key' => [JsonObject::TYPE => 'string'],
38+
'key' => [JsonObject::TYPE => 'string', JsonObject::OPTIONAL => false],
3939
'dummy' => [JsonObject::TYPE => 'string'],
4040
'true' => [JsonObject::TYPE => 'bool'],
4141
'false' => [JsonObject::TYPE => 'bool'],
@@ -243,7 +243,7 @@ public function testOptional()
243243
$this->returnValue('12345')
244244
);
245245

246-
$this->assertFalse($obj->isOptional('implicit'));
246+
$this->assertTrue($obj->isOptional('implicit'));
247247
$this->assertTrue($obj->isOptional('optional'));
248248
$this->assertFalse($obj->isOptional('required'));
249249
}

0 commit comments

Comments
 (0)