Completed
Push — master ( 2a6740...c8e4a8 )
by Gaetano
11:00
created
Core/MigrationService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Core/ComplexField/EzBinaryFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
Core/ComplexField/EzAuthor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Core/DefinitionParser/YamlDefinitionParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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));
Please login to merge, or discard this patch.
Core/ReferenceResolver/ContentResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
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::':
Please login to merge, or discard this patch.
Core/ReferenceResolver/AbstractResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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));
Please login to merge, or discard this patch.
Core/Helper/RoleHandler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Core/ReferenceResolver/LocationResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
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::':
Please login to merge, or discard this patch.
Core/Executor/RoleManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
         if (array_key_exists('policies', $this->dsl)) {
44 44
             $ymlPolicies = $this->dsl['policies'];
45
-            foreach($ymlPolicies as $key => $ymlPolicy) {
45
+            foreach ($ymlPolicies as $key => $ymlPolicy) {
46 46
                 $this->addPolicy($role, $roleService, $ymlPolicy);
47 47
             }
48 48
         }
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
                 // Removing all policies so we can add them back.
83 83
                 // TODO: Check and update policies instead of remove and add.
84 84
                 $policies = $role->getPolicies();
85
-                foreach($policies as $policy) {
85
+                foreach ($policies as $policy) {
86 86
                     $roleService->deletePolicy($policy);
87 87
                 }
88 88
 
89
-                foreach($ymlPolicies as $key => $ymlPolicy) {
89
+                foreach ($ymlPolicies as $key => $ymlPolicy) {
90 90
                     $this->addPolicy($role, $roleService, $ymlPolicy);
91 91
                 }
92 92
             }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
         $limitationValue = is_array($limitation['values']) ? $limitation['values'] : array($limitation['values']);
177 177
 
178
-        foreach($limitationValue as $id => $value) {
178
+        foreach ($limitationValue as $id => $value) {
179 179
             if ($this->referenceResolver->isReference($value)) {
180 180
                 $value = $this->referenceResolver->getReferenceValue($value);
181 181
                 $limitationValue[$id] = $value;
Please login to merge, or discard this patch.