@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param string $specificAboutLink optional, human-friendly explanation of the specific error |
| 49 | 49 | * @param string $genericTypeLink optional, human-friendly explanation of the generic type of error |
| 50 | 50 | */ |
| 51 | - public function __construct($genericCode=null, $genericTitle=null, $specificDetails=null, $specificAboutLink=null, $genericTypeLink=null) { |
|
| 51 | + public function __construct($genericCode = null, $genericTitle = null, $specificDetails = null, $specificAboutLink = null, $genericTypeLink = null) { |
|
| 52 | 52 | if ($genericCode !== null) { |
| 53 | 53 | $this->setApplicationCode($genericCode); |
| 54 | 54 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @throws InputException if $exception is not \Exception or \Throwable |
| 70 | 70 | */ |
| 71 | - public static function fromException($exception, array $options=[]) { |
|
| 71 | + public static function fromException($exception, array $options = []) { |
|
| 72 | 72 | if ($exception instanceof \Exception === false && $exception instanceof \Throwable === false) { |
| 73 | 73 | throw new InputException('input is not a real exception in php5 or php7'); |
| 74 | 74 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @param string $specificAboutLink optional, explanation of the specific error |
| 128 | 128 | * @param string $genericTypeLink optional, explanation of the generic type of error |
| 129 | 129 | */ |
| 130 | - public function setHumanExplanation($genericTitle, $specificDetails=null, $specificAboutLink=null, $genericTypeLink=null) { |
|
| 130 | + public function setHumanExplanation($genericTitle, $specificDetails = null, $specificAboutLink = null, $genericTypeLink = null) { |
|
| 131 | 131 | $this->setHumanTitle($genericTitle); |
| 132 | 132 | |
| 133 | 133 | if ($specificDetails !== null) { |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * @param string $href |
| 148 | 148 | * @param array $meta optional, if given a LinkObject is added, otherwise a link string is added |
| 149 | 149 | */ |
| 150 | - public function setAboutLink($href, array $meta=[]) { |
|
| 150 | + public function setAboutLink($href, array $meta = []) { |
|
| 151 | 151 | $this->addLink('about', $href, $meta); |
| 152 | 152 | } |
| 153 | 153 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param string $href |
| 158 | 158 | * @param array $meta optional, if given a LinkObject is added, otherwise a link string is added |
| 159 | 159 | */ |
| 160 | - public function appendTypeLink($href, array $meta=[]) { |
|
| 160 | + public function appendTypeLink($href, array $meta = []) { |
|
| 161 | 161 | $this->appendLink('type', $href, $meta); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param string $type optional |
| 41 | 41 | * @param string|int $id optional |
| 42 | 42 | */ |
| 43 | - public function __construct($type=null, $id=null) { |
|
| 43 | + public function __construct($type = null, $id = null) { |
|
| 44 | 44 | parent::__construct(); |
| 45 | 45 | |
| 46 | 46 | $this->setPrimaryResource(new ResourceObject($type, $id)); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param array $options optional {@see ResourceDocument::$defaults} {@see ResourceObject::$defaults} |
| 58 | 58 | * @return ResourceDocument |
| 59 | 59 | */ |
| 60 | - public static function fromArray(array $attributes, $type=null, $id=null, array $options=[]) { |
|
| 60 | + public static function fromArray(array $attributes, $type = null, $id = null, array $options = []) { |
|
| 61 | 61 | $resourceDocument = new self(); |
| 62 | 62 | $resourceDocument->setPrimaryResource(ResourceObject::fromArray($attributes, $type, $id, $options), $options); |
| 63 | 63 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @param array $options optional {@see ResourceDocument::$defaults} |
| 72 | 72 | * @return ResourceDocument |
| 73 | 73 | */ |
| 74 | - public static function fromObject($attributes, $type=null, $id=null, array $options=[]) { |
|
| 74 | + public static function fromObject($attributes, $type = null, $id = null, array $options = []) { |
|
| 75 | 75 | $array = Converter::objectToArray($attributes); |
| 76 | 76 | |
| 77 | 77 | return self::fromArray($array, $type, $id, $options); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @param mixed $value objects will be converted using `get_object_vars()` |
| 85 | 85 | * @param array $options optional {@see ResourceDocument::$defaults} |
| 86 | 86 | */ |
| 87 | - public function add($key, $value, array $options=[]) { |
|
| 87 | + public function add($key, $value, array $options = []) { |
|
| 88 | 88 | $this->ensureResourceObject(); |
| 89 | 89 | |
| 90 | 90 | $this->resource->add($key, $value, $options); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @param array $meta optional |
| 102 | 102 | * @param array $options optional {@see ResourceDocument::$defaults} |
| 103 | 103 | */ |
| 104 | - public function addRelationship($key, $relation, array $links=[], array $meta=[], array $options=[]) { |
|
| 104 | + public function addRelationship($key, $relation, array $links = [], array $meta = [], array $options = []) { |
|
| 105 | 105 | $this->ensureResourceObject(); |
| 106 | 106 | |
| 107 | 107 | $options = array_merge(self::$defaults, $options); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @param array $meta optional, if given a LinkObject is added, otherwise a link string is added |
| 120 | 120 | * @param string $level one of the Document::LEVEL_* constants, optional, defaults to Document::LEVEL_ROOT |
| 121 | 121 | */ |
| 122 | - public function addLink($key, $href, array $meta=[], $level=Document::LEVEL_ROOT) { |
|
| 122 | + public function addLink($key, $href, array $meta = [], $level = Document::LEVEL_ROOT) { |
|
| 123 | 123 | $this->ensureResourceObject(); |
| 124 | 124 | |
| 125 | 125 | if ($level === Document::LEVEL_RESOURCE) { |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * @param string $href |
| 137 | 137 | * @param array $meta optional |
| 138 | 138 | */ |
| 139 | - public function setSelfLink($href, array $meta=[], $level=Document::LEVEL_RESOURCE) { |
|
| 139 | + public function setSelfLink($href, array $meta = [], $level = Document::LEVEL_RESOURCE) { |
|
| 140 | 140 | $this->ensureResourceObject(); |
| 141 | 141 | |
| 142 | 142 | if ($level === Document::LEVEL_RESOURCE) { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * @param mixed $value |
| 153 | 153 | * @param string $level one of the Document::LEVEL_* constants, optional, defaults to Document::LEVEL_ROOT |
| 154 | 154 | */ |
| 155 | - public function addMeta($key, $value, $level=Document::LEVEL_ROOT) { |
|
| 155 | + public function addMeta($key, $value, $level = Document::LEVEL_ROOT) { |
|
| 156 | 156 | if ($level === Document::LEVEL_RESOURCE) { |
| 157 | 157 | $this->resource->addMeta($key, $value); |
| 158 | 158 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * @param AttributesObject $attributesObject |
| 184 | 184 | * @param array $options optional {@see ResourceObject::$defaults} |
| 185 | 185 | */ |
| 186 | - public function setAttributesObject(AttributesObject $attributesObject, array $options=[]) { |
|
| 186 | + public function setAttributesObject(AttributesObject $attributesObject, array $options = []) { |
|
| 187 | 187 | $this->ensureResourceObject(); |
| 188 | 188 | |
| 189 | 189 | $this->resource->setAttributesObject($attributesObject, $options); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * @param RelationshipObject $relationshipObject |
| 199 | 199 | * @param array $options optional {@see ResourceDocument::$defaults} |
| 200 | 200 | */ |
| 201 | - public function addRelationshipObject($key, RelationshipObject $relationshipObject, array $options=[]) { |
|
| 201 | + public function addRelationshipObject($key, RelationshipObject $relationshipObject, array $options = []) { |
|
| 202 | 202 | $this->ensureResourceObject(); |
| 203 | 203 | |
| 204 | 204 | $options = array_merge(self::$defaults, $options); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | * @param RelationshipsObject $relationshipsObject |
| 219 | 219 | * @param array $options optional {@see ResourceDocument::$defaults} |
| 220 | 220 | */ |
| 221 | - public function setRelationshipsObject(RelationshipsObject $relationshipsObject, array $options=[]) { |
|
| 221 | + public function setRelationshipsObject(RelationshipsObject $relationshipsObject, array $options = []) { |
|
| 222 | 222 | $this->ensureResourceObject(); |
| 223 | 223 | |
| 224 | 224 | $options = array_merge(self::$defaults, $options); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | * |
| 245 | 245 | * @throws InputException if the $resource is a ResourceDocument itself |
| 246 | 246 | */ |
| 247 | - public function setPrimaryResource(ResourceInterface $resource, array $options=[]) { |
|
| 247 | + public function setPrimaryResource(ResourceInterface $resource, array $options = []) { |
|
| 248 | 248 | if ($resource instanceof ResourceDocument) { |
| 249 | 249 | throw new InputException('does not make sense to set a document inside a document, use ResourceObject or ResourceIdentifierObject instead'); |
| 250 | 250 | } |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | /** |
| 299 | 299 | * @inheritDoc |
| 300 | 300 | */ |
| 301 | - public function getResource($identifierOnly=false) { |
|
| 301 | + public function getResource($identifierOnly = false) { |
|
| 302 | 302 | return $this->resource->getResource($identifierOnly); |
| 303 | 303 | } |
| 304 | 304 | } |
@@ -9,5 +9,5 @@ |
||
| 9 | 9 | * @param string $firstHref optional |
| 10 | 10 | * @param string $lastHref optional |
| 11 | 11 | */ |
| 12 | - public function setPaginationLinks($previousHref=null, $nextHref=null, $firstHref=null, $lastHref=null); |
|
| 12 | + public function setPaginationLinks($previousHref = null, $nextHref = null, $firstHref = null, $lastHref = null); |
|
| 13 | 13 | } |
@@ -12,5 +12,5 @@ |
||
| 12 | 12 | * @param boolean $identifierOnly optional, defaults to false |
| 13 | 13 | * @return ResourceIdentifierObject|ResourceObject |
| 14 | 14 | */ |
| 15 | - public function getResource($identifierOnly=false); |
|
| 15 | + public function getResource($identifierOnly = false); |
|
| 16 | 16 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * @throws InputException if the keyword is not known to the profile |
| 21 | 21 | * @throws InputException if the alias is not a valid member name |
| 22 | 22 | */ |
| 23 | - public function __construct(array $aliases=[]); |
|
| 23 | + public function __construct(array $aliases = []); |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * get the keyword or current alias based on the official keyword from the profile |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @throws Exception if generating json fails |
| 22 | 22 | */ |
| 23 | - public function toJson(array $options=[]); |
|
| 23 | + public function toJson(array $options = []); |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * send jsonapi response to the browser |
@@ -29,5 +29,5 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @param array $options optional |
| 31 | 31 | */ |
| 32 | - public function sendResponse(array $options=[]); |
|
| 32 | + public function sendResponse(array $options = []); |
|
| 33 | 33 | } |