@@ -56,7 +56,7 @@ |
||
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | 58 | foreach ($defaults as $property => $defaultValue) { |
| 59 | - $this->$property = (empty($values[$property])) ? $defaultValue: $values[$property]; |
|
| 59 | + $this->$property = (empty($values[$property])) ? $defaultValue : $values[$property]; |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $method = $pregMatches[1]; |
| 128 | - $property = strtolower(substr($pregMatches[2], 0, 1)).substr($pregMatches[2], 1); |
|
| 128 | + $property = strtolower(substr($pregMatches[2], 0, 1)) . substr($pregMatches[2], 1); |
|
| 129 | 129 | $collectionProperties = null; |
| 130 | 130 | if (in_array($method, array('add', 'remove'))) { |
| 131 | 131 | $collectionProperties = $this->_collectionsItemNames['byItemName'][$property]; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $oldValue = null; |
| 145 | 145 | $newValue = null; |
| 146 | 146 | |
| 147 | - switch($method) { |
|
| 147 | + switch ($method) { |
|
| 148 | 148 | case 'get': |
| 149 | 149 | case 'is': |
| 150 | 150 | return $this->$property; |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | && !(empty($association)) |
| 160 | 160 | ) { |
| 161 | 161 | $itemName = $this->_collectionsItemNames['byProperty'][$property]['itemName']; |
| 162 | - $propertyAddMethod = 'add'.strtoupper(substr($itemName, 0, 1)).substr($itemName, 1); |
|
| 163 | - $propertyRemoveMethod = 'remove'.strtoupper(substr($itemName, 0, 1)).substr($itemName, 1); |
|
| 162 | + $propertyAddMethod = 'add' . strtoupper(substr($itemName, 0, 1)) . substr($itemName, 1); |
|
| 163 | + $propertyRemoveMethod = 'remove' . strtoupper(substr($itemName, 0, 1)) . substr($itemName, 1); |
|
| 164 | 164 | |
| 165 | 165 | foreach ($this->$property as $item) { |
| 166 | 166 | $this->$propertyRemoveMethod($item); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | foreach ($constraintsViolations as $violation) { |
| 248 | 248 | $errorMessageList[] = $violation->getMessage(); |
| 249 | 249 | } |
| 250 | - $errorMessage .= implode("\", \n\"", $errorMessageList)."\"."; |
|
| 250 | + $errorMessage .= implode("\", \n\"", $errorMessageList) . "\"."; |
|
| 251 | 251 | |
| 252 | 252 | throw new \InvalidArgumentException($errorMessage); |
| 253 | 253 | } |
@@ -271,16 +271,16 @@ discard block |
||
| 271 | 271 | $this->_associationsList = AssociationReader::getAssociations($this); |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | - $oldValue = empty($values['oldValue']) ? null: $values['oldValue']; |
|
| 275 | - $newValue = empty($values['newValue']) ? null: $values['newValue']; |
|
| 274 | + $oldValue = empty($values['oldValue']) ? null : $values['oldValue']; |
|
| 275 | + $newValue = empty($values['newValue']) ? null : $values['newValue']; |
|
| 276 | 276 | |
| 277 | 277 | $association = $this->_associationsList[$property]; |
| 278 | 278 | if (!empty($association)) { |
| 279 | 279 | $associatedProperty = $association['property']; |
| 280 | 280 | switch ($association['association']) { |
| 281 | 281 | case 'inverted': |
| 282 | - $invertedGetMethod = 'get'.strtoupper(substr($associatedProperty, 0, 1)).substr($associatedProperty, 1); |
|
| 283 | - $invertedSetMethod = 'set'.strtoupper(substr($associatedProperty, 0, 1)).substr($associatedProperty, 1); |
|
| 282 | + $invertedGetMethod = 'get' . strtoupper(substr($associatedProperty, 0, 1)) . substr($associatedProperty, 1); |
|
| 283 | + $invertedSetMethod = 'set' . strtoupper(substr($associatedProperty, 0, 1)) . substr($associatedProperty, 1); |
|
| 284 | 284 | if ($oldValue !== null && $oldValue->$invertedGetMethod() === $this) { |
| 285 | 285 | $oldValue->$invertedSetMethod(null); |
| 286 | 286 | } |
@@ -291,9 +291,9 @@ discard block |
||
| 291 | 291 | |
| 292 | 292 | case 'mapped': |
| 293 | 293 | $itemName = $association['itemName']; |
| 294 | - $mappedGetMethod = 'get'.strtoupper(substr($associatedProperty, 0, 1)).substr($associatedProperty, 1); |
|
| 295 | - $mappedAddMethod = 'add'.strtoupper(substr($itemName, 0, 1)).substr($itemName, 1); |
|
| 296 | - $mappedRemoveMethod = 'remove'.strtoupper(substr($itemName, 0, 1)).substr($itemName, 1); |
|
| 294 | + $mappedGetMethod = 'get' . strtoupper(substr($associatedProperty, 0, 1)) . substr($associatedProperty, 1); |
|
| 295 | + $mappedAddMethod = 'add' . strtoupper(substr($itemName, 0, 1)) . substr($itemName, 1); |
|
| 296 | + $mappedRemoveMethod = 'remove' . strtoupper(substr($itemName, 0, 1)) . substr($itemName, 1); |
|
| 297 | 297 | |
| 298 | 298 | if ($oldValue !== null && CollectionManager::collectionContains($this, $oldValue->$mappedGetMethod())) { |
| 299 | 299 | $oldValue->$mappedRemoveMethod($this); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | array_reverse($objectClasses); |
| 36 | 36 | |
| 37 | 37 | $annotationReader = Configuration::getAnnotationReader(); |
| 38 | - foreach($objectClasses as $class) { |
|
| 38 | + foreach ($objectClasses as $class) { |
|
| 39 | 39 | foreach ($class->getProperties() as $property) { |
| 40 | 40 | $propertyName = $property->getName(); |
| 41 | 41 | $annotation = null; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $parentClass = $reflectionObject->getParentClass(); |
| 38 | - while($parentClass) { |
|
| 38 | + while ($parentClass) { |
|
| 39 | 39 | $objectClasses[] = $parentClass; |
| 40 | 40 | |
| 41 | 41 | $parentTraits = $parentClass->getTraits(); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | array_reverse($objectClasses); |
| 36 | 36 | |
| 37 | 37 | $annotationReader = Configuration::getAnnotationReader(); |
| 38 | - foreach($objectClasses as $class) { |
|
| 38 | + foreach ($objectClasses as $class) { |
|
| 39 | 39 | foreach ($class->getProperties() as $property) { |
| 40 | 40 | $propertyName = $property->getName(); |
| 41 | 41 | $annotation = null; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | array_reverse($objectClasses); |
| 36 | 36 | |
| 37 | 37 | $annotationReader = Configuration::getAnnotationReader(); |
| 38 | - foreach($objectClasses as $class) { |
|
| 38 | + foreach ($objectClasses as $class) { |
|
| 39 | 39 | foreach ($class->getProperties() as $property) { |
| 40 | 40 | $propertyName = $property->getName(); |
| 41 | 41 | $annotation = null; |