@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @param Task $task |
| 54 | 54 | * @param array $data |
| 55 | 55 | */ |
| 56 | - public function __construct (Task $task, array $data = []) { |
|
| 56 | + public function __construct(Task $task, array $data = []) { |
|
| 57 | 57 | $this->task = $task; |
| 58 | 58 | parent::__construct($task, $data); |
| 59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @param mixed $unused |
| 64 | 64 | * @internal called by an entry |
| 65 | 65 | */ |
| 66 | - final public function __set (string $gid, $unused): void { |
|
| 66 | + final public function __set(string $gid, $unused): void { |
|
| 67 | 67 | $this->diff[$gid] = true; |
| 68 | 68 | $this->task->diff['custom_fields'] = true; |
| 69 | 69 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @param mixed $unused |
| 73 | 73 | * @internal called by the task |
| 74 | 74 | */ |
| 75 | - final public function __unset ($unused): void { |
|
| 75 | + final public function __unset($unused): void { |
|
| 76 | 76 | $this->diff = []; |
| 77 | 77 | foreach ($this->data as $entry) { |
| 78 | 78 | $entry->diff = []; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @param string $i |
| 84 | 84 | * @param array $data |
| 85 | 85 | */ |
| 86 | - protected function _setField (string $i, $data): void { |
|
| 86 | + protected function _setField(string $i, $data): void { |
|
| 87 | 87 | /** @var FieldEntry $entry */ |
| 88 | 88 | $entry = $this->api->factory($this, FieldEntry::class, $data); |
| 89 | 89 | $gid = $entry->getGid(); |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | * @param string $offset |
| 98 | 98 | * @return string |
| 99 | 99 | */ |
| 100 | - protected function _toGid (string $offset): string { |
|
| 100 | + protected function _toGid(string $offset): string { |
|
| 101 | 101 | return $this->gids[$offset] ?? $offset; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * @return int |
| 106 | 106 | */ |
| 107 | - final public function count (): int { |
|
| 107 | + final public function count(): int { |
|
| 108 | 108 | return count($this->data); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @param $fieldGid |
| 113 | 113 | * @return FieldEntry |
| 114 | 114 | */ |
| 115 | - public function getField ($fieldGid) { |
|
| 115 | + public function getField($fieldGid) { |
|
| 116 | 116 | return $this->data[$fieldGid]; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -120,21 +120,21 @@ discard block |
||
| 120 | 120 | * @param string $name |
| 121 | 121 | * @return string |
| 122 | 122 | */ |
| 123 | - final public function getGid (string $name): string { |
|
| 123 | + final public function getGid(string $name): string { |
|
| 124 | 124 | return $this->gids[$name]; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * @return string[] |
| 129 | 129 | */ |
| 130 | - final public function getGids () { |
|
| 130 | + final public function getGids() { |
|
| 131 | 131 | return $this->gids; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | 135 | * @return Generator |
| 136 | 136 | */ |
| 137 | - public function getIterator () { |
|
| 137 | + public function getIterator() { |
|
| 138 | 138 | foreach ($this->data as $gid => $field) { |
| 139 | 139 | yield $gid => $field->getValue(); |
| 140 | 140 | } |
@@ -144,21 +144,21 @@ discard block |
||
| 144 | 144 | * @param string $fieldGid |
| 145 | 145 | * @return string |
| 146 | 146 | */ |
| 147 | - final public function getName (string $fieldGid): string { |
|
| 147 | + final public function getName(string $fieldGid): string { |
|
| 148 | 148 | return $this->names[$fieldGid]; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | 152 | * @return string[] |
| 153 | 153 | */ |
| 154 | - final public function getNames () { |
|
| 154 | + final public function getNames() { |
|
| 155 | 155 | return $this->names; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | 159 | * @return array |
| 160 | 160 | */ |
| 161 | - final public function getValues (): array { |
|
| 161 | + final public function getValues(): array { |
|
| 162 | 162 | return iterator_to_array($this); |
| 163 | 163 | } |
| 164 | 164 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @param string $offset |
| 167 | 167 | * @return bool |
| 168 | 168 | */ |
| 169 | - final public function offsetExists ($offset): bool { |
|
| 169 | + final public function offsetExists($offset): bool { |
|
| 170 | 170 | return isset($this->data[$this->_toGid($offset)]); |
| 171 | 171 | } |
| 172 | 172 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * @param string $offset |
| 175 | 175 | * @return null|number|string |
| 176 | 176 | */ |
| 177 | - final public function offsetGet ($offset) { |
|
| 177 | + final public function offsetGet($offset) { |
|
| 178 | 178 | return $this->data[$this->_toGid($offset)]->getValue(); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @param string $offset |
| 183 | 183 | * @param null|number|string $value |
| 184 | 184 | */ |
| 185 | - final public function offsetSet ($offset, $value): void { |
|
| 185 | + final public function offsetSet($offset, $value): void { |
|
| 186 | 186 | $this->data[$this->_toGid($offset)]->setValue($value); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -191,11 +191,11 @@ discard block |
||
| 191 | 191 | * |
| 192 | 192 | * @param string $offset |
| 193 | 193 | */ |
| 194 | - final public function offsetUnset ($offset): void { |
|
| 194 | + final public function offsetUnset($offset): void { |
|
| 195 | 195 | $this->offsetSet($offset, null); |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - public function toArray (bool $diff = false): array { |
|
| 198 | + public function toArray(bool $diff = false): array { |
|
| 199 | 199 | if ($diff) { |
| 200 | 200 | return array_map(function(FieldEntry $entry) { |
| 201 | 201 | return $entry->getValue(); |