| @@ -76,6 +76,9 @@ discard block | ||
| 76 | 76 | } | 
| 77 | 77 | } | 
| 78 | 78 | |
| 79 | + /** | |
| 80 | + * @param string $name | |
| 81 | + */ | |
| 79 | 82 |    private function getPhysicalPropertyName($name) { | 
| 80 | 83 | return '_' . $name; | 
| 81 | 84 | } | 
| @@ -146,6 +149,9 @@ discard block | ||
| 146 | 149 | return $this->propertyMethodResult($name, $diff, 'delta'); | 
| 147 | 150 | } | 
| 148 | 151 | |
| 152 | + /** | |
| 153 | + * @param string $action | |
| 154 | + */ | |
| 149 | 155 |    protected function actionProperty($action, $name, $value) { | 
| 150 | 156 | $result = null; | 
| 151 | 157 | // Now deciding - will we call a protected setter or will we work with protected property | 
| @@ -66,18 +66,18 @@ discard block | ||
| 66 | 66 | |
| 67 | 67 |    protected function checkPropertyExists($name) { | 
| 68 | 68 |      if (!array_key_exists($name, static::$_properties)) { | 
| 69 | -      throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] not exists', ERR_ERROR); | |
| 69 | +      throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] not exists', ERR_ERROR); | |
| 70 | 70 | } | 
| 71 | 71 | } | 
| 72 | 72 | |
| 73 | 73 |    protected function checkOverwriteAdjusted($name) { | 
| 74 | 74 |      if (array_key_exists($name, $this->propertiesAdjusted)) { | 
| 75 | -      throw new PropertyAccessException('Property [' . get_called_class() . '::' . $name . '] already was adjusted so no SET is possible until dbSave', ERR_ERROR); | |
| 75 | +      throw new PropertyAccessException('Property ['.get_called_class().'::'.$name.'] already was adjusted so no SET is possible until dbSave', ERR_ERROR); | |
| 76 | 76 | } | 
| 77 | 77 | } | 
| 78 | 78 | |
| 79 | 79 |    private function getPhysicalPropertyName($name) { | 
| 80 | - return '_' . $name; | |
| 80 | + return '_'.$name; | |
| 81 | 81 | } | 
| 82 | 82 | |
| 83 | 83 | /** | 
| @@ -149,15 +149,15 @@ discard block | ||
| 149 | 149 |    protected function actionProperty($action, $name, $value) { | 
| 150 | 150 | $result = null; | 
| 151 | 151 | // Now deciding - will we call a protected setter or will we work with protected property | 
| 152 | -    if (method_exists($this, $methodName = $action . ucfirst($name))) { | |
| 152 | +    if (method_exists($this, $methodName = $action.ucfirst($name))) { | |
| 153 | 153 | // If method exists - just calling it | 
| 154 | 154 | // TODO - should return TRUE if value changed or FALSE otherwise | 
| 155 | 155 | $result = call_user_func_array(array($this, $methodName), array($value)); | 
| 156 | 156 |      } elseif ($this->isPropertyActionAvailable($name, $action)) { | 
| 157 | 157 | // No setter exists - works directly with protected property | 
| 158 | -      $result = $this->{$action . 'Property'}($name, $value); | |
| 158 | +      $result = $this->{$action.'Property'}($name, $value); | |
| 159 | 159 |      } else { | 
| 160 | -      throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] does not have ' . $action . 'ter/property to ' . $action, ERR_ERROR); | |
| 160 | +      throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] does not have '.$action.'ter/property to '.$action, ERR_ERROR); | |
| 161 | 161 | } | 
| 162 | 162 | |
| 163 | 163 | return $result; | 
| @@ -248,7 +248,7 @@ discard block | ||
| 248 | 248 | * @return string | 
| 249 | 249 | */ | 
| 250 | 250 |    protected function adjustPropertyString($name, $diff) { | 
| 251 | - return (string)$this->$name . (string)$diff; | |
| 251 | + return (string) $this->$name.(string) $diff; | |
| 252 | 252 | } | 
| 253 | 253 | |
| 254 | 254 | /** | 
| @@ -258,8 +258,8 @@ discard block | ||
| 258 | 258 | * @return array | 
| 259 | 259 | */ | 
| 260 | 260 |    protected function adjustPropertyArray($name, $diff) { | 
| 261 | - $copy = (array)$this->$name; | |
| 262 | - HelperArray::merge($copy, (array)$diff, HelperArray::MERGE_PHP); | |
| 261 | + $copy = (array) $this->$name; | |
| 262 | + HelperArray::merge($copy, (array) $diff, HelperArray::MERGE_PHP); | |
| 263 | 263 | |
| 264 | 264 | return $copy; | 
| 265 | 265 | } | 
| @@ -271,7 +271,7 @@ discard block | ||
| 271 | 271 | * @return int | 
| 272 | 272 | */ | 
| 273 | 273 |    protected function deltaInteger($name, $diff) { | 
| 274 | - return (int)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int)$diff; | |
| 274 | + return (int) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int) $diff; | |
| 275 | 275 | } | 
| 276 | 276 | |
| 277 | 277 | /** | 
| @@ -281,7 +281,7 @@ discard block | ||
| 281 | 281 | * @return float | 
| 282 | 282 | */ | 
| 283 | 283 |    protected function deltaDouble($name, $diff) { | 
| 284 | - return (float)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float)$diff; | |
| 284 | + return (float) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float) $diff; | |
| 285 | 285 | } | 
| 286 | 286 | |
| 287 | 287 | /** | 
| @@ -291,7 +291,7 @@ discard block | ||
| 291 | 291 | * @return string | 
| 292 | 292 | */ | 
| 293 | 293 |    protected function deltaString($name, $diff) { | 
| 294 | - return (string)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '') . (string)$diff; | |
| 294 | + return (string) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '').(string) $diff; | |
| 295 | 295 | } | 
| 296 | 296 | |
| 297 | 297 | /** | 
| @@ -301,7 +301,7 @@ discard block | ||
| 301 | 301 | * @return array | 
| 302 | 302 | */ | 
| 303 | 303 |    protected function deltaArray($name, $diff) { | 
| 304 | - $copy = (array)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array()); | |
| 304 | + $copy = (array) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array()); | |
| 305 | 305 | HelperArray::merge($copy, $diff, HelperArray::MERGE_PHP); | 
| 306 | 306 | |
| 307 | 307 | return $copy; | 
| @@ -326,7 +326,7 @@ discard block | ||
| 326 | 326 | array_walk($type, 'DbSqlHelper::UCFirstByRef'); | 
| 327 | 327 |      $type = implode('', $type); | 
| 328 | 328 | |
| 329 | -    if (!method_exists($this, $methodName = $prefix . $type)) { | |
| 329 | +    if (!method_exists($this, $methodName = $prefix.$type)) { | |
| 330 | 330 | throw new ExceptionTypeUnsupported(); | 
| 331 | 331 | } | 
| 332 | 332 | |