@@ -126,7 +126,7 @@ |
||
| 126 | 126 | if (!array_key_exists('name', $type)) { |
| 127 | 127 | return false; |
| 128 | 128 | } |
| 129 | - $class = $type['name']; |
|
| 129 | + $class = $type[ 'name' ]; |
|
| 130 | 130 | if (!class_exists($class)) { |
| 131 | 131 | return false; |
| 132 | 132 | } |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @var Property[] |
| 42 | 42 | */ |
| 43 | - protected $properties = []; |
|
| 43 | + protected $properties = [ ]; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Связи с другими сущностями |
| 47 | 47 | * |
| 48 | 48 | * @var Association[] |
| 49 | 49 | */ |
| 50 | - protected $associations = []; |
|
| 50 | + protected $associations = [ ]; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Родительская сущность |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function addAssociation(Association $association) |
| 115 | 115 | { |
| 116 | - $this->associations[$association->getName()] = $association; |
|
| 116 | + $this->associations[ $association->getName() ] = $association; |
|
| 117 | 117 | |
| 118 | 118 | return $this; |
| 119 | 119 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $normalizeName = Inflector::camelize($property->getName()); |
| 141 | 141 | |
| 142 | - $this->properties[$normalizeName] = $property; |
|
| 142 | + $this->properties[ $normalizeName ] = $property; |
|
| 143 | 143 | |
| 144 | 144 | return $this; |
| 145 | 145 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | throw new Exception\InvalidArgumentException($errMsg); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - return $this->associations[$name]; |
|
| 185 | + return $this->associations[ $name ]; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /** |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | public function addEntity(EntityInterface $entity) |
| 78 | 78 | { |
| 79 | 79 | $this->index->indexEntity($entity); |
| 80 | - $this->entities[] = $entity; |
|
| 80 | + $this->entities[ ] = $entity; |
|
| 81 | 81 | |
| 82 | 82 | return $this; |
| 83 | 83 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * @var EntityInterface[] |
| 31 | 31 | */ |
| 32 | - protected $entities = []; |
|
| 32 | + protected $entities = [ ]; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Хранилище индексов |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function addEntity(EntityInterface $entity) |
| 59 | 59 | { |
| 60 | 60 | $this->index->indexEntity($entity); |
| 61 | - $this->entities[] = $entity; |
|
| 61 | + $this->entities[ ] = $entity; |
|
| 62 | 62 | |
| 63 | 63 | return $this; |
| 64 | 64 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * |
| 18 | 18 | * @var EntityInterface[] |
| 19 | 19 | */ |
| 20 | - protected $entities = []; |
|
| 20 | + protected $entities = [ ]; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Ключем является уровень вложеннесоти контейнера с данными, а значением массив контейнеров, расположенных на данном |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * @var array |
| 27 | 27 | */ |
| 28 | - protected $levelToEntities = []; |
|
| 28 | + protected $levelToEntities = [ ]; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Строит индекс для сущностей |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $level = $entity->getLevel(); |
| 40 | 40 | if (!array_key_exists($level, $this->levelToEntities)) { |
| 41 | - $this->levelToEntities[$level] = []; |
|
| 41 | + $this->levelToEntities[ $level ] = [ ]; |
|
| 42 | 42 | } |
| 43 | - $this->levelToEntities[$level][] = $entity; |
|
| 43 | + $this->levelToEntities[ $level ][ ] = $entity; |
|
| 44 | 44 | |
| 45 | - $this->entities[$entity->getId()] = $entity; |
|
| 45 | + $this->entities[ $entity->getId() ] = $entity; |
|
| 46 | 46 | return $this; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -71,6 +71,6 @@ discard block |
||
| 71 | 71 | throw new Exception\RuntimeException($errMsg); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - return $this->entities[$id]; |
|
| 74 | + return $this->entities[ $id ]; |
|
| 75 | 75 | } |
| 76 | 76 | } |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | */ |
| 125 | 125 | public function setLevel($level) |
| 126 | 126 | { |
| 127 | - $this->level = (integer)$level; |
|
| 127 | + $this->level = (integer) $level; |
|
| 128 | 128 | |
| 129 | 129 | return $this; |
| 130 | 130 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @var array |
| 46 | 46 | */ |
| 47 | - protected $itemNodeUuidToCacheData = []; |
|
| 47 | + protected $itemNodeUuidToCacheData = [ ]; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Имя атрибута для того что бы связать SimpleXMLElement и контейнер с данными |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $uuid = $this->getUuidAttribute($resource); |
| 89 | - return $this->itemNodeUuidToCacheData[$uuid]['dataContainer']; |
|
| 89 | + return $this->itemNodeUuidToCacheData[ $uuid ][ 'dataContainer' ]; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | $uuid = $this->getUuidAttribute($resource); |
| 108 | - return $this->itemNodeUuidToCacheData[$uuid]['entity']; |
|
| 108 | + return $this->itemNodeUuidToCacheData[ $uuid ][ 'entity' ]; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | if ($this->hasUuidAttribute($resource)) { |
| 125 | 125 | $uuid = $this->getUuidAttribute($resource); |
| 126 | 126 | if (array_key_exists($uuid, $this->itemNodeUuidToCacheData)) { |
| 127 | - return $this->itemNodeUuidToCacheData[$uuid]['dataContainer']; |
|
| 127 | + return $this->itemNodeUuidToCacheData[ $uuid ][ 'dataContainer' ]; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $currentUuid = $this->getUuidAttribute($itemNode); |
| 192 | 192 | |
| 193 | 193 | if (!array_key_exists($currentUuid, $this->itemNodeUuidToCacheData)) { |
| 194 | - $this->itemNodeUuidToCacheData[$currentUuid] = [ |
|
| 194 | + $this->itemNodeUuidToCacheData[ $currentUuid ] = [ |
|
| 195 | 195 | 'entity' => $entity, |
| 196 | 196 | 'dataContainer' => $dataContainer |
| 197 | 197 | ]; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $dataContainer->addEntity($entity); |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - $existingProperties = []; |
|
| 217 | + $existingProperties = [ ]; |
|
| 218 | 218 | foreach ($properties as $property) { |
| 219 | 219 | $propertyName = $property->getName(); |
| 220 | 220 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $errMsg = sprintf('Property %s already exists', $propertyName); |
| 223 | 223 | throw new Exception\RuntimeException($errMsg); |
| 224 | 224 | } |
| 225 | - $existingProperties[$propertyName] = $propertyName; |
|
| 225 | + $existingProperties[ $propertyName ] = $propertyName; |
|
| 226 | 226 | |
| 227 | 227 | $childElements = $property->xpath('./*'); |
| 228 | 228 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | $this->parseItem($newContext); |
| 248 | 248 | } else { |
| 249 | - $propertyValue = (string)$property; |
|
| 249 | + $propertyValue = (string) $property; |
|
| 250 | 250 | $property = new DataContainer\Property(); |
| 251 | 251 | $property |
| 252 | 252 | ->setName($propertyName) |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | { |
| 270 | 270 | $uuidAttribute = $this->getDefaultUuidAttribute(); |
| 271 | 271 | $attributesItemNode = $itemNode->attributes(); |
| 272 | - return isset($attributesItemNode[$uuidAttribute]); |
|
| 272 | + return isset($attributesItemNode[ $uuidAttribute ]); |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | $uuidAttribute = $this->getDefaultUuidAttribute(); |
| 292 | - return (string)$itemNode[$uuidAttribute]; |
|
| 292 | + return (string) $itemNode[ $uuidAttribute ]; |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - protected $finishedDataContainerId = []; |
|
| 49 | + protected $finishedDataContainerId = [ ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Constructor. |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | if (!array_key_exists($dataContainerId, $this->finishedDataContainerId)) { |
| 107 | 107 | $doctrineObjectEngine->import($dataContainer, $metadata->name, $objectManager); |
| 108 | 108 | $objectManager->flush(); |
| 109 | - $this->finishedDataContainerId[$dataContainerId] = $dataContainerId; |
|
| 109 | + $this->finishedDataContainerId[ $dataContainerId ] = $dataContainerId; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $entity = $data->getEntity(); |
@@ -35,14 +35,14 @@ |
||
| 35 | 35 | throw new Exception\RuntimeException($errMsg); |
| 36 | 36 | } |
| 37 | 37 | /** @var DataContainerInterface $dataContainer */ |
| 38 | - $dataContainer = $creationOptions['dataContainer']; |
|
| 38 | + $dataContainer = $creationOptions[ 'dataContainer' ]; |
|
| 39 | 39 | |
| 40 | 40 | if (!array_key_exists('entity', $creationOptions)) { |
| 41 | 41 | $errMsg = 'Entity not found in creation options'; |
| 42 | 42 | throw new Exception\RuntimeException($errMsg); |
| 43 | 43 | } |
| 44 | 44 | /** @var EntityInterface $entity */ |
| 45 | - $entity = $creationOptions['entity']; |
|
| 45 | + $entity = $creationOptions[ 'entity' ]; |
|
| 46 | 46 | |
| 47 | 47 | return new Data($dataContainer, $entity); |
| 48 | 48 | } |