Skip to content

Commit 85baf46

Browse files
author
Bernhard Schussek
committed
Applied CS fixes
1 parent 647d4bd commit 85baf46

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

src/Symfony/Bridge/Doctrine/Tests/Fixtures/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Price
2828
public $preserveFullScaleValueSimulation;
2929

3030
/**
31-
* @param int $id
31+
* @param int $id
3232
* @param float $value
3333
*/
3434
public function __construct(int $id, float $value)

src/Symfony/Component/Form/Extension/Core/DataTransformer/StringToFloatTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function transform($value)
4040
return null;
4141
}
4242

43-
if (!is_string($value) || !is_numeric($value)) {
43+
if (!\is_string($value) || !is_numeric($value)) {
4444
throw new TransformationFailedException('Expected a numeric string.');
4545
}
4646

@@ -58,7 +58,7 @@ public function reverseTransform($value)
5858
return null;
5959
}
6060

61-
if (!is_int($value) && !is_float($value)) {
61+
if (!\is_int($value) && !\is_float($value)) {
6262
throw new TransformationFailedException('Expected a numeric.');
6363
}
6464

src/Symfony/Component/Form/Extension/Core/Type/NumberType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function configureOptions(OptionsResolver $resolver)
6767
'html5' => false,
6868
]);
6969

70-
$resolver->setAllowedValues('rounding_mode', [
70+
$resolver->setAllowedValues('rounding_mode', array(
7171
NumberToLocalizedStringTransformer::ROUND_FLOOR,
7272
NumberToLocalizedStringTransformer::ROUND_DOWN,
7373
NumberToLocalizedStringTransformer::ROUND_HALF_DOWN,

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ protected function tearDown()
3030

3131
public function provideTransformations(): array
3232
{
33-
return [
34-
[null, null],
35-
['1', 1.],
36-
['1.', 1.],
37-
['1.0', 1.],
38-
['1.23', 1.23],
39-
];
33+
return array(
34+
array(null, null),
35+
array('1', 1.),
36+
array('1.', 1.),
37+
array('1.0', 1.),
38+
array('1.23', 1.23),
39+
);
4040
}
4141

4242
/**
@@ -69,18 +69,18 @@ public function testFailIfTransformingANonNumericString(): void
6969

7070
public function provideReverseTransformations(): array
7171
{
72-
return [
73-
[null, null],
74-
[1, '1'],
75-
[1., '1'],
76-
[1.0, '1'],
77-
[1.23, '1.23'],
78-
[1, '1.000', 3],
79-
[1.0, '1.000', 3],
80-
[1.23, '1.230', 3],
81-
[1.2344, '1.234', 3],
82-
[1.2345, '1.235', 3],
83-
];
72+
return array(
73+
array(null, null),
74+
array(1, '1'),
75+
array(1., '1'),
76+
array(1.0, '1'),
77+
array(1.23, '1.23'),
78+
array(1, '1.000', 3),
79+
array(1.0, '1.000', 3),
80+
array(1.23, '1.230', 3),
81+
array(1.2344, '1.234', 3),
82+
array(1.2345, '1.235', 3),
83+
);
8484
}
8585

8686
/**

src/Symfony/Component/Form/Tests/Extension/Core/Type/NumberTypeTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,39 @@ public function testDefaultFormatting(): void
3737

3838
public function testDefaultFormattingWithGrouping(): void
3939
{
40-
$form = $this->factory->create(static::TESTED_TYPE, null, ['grouping' => true]);
40+
$form = $this->factory->create(static::TESTED_TYPE, null, array('grouping' => true));
4141
$form->setData('12345.67890');
4242

4343
$this->assertSame('12.345,679', $form->createView()->vars['value']);
4444
}
4545

4646
public function testDefaultFormattingWithScale(): void
4747
{
48-
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2]);
48+
$form = $this->factory->create(static::TESTED_TYPE, null, array('scale' => 2));
4949
$form->setData('12345.67890');
5050

5151
$this->assertSame('12345,68', $form->createView()->vars['value']);
5252
}
5353

5454
public function testDefaultFormattingWithScaleFloat(): void
5555
{
56-
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2]);
56+
$form = $this->factory->create(static::TESTED_TYPE, null, array('scale' => 2));
5757
$form->setData(12345.67890);
5858

5959
$this->assertSame('12345,68', $form->createView()->vars['value']);
6060
}
6161

6262
public function testDefaultFormattingWithScaleAndStringInput(): void
6363
{
64-
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2, 'input' => 'string']);
64+
$form = $this->factory->create(static::TESTED_TYPE, null, array('scale' => 2, 'input' => 'string'));
6565
$form->setData('12345.67890');
6666

6767
$this->assertSame('12345,68', $form->createView()->vars['value']);
6868
}
6969

7070
public function testDefaultFormattingWithRounding(): void
7171
{
72-
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 0, 'rounding_mode' => \NumberFormatter::ROUND_UP]);
72+
$form = $this->factory->create(static::TESTED_TYPE, null, array('scale' => 0, 'rounding_mode' => \NumberFormatter::ROUND_UP));
7373
$form->setData('12345.54321');
7474

7575
$this->assertSame('12346', $form->createView()->vars['value']);
@@ -94,7 +94,7 @@ public function testSubmitNullUsesDefaultEmptyData($emptyData = '10', $expectedD
9494

9595
public function testSubmitNumericInput(): void
9696
{
97-
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'number']);
97+
$form = $this->factory->create(static::TESTED_TYPE, null, array('input' => 'number'));
9898
$form->submit('1,234');
9999

100100
$this->assertSame(1.234, $form->getData());
@@ -104,7 +104,7 @@ public function testSubmitNumericInput(): void
104104

105105
public function testSubmitNumericInputWithScale(): void
106106
{
107-
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'number', 'scale' => 2]);
107+
$form = $this->factory->create(static::TESTED_TYPE, null, array('input' => 'number', 'scale' => 2));
108108
$form->submit('1,234');
109109

110110
$this->assertSame(1.23, $form->getData());
@@ -114,7 +114,7 @@ public function testSubmitNumericInputWithScale(): void
114114

115115
public function testSubmitStringInput(): void
116116
{
117-
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'string']);
117+
$form = $this->factory->create(static::TESTED_TYPE, null, array('input' => 'string'));
118118
$form->submit('1,234');
119119

120120
$this->assertSame('1.234', $form->getData());
@@ -124,7 +124,7 @@ public function testSubmitStringInput(): void
124124

125125
public function testSubmitStringInputWithScale(): void
126126
{
127-
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'string', 'scale' => 2]);
127+
$form = $this->factory->create(static::TESTED_TYPE, null, array('input' => 'string', 'scale' => 2));
128128
$form->submit('1,234');
129129

130130
$this->assertSame('1.23', $form->getData());

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy