@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * encode to json with these default options |
| 48 | 48 | */ |
| 49 | - 'encodeOptions' => JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE, |
|
| 49 | + 'encodeOptions' => JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE, |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * encode to human-readable json, useful when debugging |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @throws InputException if the $level is Document::LEVEL_JSONAPI, Document::LEVEL_RESOURCE, or unknown |
| 94 | 94 | */ |
| 95 | - public function addLink($key, $href, array $meta=[], $level=Document::LEVEL_ROOT) { |
|
| 95 | + public function addLink($key, $href, array $meta = [], $level = Document::LEVEL_ROOT) { |
|
| 96 | 96 | if ($level === Document::LEVEL_ROOT) { |
| 97 | 97 | if ($this->links === null) { |
| 98 | 98 | $this->setLinksObject(new LinksObject()); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * @param array $meta optional, if given a LinkObject is added, otherwise a link string is added |
| 119 | 119 | * @param string $level one of the Document::LEVEL_* constants, optional, defaults to Document::LEVEL_ROOT |
| 120 | 120 | */ |
| 121 | - public function setSelfLink($href, array $meta=[], $level=Document::LEVEL_ROOT) { |
|
| 121 | + public function setSelfLink($href, array $meta = [], $level = Document::LEVEL_ROOT) { |
|
| 122 | 122 | $this->addLink('self', $href, $meta, $level); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | * @param string $href |
| 133 | 133 | * @param array $meta optional, if given a LinkObject is added, otherwise a link string is added |
| 134 | 134 | */ |
| 135 | - public function setDescribedByLink($href, array $meta=[]) { |
|
| 136 | - $this->addLink('describedby', $href, $meta, $level=Document::LEVEL_ROOT); |
|
| 135 | + public function setDescribedByLink($href, array $meta = []) { |
|
| 136 | + $this->addLink('describedby', $href, $meta, $level = Document::LEVEL_ROOT); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @throws InputException if the $level is unknown |
| 145 | 145 | * @throws InputException if the $level is Document::LEVEL_RESOURCE |
| 146 | 146 | */ |
| 147 | - public function addMeta($key, $value, $level=Document::LEVEL_ROOT) { |
|
| 147 | + public function addMeta($key, $value, $level = Document::LEVEL_ROOT) { |
|
| 148 | 148 | if ($level === Document::LEVEL_ROOT) { |
| 149 | 149 | if ($this->meta === null) { |
| 150 | 150 | $this->setMetaObject(new MetaObject()); |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | /** |
| 246 | 246 | * @inheritDoc |
| 247 | 247 | */ |
| 248 | - public function toJson(array $options=[]) { |
|
| 248 | + public function toJson(array $options = []) { |
|
| 249 | 249 | $options = array_merge(self::$defaults, $options); |
| 250 | 250 | |
| 251 | 251 | $array = ($options['array'] !== null) ? $options['array'] : $this->toArray(); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | /** |
| 270 | 270 | * @inheritDoc |
| 271 | 271 | */ |
| 272 | - public function sendResponse(array $options=[]) { |
|
| 272 | + public function sendResponse(array $options = []) { |
|
| 273 | 273 | $options = array_merge(self::$defaults, $options); |
| 274 | 274 | |
| 275 | 275 | if ($this->httpStatusCode === 204) { |