Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit f7a4179

Browse files
committed
Updated Changelog
- added changelog entry regarding fix - fixed code style issues
1 parent e187d63 commit f7a4179

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ Versions prior to 0.4.0 were released as the package "weierophinney/hal".
2424

2525
### Fixed
2626

27-
- Nothing.
27+
- [#34](https://github.com/zendframework/zend-expressive-hal/pull/37) adds ability
28+
to provide _empty_ values eg. empty array as element data and avoids addition of
29+
of empty data as **embedded** element.
2830

2931
## 1.0.0 - 2018-03-15
3032

src/HalResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(array $data = [], array $links = [], array $embedded
6161
$context = __CLASS__;
6262
array_walk($data, function ($value, $name) use ($context) {
6363
$this->validateElementName($name, $context);
64-
if (!empty($value) && ($value instanceof self || $this->isResourceCollection($value, $name, $context))) {
64+
if (! empty($value) && ($value instanceof self || $this->isResourceCollection($value, $name, $context))) {
6565
$this->embedded[$name] = $value;
6666
return;
6767
}
@@ -148,7 +148,7 @@ public function withElement(string $name, $value) : HalResource
148148
{
149149
$this->validateElementName($name, __METHOD__);
150150

151-
if (!empty($value) && ($value instanceof self || $this->isResourceCollection($value, $name, __METHOD__))) {
151+
if (! empty($value) && ($value instanceof self || $this->isResourceCollection($value, $name, __METHOD__))) {
152152
return $this->embed($name, $value);
153153
}
154154

0 commit comments

Comments
 (0)