@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $this->dbHandler = $this->container->get('ezpublish.connection'); |
| 37 | 37 | |
| 38 | 38 | $this->activeBundles = array(); |
| 39 | - foreach($this->container->get('kernel')->getBundles() as $bundle) |
|
| 39 | + foreach ($this->container->get('kernel')->getBundles() as $bundle) |
|
| 40 | 40 | { |
| 41 | 41 | $this->activeBundles[$bundle->getName()] = $bundle->getPath(); |
| 42 | 42 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | // we need to decide of a random time to stamp existing migrations. We use 'now - 1 minute'... |
| 59 | 59 | $executionDate = time() - 60; |
| 60 | - foreach($toMigrate as $legacyMigration) { |
|
| 60 | + foreach ($toMigrate as $legacyMigration) { |
|
| 61 | 61 | $name = $legacyMigration['version']; |
| 62 | 62 | |
| 63 | 63 | $path = $this->getLegacyMigrationDefinition($legacyMigration['version'], $legacyMigration['bundle']); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | /** @var \Doctrine\DBAL\Schema\AbstractSchemaManager $sm */ |
| 106 | 106 | $sm = $this->dbHandler->getConnection()->getSchemaManager(); |
| 107 | - foreach($sm->listTables() as $table) { |
|
| 107 | + foreach ($sm->listTables() as $table) { |
|
| 108 | 108 | if ($table->getName() == $tableName) { |
| 109 | 109 | return true; |
| 110 | 110 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | return false; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - foreach($versionDefinitions as $key => $versionDefinition) { |
|
| 154 | + foreach ($versionDefinitions as $key => $versionDefinition) { |
|
| 155 | 155 | if (!in_array(pathinfo($versionDefinition, PATHINFO_EXTENSION), array('php', 'yml', 'sql'))) { |
| 156 | 156 | unset($versionDefinitions[$key]); |
| 157 | 157 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $this->dsl['user_id'] = array($this->dsl['user_id']); |
| 133 | 133 | } |
| 134 | 134 | foreach ($this->dsl['user_id'] as $id) { |
| 135 | - array_push($usersToDelete,$userService->loadUser($id)); |
|
| 135 | + array_push($usersToDelete, $userService->loadUser($id)); |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | if (isset($this->dsl['email'])) { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $this->dsl['email'] = array($this->dsl['email']); |
| 141 | 141 | } |
| 142 | 142 | foreach ($this->dsl['email'] as $email) { |
| 143 | - $usersToDelete = array_merge($usersToDelete,$userService->loadUsersByEmail($email)); |
|
| 143 | + $usersToDelete = array_merge($usersToDelete, $userService->loadUsersByEmail($email)); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | if (isset($this->dsl['username'])) { |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | $this->dsl['username'] = array($this->dsl['username']); |
| 149 | 149 | } |
| 150 | 150 | foreach ($this->dsl['username'] as $username) { |
| 151 | - array_push($usersToDelete,$userService->loadUserByLogin($username)); |
|
| 151 | + array_push($usersToDelete, $userService->loadUserByLogin($username)); |
|
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - foreach($usersToDelete as $user){ |
|
| 155 | + foreach ($usersToDelete as $user) { |
|
| 156 | 156 | $userService->deleteUser($user); |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected $tagService; |
| 14 | 14 | |
| 15 | - public function __construct(TagsService $tagService=null) |
|
| 15 | + public function __construct(TagsService $tagService = null) |
|
| 16 | 16 | { |
| 17 | 17 | $this->tagService = $tagService; |
| 18 | 18 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $draft = $contentService->createContentDraft($contentInfo); |
| 128 | - $contentService->updateContent($draft->versionInfo,$contentUpdateStruct); |
|
| 128 | + $contentService->updateContent($draft->versionInfo, $contentUpdateStruct); |
|
| 129 | 129 | $content = $contentService->publishVersion($draft->versionInfo); |
| 130 | 130 | |
| 131 | 131 | if (array_key_exists('new_remote_id', $this->dsl)) { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | $contentService = $this->repository->getContentService(); |
| 160 | 160 | |
| 161 | - if (isset($this->dsl['object_id'])){ |
|
| 161 | + if (isset($this->dsl['object_id'])) { |
|
| 162 | 162 | if (!is_array($this->dsl['object_id'])) { |
| 163 | 163 | $this->dsl['object_id'] = array($this->dsl['object_id']); |
| 164 | 164 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * @param ContentCreateStruct $createStruct |
| 187 | 187 | * @param array $fields |
| 188 | 188 | */ |
| 189 | - protected function setFields(ContentCreateStruct &$createStruct, array $fields) |
|
| 189 | + protected function setFields(ContentCreateStruct & $createStruct, array $fields) |
|
| 190 | 190 | { |
| 191 | 191 | foreach ($fields as $field) { |
| 192 | 192 | // each $field is one key value pair |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | * @param ContentUpdateStruct $updateStruct |
| 215 | 215 | * @param array $fields |
| 216 | 216 | */ |
| 217 | - protected function setFieldsToUpdate(ContentUpdateStruct &$updateStruct, array $fields, ContentType $contentType) |
|
| 217 | + protected function setFieldsToUpdate(ContentUpdateStruct & $updateStruct, array $fields, ContentType $contentType) |
|
| 218 | 218 | { |
| 219 | 219 | foreach ($fields as $field) { |
| 220 | 220 | // each $field is one key value pair |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | $groupIds = array($groupIds); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - foreach($groupIds as $groupId) { |
|
| 132 | + foreach ($groupIds as $groupId) { |
|
| 133 | 133 | $userGroup = $userService->loadUserGroup($groupId); |
| 134 | 134 | $userService->deleteUserGroup($userGroup); |
| 135 | 135 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | if (empty($paths)) { |
| 58 | 58 | $paths = array(); |
| 59 | 59 | /** @var $bundle \Symfony\Component\HttpKernel\Bundle\BundleInterface */ |
| 60 | - foreach($this->kernel->getBundles() as $bundle) |
|
| 60 | + foreach ($this->kernel->getBundles() as $bundle) |
|
| 61 | 61 | { |
| 62 | 62 | $path = $bundle->getPath() . "/" . $this->versionDirectory; |
| 63 | 63 | if (is_dir($path)) { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $definitions = array(); |
| 70 | - foreach($paths as $path) { |
|
| 70 | + foreach ($paths as $path) { |
|
| 71 | 71 | if (is_file($path)) { |
| 72 | 72 | $definitions[basename($path)] = $returnFilename ? $path : new MigrationDefinition( |
| 73 | 73 | basename($path), |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function addExecutor(ExecutorInterface $executor) |
| 45 | 45 | { |
| 46 | - foreach($executor->supportedTypes() as $type) { |
|
| 46 | + foreach ($executor->supportedTypes() as $type) { |
|
| 47 | 47 | $this->executors[$type] = $executor; |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | // we try to be flexible in file types we support, and the same time avoid loading all files in a directory |
| 60 | 60 | $handledDefinitions = array(); |
| 61 | - foreach($this->loader->listAvailableDefinitions($paths) as $migrationName => $definitionPath) { |
|
| 62 | - foreach($this->DefinitionParsers as $definitionParser) { |
|
| 61 | + foreach ($this->loader->listAvailableDefinitions($paths) as $migrationName => $definitionPath) { |
|
| 62 | + foreach ($this->DefinitionParsers as $definitionParser) { |
|
| 63 | 63 | if ($definitionParser->supports($migrationName)) { |
| 64 | 64 | $handledDefinitions[] = $definitionPath; |
| 65 | 65 | } |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function parseMigrationDefinition(MigrationDefinition $migrationDefinition) |
| 108 | 108 | { |
| 109 | - foreach($this->DefinitionParsers as $definitionParser) { |
|
| 109 | + foreach ($this->DefinitionParsers as $definitionParser) { |
|
| 110 | 110 | if ($definitionParser->supports($migrationDefinition->name)) { |
| 111 | 111 | // parse the source file |
| 112 | 112 | $migrationDefinition = $definitionParser->parseMigrationDefinition($migrationDefinition); |
| 113 | 113 | |
| 114 | 114 | // and make sure we know how to handle all steps |
| 115 | - foreach($migrationDefinition->steps as $step) { |
|
| 115 | + foreach ($migrationDefinition->steps as $step) { |
|
| 116 | 116 | if (!isset($this->executors[$step->type])) { |
| 117 | 117 | return new MigrationDefinition( |
| 118 | 118 | $migrationDefinition->name, |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $this->repository->beginTransaction(); |
| 155 | 155 | try { |
| 156 | 156 | |
| 157 | - foreach($migrationDefinition->steps as $step) { |
|
| 157 | + foreach ($migrationDefinition->steps as $step) { |
|
| 158 | 158 | // we validated the fact that we have a good executor at parsing time |
| 159 | 159 | $executor = $this->executors[$step->type]; |
| 160 | 160 | $executor->execute($step); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | $this->repository->commit(); |
| 175 | 175 | |
| 176 | - } catch(\Exception $e) { |
|
| 176 | + } catch (\Exception $e) { |
|
| 177 | 177 | $this->repository->rollBack(); |
| 178 | 178 | |
| 179 | 179 | /// set migration as failed |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public function createValue(array $fieldValueArray, array $context = array()) |
| 16 | 16 | { |
| 17 | - $filePath = dirname($context['path']) . '/files/' . $fieldValueArray['path']; |
|
| 17 | + $filePath = dirname($context['path']) . '/files/' . $fieldValueArray['path']; |
|
| 18 | 18 | |
| 19 | 19 | return new BinaryFileValue( |
| 20 | 20 | array( |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function createValue(array $fieldValueArray, array $context = array()) |
| 20 | 20 | { |
| 21 | 21 | $authors = array(); |
| 22 | - foreach($fieldValueArray['authors'] as $author) { |
|
| 22 | + foreach ($fieldValueArray['authors'] as $author) { |
|
| 23 | 23 | $authors[] = new Author($author); |
| 24 | 24 | } |
| 25 | 25 | |