@@ -44,12 +44,12 @@ |
||
| 44 | 44 | return array( |
| 45 | 45 | new ExpressionFunction( |
| 46 | 46 | 'resolve', |
| 47 | - function ($str) { |
|
| 47 | + function($str) { |
|
| 48 | 48 | /// @todo we could implement this via eg a static class var which holds a pointer to $this->referenceResolver |
| 49 | 49 | //return sprintf('(is_string(%1$s) ? FakerResolver::resolveExpressionLanguageReference(%1$s) : %1$s)', $str); |
| 50 | 50 | return "throw new \Exception('The \'resolve\' expression language operator can not be compiled, only evaluated'"; |
| 51 | 51 | }, |
| 52 | - function ($arguments, $str) use ($resolver) { |
|
| 52 | + function($arguments, $str) use ($resolver) { |
|
| 53 | 53 | if (!is_string($str)) { |
| 54 | 54 | return $str; |
| 55 | 55 | } |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | $refs = array(); |
| 132 | 132 | |
| 133 | 133 | foreach ($this->resolvers as $resolver) { |
| 134 | - if (! $resolver instanceof EnumerableReferenceResolverInterface) { |
|
| 134 | + if (!$resolver instanceof EnumerableReferenceResolverInterface) { |
|
| 135 | 135 | // Disabled - we now allow chaining enumerable and non-enumerable sets |
| 136 | 136 | //throw new \Exception("Could not enumerate references because of chained resolver of type: " . get_class($resolver)); |
| 137 | 137 | continue; |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | |
| 85 | 85 | $args = $dsl['arguments']; |
| 86 | 86 | |
| 87 | - foreach($args as &$val) { |
|
| 87 | + foreach ($args as &$val) { |
|
| 88 | 88 | $val = $this->resolveReferencesRecursively($val); |
| 89 | 89 | } |
| 90 | 90 | } else { |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | $body = isset($dsl['body']) ? $this->resolveReferencesInText($dsl['body']) : null; |
| 76 | 76 | |
| 77 | 77 | if (isset($dsl['client'])) { |
| 78 | - $client = $this->container->get('httplug.client.'.$this->referenceResolver->resolveReference($dsl['client'])); |
|
| 78 | + $client = $this->container->get('httplug.client.' . $this->referenceResolver->resolveReference($dsl['client'])); |
|
| 79 | 79 | } else { |
| 80 | 80 | $client = $this->container->get('httplug.client'); |
| 81 | 81 | } |
@@ -99,14 +99,14 @@ discard block |
||
| 99 | 99 | $subStep = new MigrationStep($type, $stepDef, array_merge($context, array())); |
| 100 | 100 | try { |
| 101 | 101 | $result = $stepExecutors[$j]->execute($subStep); |
| 102 | - } catch(MigrationStepSkippedException $e) { |
|
| 102 | + } catch (MigrationStepSkippedException $e) { |
|
| 103 | 103 | // all ok, continue the loop |
| 104 | - } catch(LoopContinueException $e) { |
|
| 104 | + } catch (LoopContinueException $e) { |
|
| 105 | 105 | // all ok, move to the next iteration |
| 106 | 106 | break; |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | - } catch(LoopBreakException $e) { |
|
| 109 | + } catch (LoopBreakException $e) { |
|
| 110 | 110 | // all ok, exit the loop |
| 111 | 111 | break; |
| 112 | 112 | } |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | $subStep = new MigrationStep($type, $stepDef, array_merge($context, array())); |
| 136 | 136 | try { |
| 137 | 137 | $result = $stepExecutors[$j]->execute($subStep); |
| 138 | - } catch(MigrationStepSkippedException $e) { |
|
| 138 | + } catch (MigrationStepSkippedException $e) { |
|
| 139 | 139 | // all ok, continue the loop |
| 140 | - } catch(LoopContinueException $e) { |
|
| 140 | + } catch (LoopContinueException $e) { |
|
| 141 | 141 | // all ok, move to the next iteration |
| 142 | 142 | break; |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | - } catch(LoopBreakException $e) { |
|
| 145 | + } catch (LoopBreakException $e) { |
|
| 146 | 146 | // all ok, exit the loop |
| 147 | 147 | break; |
| 148 | 148 | } |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $builderArgs = array($this->referenceResolver->resolveReference($dsl['command'])); |
| 72 | 72 | |
| 73 | 73 | if (isset($dsl['arguments'])) { |
| 74 | - foreach($dsl['arguments'] as $arg) { |
|
| 74 | + foreach ($dsl['arguments'] as $arg) { |
|
| 75 | 75 | /// @todo should this be recursive? |
| 76 | 76 | $builderArgs[] = $this->referenceResolver->resolveReference($arg); |
| 77 | 77 | } |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | // we do allow array values for refs, but not multi-level |
| 495 | 495 | if (is_array($value)) { |
| 496 | - foreach($hashValue as $subValue) { |
|
| 496 | + foreach ($hashValue as $subValue) { |
|
| 497 | 497 | if (is_array($subValue) || is_object($subValue)) { |
| 498 | 498 | throw new \InvalidArgumentException('Content Manager does not support setting references for attribute ' . $reference['attribute'] . ': the given value is an array with a non scalar element'); |
| 499 | 499 | } |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | $locations = $locationService->loadLocations($content->contentInfo); |
| 576 | 576 | if (count($locations) > 1) { |
| 577 | 577 | $otherParentLocations = array(); |
| 578 | - foreach($locations as $otherLocation) { |
|
| 578 | + foreach ($locations as $otherLocation) { |
|
| 579 | 579 | if ($otherLocation->id != $location->id) { |
| 580 | 580 | $otherParentLocations[] = $otherLocation->parentLocationId; |
| 581 | 581 | } |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | $attributes = array(); |
| 629 | - foreach($languages as $lang) { |
|
| 629 | + foreach ($languages as $lang) { |
|
| 630 | 630 | foreach ($content->getFieldsByLanguage($lang) as $fieldIdentifier => $field) { |
| 631 | 631 | $fieldDefinition = $contentType->getFieldDefinition($fieldIdentifier); |
| 632 | 632 | $fieldValue = $this->fieldHandlerManager->fieldValueToHash( |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | }, |
| 775 | 775 | array_filter( |
| 776 | 776 | $this->repository->getContentLanguageService()->loadLanguages(), |
| 777 | - function ($language) { |
|
| 777 | + function($language) { |
|
| 778 | 778 | return $language->enabled; |
| 779 | 779 | } |
| 780 | 780 | ) |
@@ -120,6 +120,6 @@ |
||
| 120 | 120 | { |
| 121 | 121 | $rootDir = realpath($this->kernel->getRootDir() . '/..') . '/'; |
| 122 | 122 | // note: we handle the case of 'path = root dir', but path is expected to include a filename... |
| 123 | - return $path === $rootDir ? './' : preg_replace('#^' . preg_quote($rootDir, '#'). '#', '', $path); |
|
| 123 | + return $path === $rootDir ? './' : preg_replace('#^' . preg_quote($rootDir, '#') . '#', '', $path); |
|
| 124 | 124 | } |
| 125 | 125 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | // allow user to pass in selection values by name |
| 38 | 38 | $fieldSettings = null; |
| 39 | - foreach($fieldValue as $key => $val) { |
|
| 39 | + foreach ($fieldValue as $key => $val) { |
|
| 40 | 40 | |
| 41 | 41 | // NB: this might result in double reference-resolving when the original value is a string, given preResolveReferences... |
| 42 | 42 | $val = $this->referenceResolver->resolveReference($val); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | if ($fieldSettings === null) { |
| 49 | 49 | $fieldSettings = $this->loadFieldSettings($context['contentTypeIdentifier'], $context['fieldIdentifier']); |
| 50 | 50 | } |
| 51 | - foreach($fieldSettings['options'] as $pos => $name) { |
|
| 51 | + foreach ($fieldSettings['options'] as $pos => $name) { |
|
| 52 | 52 | if ($name === $val) { |
| 53 | 53 | $fieldValue[$key] = $pos; |
| 54 | 54 | break; |