@@ -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), |
@@ -85,8 +85,7 @@ |
||
85 | 85 | ); |
86 | 86 | } |
87 | 87 | } |
88 | - } |
|
89 | - else { |
|
88 | + } else { |
|
90 | 89 | throw new \Exception("Path '$path' is neither a file nor directory"); |
91 | 90 | } |
92 | 91 | } |
@@ -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 |
@@ -32,8 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $fieldService = $this->fieldTypeMap[$fieldTypeIdentifier]; |
34 | 34 | return $fieldService->createValue($fieldValueArray, $context); |
35 | - } |
|
36 | - else |
|
35 | + } else |
|
37 | 36 | { |
38 | 37 | throw new \InvalidArgumentException("Field of type '$fieldTypeIdentifier' can not be handled as it does not have a complex field class defined"); |
39 | 38 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | try { |
43 | 43 | $data = Yaml::parse($definition->rawDefinition); |
44 | - } catch(\Exception $e) { |
|
44 | + } catch (\Exception $e) { |
|
45 | 45 | return new MigrationDefinition( |
46 | 46 | $definition->name, |
47 | 47 | $definition->path, |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $status = MigrationDefinition::STATUS_INVALID; |
63 | 63 | $message = "Yaml migration file '{$definition->path}' must contain an array as top element"; |
64 | 64 | } else { |
65 | - foreach($data as $i => $stepDef) { |
|
65 | + foreach ($data as $i => $stepDef) { |
|
66 | 66 | if (!isset($stepDef['type']) || !is_string($stepDef['type'])) { |
67 | 67 | $status = MigrationDefinition::STATUS_INVALID; |
68 | 68 | $message = "Yaml migration file '{$definition->path}' misses or has a non-string 'type' element in step $i"; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | $stepDefs = array(); |
87 | - foreach($data as $stepDef) { |
|
87 | + foreach ($data as $stepDef) { |
|
88 | 88 | $type = $stepDef['type']; |
89 | 89 | unset($stepDef['type']); |
90 | 90 | $stepDefs[] = new MigrationStep($type, $stepDef, array('path' => $definition->path)); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function getReferenceValue($stringIdentifier) |
35 | 35 | { |
36 | 36 | $ref = $this->getReferenceIdentifierByPrefix($stringIdentifier); |
37 | - switch($ref['prefix']) { |
|
37 | + switch ($ref['prefix']) { |
|
38 | 38 | case 'content_remote_id:': |
39 | 39 | return $this->repository->getContentService()->loadContentByRemoteId($ref['identifier'])->id; |
40 | 40 | //case 'content_id::': |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | public function __construct() |
16 | 16 | { |
17 | 17 | $quotedPrefixes = []; |
18 | - foreach($this->referencePrefixes as $prefix) { |
|
18 | + foreach ($this->referencePrefixes as $prefix) { |
|
19 | 19 | $quotedPrefixes[] = preg_quote($prefix, '/'); |
20 | 20 | } |
21 | 21 | $this->prefixMatchRegexp = '/^(' . implode('|', $quotedPrefixes) . ')/'; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | protected function getReferenceIdentifierByPrefix($stringIdentifier) |
57 | 57 | { |
58 | - foreach($this->referencePrefixes as $prefix) { |
|
58 | + foreach ($this->referencePrefixes as $prefix) { |
|
59 | 59 | $regexp = '/^' . preg_quote($prefix, '/') . '/'; |
60 | 60 | if (preg_match($regexp, $stringIdentifier)) { |
61 | 61 | return array('prefix' => $prefix, 'identifier' => preg_replace($regexp, '', $stringIdentifier)); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | break; |
58 | 58 | case 'SiteAccess': |
59 | - foreach($values as $value) { |
|
59 | + foreach ($values as $value) { |
|
60 | 60 | $name = "No Site Access Found"; |
61 | 61 | if (array_key_exists($value, $this->siteAccessList)) { |
62 | 62 | $name = $this->siteAccessList[$value]; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $availableLanguages = $this->translationHelper->getAvailableLanguages(); |
72 | 72 | $primaryLanguage = $availableLanguages[0]; |
73 | 73 | |
74 | - foreach($values as $value) { |
|
74 | + foreach ($values as $value) { |
|
75 | 75 | $contentType = $contentTypeService->loadContentType($value); |
76 | 76 | $retValues[] = $contentType->identifier; |
77 | 77 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | break; |
125 | 125 | case 'SiteAccess': |
126 | - foreach($values as $value) { |
|
126 | + foreach ($values as $value) { |
|
127 | 127 | foreach ($this->siteAccessList as $key => $siteAccess) { |
128 | 128 | if ($value == $siteAccess) { |
129 | 129 | $retValues[] = (string)$key; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | /** @var \eZ\Publish\API\Repository\ContentTypeService $contentTypeService */ |
137 | 137 | $contentTypeService = $this->repository->getContentTypeService(); |
138 | 138 | |
139 | - foreach($values as $value) { |
|
139 | + foreach ($values as $value) { |
|
140 | 140 | $contentTypeId = $value; |
141 | 141 | if (!is_int($value)) { |
142 | 142 | $contentType = $contentTypeService->loadContentTypeByIdentifier($value); |