@@ -114,6 +114,9 @@ |
||
| 114 | 114 | return $this->spaces[$id]; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | + /** |
|
| 118 | + * @param string $name |
|
| 119 | + */ |
|
| 117 | 120 | public function getSpaceId($name) |
| 118 | 121 | { |
| 119 | 122 | if (!$this->hasSpace($name)) { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | public function formatValue($type, $value) |
| 72 | 72 | { |
| 73 | - if(is_null($value)) { |
|
| 73 | + if (is_null($value)) { |
|
| 74 | 74 | return null; |
| 75 | 75 | } |
| 76 | 76 | switch ($type) { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | public function once($name, $callback) |
| 139 | 139 | { |
| 140 | - $key = 'once' . $name; |
|
| 140 | + $key = 'once'.$name; |
|
| 141 | 141 | |
| 142 | 142 | $rows = $this->mapper->find('_schema', ['key' => $key]); |
| 143 | 143 | if (!count($rows)) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function isPropertyNullable($name) |
| 61 | 61 | { |
| 62 | - foreach($this->getFormat() as $field) { |
|
| 62 | + foreach ($this->getFormat() as $field) { |
|
| 63 | 63 | if ($field['name'] == $name) { |
| 64 | 64 | return array_key_exists('is_nullable', $field) ? $field['is_nullable'] : false; |
| 65 | 65 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if (!$this->getPropertyType($property)) { |
| 147 | 147 | throw new Exception("Unknown property $property", 1); |
| 148 | 148 | } |
| 149 | - $options['parts'][] = $this->getPropertyIndex($property)+1; |
|
| 149 | + $options['parts'][] = $this->getPropertyIndex($property) + 1; |
|
| 150 | 150 | $options['parts'][] = $this->getPropertyType($property); |
| 151 | 151 | $this->setPropertyNullable($property, false); |
| 152 | 152 | } |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | break; |
| 358 | 358 | } |
| 359 | 359 | $value = $this->mapper->getSchema()->formatValue($part[1], $params[$name]); |
| 360 | - if(is_null($value) && !$this->isPropertyNullable($name)) { |
|
| 360 | + if (is_null($value) && !$this->isPropertyNullable($name)) { |
|
| 361 | 361 | $value = $this->mapper->getSchema()->getDefaultValue($format[$part[0]]['type']); |
| 362 | 362 | } |
| 363 | 363 | $values[] = $value; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function __call($name, $arguments) |
| 27 | 27 | { |
| 28 | - throw new BadMethodCallException("Call to undefined method ". get_class($this).'::'.$name); |
|
| 28 | + throw new BadMethodCallException("Call to undefined method ".get_class($this).'::'.$name); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function __debugInfo() |
@@ -427,7 +427,7 @@ |
||
| 427 | 427 | |
| 428 | 428 | foreach ($this->space->getFormat() as $index => $info) { |
| 429 | 429 | $name = $info['name']; |
| 430 | - if(!property_exists($instance, $name)) { |
|
| 430 | + if (!property_exists($instance, $name)) { |
|
| 431 | 431 | $instance->$name = null; |
| 432 | 432 | } |
| 433 | 433 | |