Skip to content

Commit f99ace6

Browse files
committed
[CS Fix] Consistent coding-style of concatenation operator usage
1 parent 06ad46c commit f99ace6

18 files changed

+95
-95
lines changed

Extension/Core/ChoiceList/ChoiceList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,13 @@ protected function addChoice(array &$bucketForPreferred, array &$bucketForRemain
345345
$index = $this->createIndex($choice);
346346

347347
if ('' === $index || null === $index || !FormConfigBuilder::isValidName((string) $index)) {
348-
throw new InvalidConfigurationException('The index "' . $index . '" created by the choice list is invalid. It should be a valid, non-empty Form name.');
348+
throw new InvalidConfigurationException('The index "'.$index.'" created by the choice list is invalid. It should be a valid, non-empty Form name.');
349349
}
350350

351351
$value = $this->createValue($choice);
352352

353353
if (!is_string($value)) {
354-
throw new InvalidConfigurationException('The value created by the choice list is of type "' . gettype($value) . '", but should be a string.');
354+
throw new InvalidConfigurationException('The value created by the choice list is of type "'.gettype($value).'", but should be a string.');
355355
}
356356

357357
$view = new ChoiceView($choice, $value, $label);

Extension/Core/ChoiceList/LazyChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private function load()
141141
$choiceList = $this->loadChoiceList();
142142

143143
if (!$choiceList instanceof ChoiceListInterface) {
144-
throw new Exception('loadChoiceList() should return a ChoiceListInterface instance. Got ' . gettype($choiceList));
144+
throw new Exception('loadChoiceList() should return a ChoiceListInterface instance. Got '.gettype($choiceList));
145145
}
146146

147147
$this->choiceList = $choiceList;

Extension/Core/ChoiceList/ObjectChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private function extractLabels($choices, array &$labels)
176176
} elseif (method_exists($choice, '__toString')) {
177177
$labels[$i] = (string) $choice;
178178
} else {
179-
throw new StringCastException('A "__toString()" method was not found on the objects of type "' . get_class($choice) . '" passed to the choice field. To read a custom getter instead, set the argument $labelPath to the desired property path.');
179+
throw new StringCastException('A "__toString()" method was not found on the objects of type "'.get_class($choice).'" passed to the choice field. To read a custom getter instead, set the argument $labelPath to the desired property path.');
180180
}
181181
}
182182
}

Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function reverseTransform($values)
9898
if (isset($choices[$i])) {
9999
return $choices[$i] === '' ? null : $choices[$i];
100100
} else {
101-
throw new TransformationFailedException('The choice "' . $i . '" does not exist');
101+
throw new TransformationFailedException('The choice "'.$i.'" does not exist');
102102
}
103103
}
104104
}

Extension/Core/DataTransformer/ChoiceToValueTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function reverseTransform($value)
5353
$choices = $this->choiceList->getChoicesForValues(array($value));
5454

5555
if (1 !== count($choices)) {
56-
throw new TransformationFailedException('The choice "' . $value . '" does not exist or is not unique');
56+
throw new TransformationFailedException('The choice "'.$value.'" does not exist or is not unique');
5757
}
5858

5959
$choice = current($choices);

Extension/Core/DataTransformer/ChoicesToBooleanArrayTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function reverseTransform($values)
109109
}
110110

111111
if (count($unknown) > 0) {
112-
throw new TransformationFailedException('The choices "' . implode('", "', $unknown) . '" were not found');
112+
throw new TransformationFailedException('The choices "'.implode('", "', $unknown).'" were not found');
113113
}
114114

115115
return $result;

Extension/Core/Type/CollectionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
2828
{
2929
if ($options['allow_add'] && $options['prototype']) {
3030
$prototype = $builder->create($options['prototype_name'], $options['type'], array_replace(array(
31-
'label' => $options['prototype_name'] . 'label__',
31+
'label' => $options['prototype_name'].'label__',
3232
), $options['options']));
3333
$builder->setAttribute('prototype', $prototype->getForm());
3434
}

Extension/Core/Type/FormType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
8282
} else {
8383
$id = $name;
8484
$fullName = $name;
85-
$uniqueBlockPrefix = '_' . $blockName;
85+
$uniqueBlockPrefix = '_'.$blockName;
8686
}
8787

8888
// Complex fields are read-only if they themselves or their parents are.
@@ -96,7 +96,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
9696
} else {
9797
$id = $name;
9898
$fullName = $name;
99-
$uniqueBlockPrefix = '_' . $blockName;
99+
$uniqueBlockPrefix = '_'.$blockName;
100100

101101
// Strip leading underscores and digits. These are allowed in
102102
// form names, but not in HTML4 ID attributes.
@@ -143,7 +143,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
143143
// collection form have different types (dynamically), they should
144144
// be rendered differently.
145145
// https://github.com/symfony/symfony/issues/5038
146-
'cache_key' => $uniqueBlockPrefix . '_' . $form->getConfig()->getType()->getName(),
146+
'cache_key' => $uniqueBlockPrefix.'_'.$form->getConfig()->getType()->getName(),
147147
));
148148
}
149149

Extension/Templating/TemplatingRendererEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function loadResourceForBlockName($cacheKey, FormView $view, $blockNam
114114
*/
115115
protected function loadResourceFromTheme($cacheKey, $blockName, $theme)
116116
{
117-
if ($this->engine->exists($templateName = $theme . ':' . $blockName . '.html.php')) {
117+
if ($this->engine->exists($templateName = $theme.':'.$blockName.'.html.php')) {
118118
$this->resources[$cacheKey][$blockName] = $templateName;
119119

120120
return true;

Extension/Validator/ViolationMapper/ViolationMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ private function matchChild(FormInterface $form, PropertyPathIteratorInterface $
174174
}
175175

176176
if ($it->isIndex()) {
177-
$chunk .= '[' . $it->current() . ']';
177+
$chunk .= '['.$it->current().']';
178178
} else {
179-
$chunk .= ('' === $chunk ? '' : '.') . $it->current();
179+
$chunk .= ('' === $chunk ? '' : '.').$it->current();
180180
}
181181

182182
// Test mapping rules as long as we have any

Extension/Validator/ViolationMapper/ViolationPath.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function getElements()
155155
public function getElement($index)
156156
{
157157
if (!isset($this->elements[$index])) {
158-
throw new \OutOfBoundsException('The index ' . $index . ' is not within the violation path');
158+
throw new \OutOfBoundsException('The index '.$index.' is not within the violation path');
159159
}
160160

161161
return $this->elements[$index];
@@ -167,7 +167,7 @@ public function getElement($index)
167167
public function isProperty($index)
168168
{
169169
if (!isset($this->isIndex[$index])) {
170-
throw new \OutOfBoundsException('The index ' . $index . ' is not within the violation path');
170+
throw new \OutOfBoundsException('The index '.$index.' is not within the violation path');
171171
}
172172

173173
return !$this->isIndex[$index];
@@ -179,7 +179,7 @@ public function isProperty($index)
179179
public function isIndex($index)
180180
{
181181
if (!isset($this->isIndex[$index])) {
182-
throw new \OutOfBoundsException('The index ' . $index . ' is not within the violation path');
182+
throw new \OutOfBoundsException('The index '.$index.' is not within the violation path');
183183
}
184184

185185
return $this->isIndex[$index];
@@ -206,7 +206,7 @@ public function isIndex($index)
206206
public function mapsForm($index)
207207
{
208208
if (!isset($this->mapsForm[$index])) {
209-
throw new \OutOfBoundsException('The index ' . $index . ' is not within the violation path');
209+
throw new \OutOfBoundsException('The index '.$index.' is not within the violation path');
210210
}
211211

212212
return $this->mapsForm[$index];
@@ -234,7 +234,7 @@ private function buildString()
234234
if ($this->mapsForm[$index]) {
235235
$this->pathAsString .= ".children[$element]";
236236
} elseif (!$data) {
237-
$this->pathAsString .= '.data' . ($this->isIndex[$index] ? "[$element]" : ".$element");
237+
$this->pathAsString .= '.data'.($this->isIndex[$index] ? "[$element]" : ".$element");
238238
$data = true;
239239
} else {
240240
$this->pathAsString .= $this->isIndex[$index] ? "[$element]" : ".$element";

Form.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function getPropertyPath()
194194
}
195195

196196
if ($this->parent && null === $this->parent->getConfig()->getDataClass()) {
197-
return new PropertyPath('[' . $this->getName() . ']');
197+
return new PropertyPath('['.$this->getName().']');
198198
}
199199

200200
return new PropertyPath($this->getName());
@@ -314,27 +314,27 @@ public function setData($modelData)
314314
if (!FormUtil::isEmpty($viewData)) {
315315
$dataClass = $this->config->getDataClass();
316316

317-
$actualType = is_object($viewData) ? 'an instance of class ' . get_class($viewData) : ' a(n) ' . gettype($viewData);
317+
$actualType = is_object($viewData) ? 'an instance of class '.get_class($viewData) : ' a(n) '.gettype($viewData);
318318

319319
if (null === $dataClass && is_object($viewData) && !$viewData instanceof \ArrayAccess) {
320320
$expectedType = 'scalar, array or an instance of \ArrayAccess';
321321

322322
throw new Exception(
323-
'The form\'s view data is expected to be of type ' . $expectedType . ', ' .
324-
'but is ' . $actualType . '. You ' .
323+
'The form\'s view data is expected to be of type '.$expectedType.', ' .
324+
'but is '.$actualType.'. You ' .
325325
'can avoid this error by setting the "data_class" option to ' .
326-
'"' . get_class($viewData) . '" or by adding a view transformer ' .
327-
'that transforms ' . $actualType . ' to ' . $expectedType . '.'
326+
'"'.get_class($viewData).'" or by adding a view transformer ' .
327+
'that transforms '.$actualType.' to '.$expectedType.'.'
328328
);
329329
}
330330

331331
if (null !== $dataClass && !$viewData instanceof $dataClass) {
332332
throw new Exception(
333333
'The form\'s view data is expected to be an instance of class ' .
334-
$dataClass . ', but is '. $actualType . '. You can avoid this error ' .
334+
$dataClass.', but is '. $actualType.'. You can avoid this error ' .
335335
'by setting the "data_class" option to null or by adding a view ' .
336-
'transformer that transforms ' . $actualType . ' to an instance of ' .
337-
$dataClass . '.'
336+
'transformer that transforms '.$actualType.' to an instance of ' .
337+
$dataClass.'.'
338338
);
339339
}
340340
}

FormRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $va
138138

139139
// The cache key for storing the variables and types
140140
$viewCacheKey = $view->vars[self::CACHE_KEY_VAR];
141-
$viewAndSuffixCacheKey = $viewCacheKey . $blockNameSuffix;
141+
$viewAndSuffixCacheKey = $viewCacheKey.$blockNameSuffix;
142142

143143
// In templates, we have to deal with two kinds of block hierarchies:
144144
//
@@ -173,7 +173,7 @@ public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $va
173173
// the bottom level of the hierarchy (= "_<id>_<section>" block)
174174
$blockNameHierarchy = array();
175175
foreach ($view->vars['block_prefixes'] as $blockNamePrefix) {
176-
$blockNameHierarchy[] = $blockNamePrefix . '_' . $blockNameSuffix;
176+
$blockNameHierarchy[] = $blockNamePrefix.'_'.$blockNameSuffix;
177177
}
178178
$hierarchyLevel = count($blockNameHierarchy) - 1;
179179

Tests/AbstractLayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ protected function assertMatchesXpath($html, $expression, $count = 1)
7979
$this->fail(sprintf(
8080
"Failed asserting that \n\n%s\n\nmatches exactly %s. Matches %s in \n\n%s",
8181
$expression,
82-
$count == 1 ? 'once' : $count . ' times',
83-
$nodeList->length == 1 ? 'once' : $nodeList->length . ' times',
82+
$count == 1 ? 'once' : $count.' times',
83+
$nodeList->length == 1 ? 'once' : $nodeList->length.' times',
8484
// strip away <root> and </root>
8585
substr($dom->saveHTML(), 6, -8)
8686
));

Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ public function dataProvider()
5858
array(null, \IntlDateFormatter::SHORT, null, '03.02.2010 04:05', '2010-02-03 04:05:00 UTC'),
5959
array(null, \IntlDateFormatter::MEDIUM, null, '03.02.2010 04:05:06', '2010-02-03 04:05:06 UTC'),
6060
array(null, \IntlDateFormatter::LONG, null,
61-
'03.02.2010 04:05:06 GMT' . ($this->isLowerThanIcuVersion('4.8') ? '+00:00' : ''),
61+
'03.02.2010 04:05:06 GMT'.($this->isLowerThanIcuVersion('4.8') ? '+00:00' : ''),
6262
'2010-02-03 04:05:06 UTC'),
6363
// see below for extra test case for time format FULL
6464
array(\IntlDateFormatter::NONE, \IntlDateFormatter::SHORT, null, '04:05', '1970-01-01 04:05:00 UTC'),
6565
array(\IntlDateFormatter::NONE, \IntlDateFormatter::MEDIUM, null, '04:05:06', '1970-01-01 04:05:06 UTC'),
6666
array(\IntlDateFormatter::NONE, \IntlDateFormatter::LONG, null,
67-
'04:05:06 GMT' . ($this->isLowerThanIcuVersion('4.8') ? '+00:00' : ''),
67+
'04:05:06 GMT'.($this->isLowerThanIcuVersion('4.8') ? '+00:00' : ''),
6868
'1970-01-01 04:05:06 UTC'),
6969
array(null, null, 'yyyy-MM-dd HH:mm:00', '2010-02-03 04:05:00', '2010-02-03 04:05:00 UTC'),
7070
array(null, null, 'yyyy-MM-dd HH:mm', '2010-02-03 04:05', '2010-02-03 04:05:00 UTC'),

0 commit comments

Comments
 (0)