Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0218507

Browse filesBrowse files
Merge branch '2.8' into 3.4
* 2.8: Fix CS Allow reuse of Session between requests Provide debug_backtrace with proper args forward false label option to nested types forward the invalid_message option in date types
2 parents 31e96f7 + 76c2de0 commit 0218507
Copy full SHA for 0218507

File tree

Expand file treeCollapse file tree

16 files changed

+179
-128
lines changed
Filter options
Expand file treeCollapse file tree

16 files changed

+179
-128
lines changed

‎src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static function register($mode = 0)
112112
return $ErrorHandler::handleError($type, $msg, $file, $line, $context);
113113
}
114114

115-
$trace = debug_backtrace(true);
115+
$trace = debug_backtrace();
116116
$group = 'other';
117117
$isVendor = DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $inVendors($file);
118118

‎src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ public function testFirewalls()
173173
null,
174174
null,
175175
array(
176-
'simple_form',
177-
'anonymous',
176+
'simple_form',
177+
'anonymous',
178178
),
179179
null,
180180
),

‎src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ public function provideUndefinedMethodData()
6464
),
6565
array(
6666
array(
67-
'type' => 1,
68-
'message' => 'Call to undefined method class@anonymous::test()',
69-
'file' => '/home/possum/work/symfony/test.php',
70-
'line' => 11,
67+
'type' => 1,
68+
'message' => 'Call to undefined method class@anonymous::test()',
69+
'file' => '/home/possum/work/symfony/test.php',
70+
'line' => 11,
7171
),
7272
'Attempted to call an undefined method named "test" of class "class@anonymous".',
7373
),

‎src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ public function testResolvedBase64EnvParameters()
390390
$container->compile(true);
391391

392392
$expected = array(
393-
'env(foo)' => 'd29ybGQ=',
394-
'hello' => 'world',
393+
'env(foo)' => 'd29ybGQ=',
394+
'hello' => 'world',
395395
);
396396
$this->assertSame($expected, $container->getParameterBag()->all());
397397
}

‎src/Symfony/Component/DomCrawler/Tests/FormTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Tests/FormTest.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -948,12 +948,12 @@ public function testgetPhpValuesWithEmptyTextarea()
948948
{
949949
$dom = new \DOMDocument();
950950
$dom->loadHTML('
951-
<html>
952-
<form>
953-
<textarea name="example"></textarea>
954-
</form>
955-
</html>
956-
');
951+
<html>
952+
<form>
953+
<textarea name="example"></textarea>
954+
</form>
955+
</html>'
956+
);
957957

958958
$nodes = $dom->getElementsByTagName('form');
959959
$form = new Form($nodes->item(0), 'http://example.com');

‎src/Symfony/Component/Finder/Tests/Iterator/MockSplFileInfo.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Tests/Iterator/MockSplFileInfo.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public function __construct($param)
2929
parent::__construct($param);
3030
} elseif (\is_array($param)) {
3131
$defaults = array(
32-
'name' => 'file.txt',
33-
'contents' => null,
34-
'mode' => null,
35-
'type' => null,
36-
'relativePath' => null,
37-
'relativePathname' => null,
32+
'name' => 'file.txt',
33+
'contents' => null,
34+
'mode' => null,
35+
'type' => null,
36+
'relativePath' => null,
37+
'relativePathname' => null,
3838
);
3939
$defaults = array_merge($defaults, $param);
4040
parent::__construct($defaults['name']);

‎src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ public function buildForm(FormBuilderInterface $builder, array $options)
119119
'invalid_message_parameters',
120120
)));
121121

122+
if (false === $options['label']) {
123+
$dateOptions['label'] = false;
124+
$timeOptions['label'] = false;
125+
}
126+
122127
if (null !== $options['date_widget']) {
123128
$dateOptions['widget'] = $options['date_widget'];
124129
}

‎src/Symfony/Component/Form/Extension/Core/Type/DateType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/DateType.php
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
7777
'error_bubbling' => true,
7878
);
7979

80+
if (isset($options['invalid_message'])) {
81+
$dayOptions['invalid_message'] = $options['invalid_message'];
82+
$monthOptions['invalid_message'] = $options['invalid_message'];
83+
$yearOptions['invalid_message'] = $options['invalid_message'];
84+
}
85+
86+
if (isset($options['invalid_message_parameters'])) {
87+
$dayOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
88+
$monthOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
89+
$yearOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
90+
}
91+
8092
$formatter = new \IntlDateFormatter(
8193
\Locale::getDefault(),
8294
$dateFormat,

‎src/Symfony/Component/Form/Extension/Core/Type/TimeType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/TimeType.php
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
7272
'error_bubbling' => true,
7373
);
7474

75+
if (isset($options['invalid_message'])) {
76+
$hourOptions['invalid_message'] = $options['invalid_message'];
77+
$minuteOptions['invalid_message'] = $options['invalid_message'];
78+
$secondOptions['invalid_message'] = $options['invalid_message'];
79+
}
80+
81+
if (isset($options['invalid_message_parameters'])) {
82+
$hourOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
83+
$minuteOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
84+
$secondOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
85+
}
86+
7587
if ('choice' === $options['widget']) {
7688
$hours = $minutes = array();
7789

‎src/Symfony/Component/HttpFoundation/Session/Session.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Session.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ public function getId()
209209
*/
210210
public function setId($id)
211211
{
212-
$this->storage->setId($id);
212+
if ($this->storage->getId() !== $id) {
213+
$this->storage->setId($id);
214+
}
213215
}
214216

215217
/**

‎src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,27 @@ public function testSetId()
7070
$this->assertEquals('0123456789abcdef', $this->session->getId());
7171
}
7272

73+
public function testSetIdAfterStart()
74+
{
75+
$this->session->start();
76+
$id = $this->session->getId();
77+
78+
$e = null;
79+
try {
80+
$this->session->setId($id);
81+
} catch (\Exception $e) {
82+
}
83+
84+
$this->assertNull($e);
85+
86+
try {
87+
$this->session->setId('different');
88+
} catch (\Exception $e) {
89+
}
90+
91+
$this->assertInstanceOf('\LogicException', $e);
92+
}
93+
7394
public function testSetName()
7495
{
7596
$this->assertEquals('MOCKSESSID', $this->session->getName());

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function setUp()
4848
$this->data = array(
4949
$this->attributes->getStorageKey() => array('foo' => 'bar'),
5050
$this->flashes->getStorageKey() => array('notice' => 'hello'),
51-
);
51+
);
5252

5353
$this->storage = new MockArraySessionStorage();
5454
$this->storage->registerBag($this->flashes);

‎src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ public function testContext()
189189
public function testEncodeScalarRootAttributes()
190190
{
191191
$array = array(
192-
'#' => 'Paul',
193-
'@gender' => 'm',
192+
'#' => 'Paul',
193+
'@gender' => 'm',
194194
);
195195

196196
$expected = '<?xml version="1.0"?>'."\n".
@@ -202,8 +202,8 @@ public function testEncodeScalarRootAttributes()
202202
public function testEncodeRootAttributes()
203203
{
204204
$array = array(
205-
'firstname' => 'Paul',
206-
'@gender' => 'm',
205+
'firstname' => 'Paul',
206+
'@gender' => 'm',
207207
);
208208

209209
$expected = '<?xml version="1.0"?>'."\n".
@@ -215,7 +215,7 @@ public function testEncodeRootAttributes()
215215
public function testEncodeCdataWrapping()
216216
{
217217
$array = array(
218-
'firstname' => 'Paul <or Me>',
218+
'firstname' => 'Paul <or Me>',
219219
);
220220

221221
$expected = '<?xml version="1.0"?>'."\n".

‎src/Symfony/Component/Serializer/Tests/Normalizer/PropertyNormalizerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Tests/Normalizer/PropertyNormalizerTest.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public function testNormalizeWithParentClass()
7575
$group->setKevin('Kevin');
7676
$group->setCoopTilleuls('coop');
7777
$this->assertEquals(
78-
array('foo' => 'foo', 'bar' => 'bar', 'kevin' => 'Kevin',
79-
'coopTilleuls' => 'coop', 'fooBar' => null, 'symfony' => null, 'baz' => 'baz', ),
78+
array('foo' => 'foo', 'bar' => 'bar', 'kevin' => 'Kevin', 'coopTilleuls' => 'coop', 'fooBar' => null, 'symfony' => null, 'baz' => 'baz'),
8079
$this->normalizer->normalize($group, 'any')
8180
);
8281
}

‎src/Symfony/Component/Translation/Tests/DataCollector/TranslationDataCollectorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Tests/DataCollector/TranslationDataCollectorTest.php
+63-63Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -42,85 +42,85 @@ public function testCollect()
4242
{
4343
$collectedMessages = array(
4444
array(
45-
'id' => 'foo',
46-
'translation' => 'foo (en)',
47-
'locale' => 'en',
48-
'domain' => 'messages',
49-
'state' => DataCollectorTranslator::MESSAGE_DEFINED,
50-
'parameters' => array(),
51-
'transChoiceNumber' => null,
45+
'id' => 'foo',
46+
'translation' => 'foo (en)',
47+
'locale' => 'en',
48+
'domain' => 'messages',
49+
'state' => DataCollectorTranslator::MESSAGE_DEFINED,
50+
'parameters' => array(),
51+
'transChoiceNumber' => null,
5252
),
5353
array(
54-
'id' => 'bar',
55-
'translation' => 'bar (fr)',
56-
'locale' => 'fr',
57-
'domain' => 'messages',
58-
'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK,
59-
'parameters' => array(),
60-
'transChoiceNumber' => null,
54+
'id' => 'bar',
55+
'translation' => 'bar (fr)',
56+
'locale' => 'fr',
57+
'domain' => 'messages',
58+
'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK,
59+
'parameters' => array(),
60+
'transChoiceNumber' => null,
6161
),
6262
array(
63-
'id' => 'choice',
64-
'translation' => 'choice',
65-
'locale' => 'en',
66-
'domain' => 'messages',
67-
'state' => DataCollectorTranslator::MESSAGE_MISSING,
68-
'parameters' => array('%count%' => 3),
69-
'transChoiceNumber' => 3,
63+
'id' => 'choice',
64+
'translation' => 'choice',
65+
'locale' => 'en',
66+
'domain' => 'messages',
67+
'state' => DataCollectorTranslator::MESSAGE_MISSING,
68+
'parameters' => array('%count%' => 3),
69+
'transChoiceNumber' => 3,
7070
),
7171
array(
72-
'id' => 'choice',
73-
'translation' => 'choice',
74-
'locale' => 'en',
75-
'domain' => 'messages',
76-
'state' => DataCollectorTranslator::MESSAGE_MISSING,
77-
'parameters' => array('%count%' => 3),
78-
'transChoiceNumber' => 3,
72+
'id' => 'choice',
73+
'translation' => 'choice',
74+
'locale' => 'en',
75+
'domain' => 'messages',
76+
'state' => DataCollectorTranslator::MESSAGE_MISSING,
77+
'parameters' => array('%count%' => 3),
78+
'transChoiceNumber' => 3,
7979
),
8080
array(
81-
'id' => 'choice',
82-
'translation' => 'choice',
83-
'locale' => 'en',
84-
'domain' => 'messages',
85-
'state' => DataCollectorTranslator::MESSAGE_MISSING,
86-
'parameters' => array('%count%' => 4, '%foo%' => 'bar'),
87-
'transChoiceNumber' => 4,
81+
'id' => 'choice',
82+
'translation' => 'choice',
83+
'locale' => 'en',
84+
'domain' => 'messages',
85+
'state' => DataCollectorTranslator::MESSAGE_MISSING,
86+
'parameters' => array('%count%' => 4, '%foo%' => 'bar'),
87+
'transChoiceNumber' => 4,
8888
),
8989
);
9090
$expectedMessages = array(
9191
array(
92-
'id' => 'foo',
93-
'translation' => 'foo (en)',
94-
'locale' => 'en',
95-
'domain' => 'messages',
96-
'state' => DataCollectorTranslator::MESSAGE_DEFINED,
97-
'count' => 1,
98-
'parameters' => array(),
99-
'transChoiceNumber' => null,
92+
'id' => 'foo',
93+
'translation' => 'foo (en)',
94+
'locale' => 'en',
95+
'domain' => 'messages',
96+
'state' => DataCollectorTranslator::MESSAGE_DEFINED,
97+
'count' => 1,
98+
'parameters' => array(),
99+
'transChoiceNumber' => null,
100100
),
101101
array(
102-
'id' => 'bar',
103-
'translation' => 'bar (fr)',
104-
'locale' => 'fr',
105-
'domain' => 'messages',
106-
'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK,
107-
'count' => 1,
108-
'parameters' => array(),
109-
'transChoiceNumber' => null,
102+
'id' => 'bar',
103+
'translation' => 'bar (fr)',
104+
'locale' => 'fr',
105+
'domain' => 'messages',
106+
'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK,
107+
'count' => 1,
108+
'parameters' => array(),
109+
'transChoiceNumber' => null,
110110
),
111111
array(
112-
'id' => 'choice',
113-
'translation' => 'choice',
114-
'locale' => 'en',
115-
'domain' => 'messages',
116-
'state' => DataCollectorTranslator::MESSAGE_MISSING,
117-
'count' => 3,
118-
'parameters' => array(
119-
array('%count%' => 3),
120-
array('%count%' => 3),
121-
array('%count%' => 4, '%foo%' => 'bar'),
122-
),
123-
'transChoiceNumber' => 3,
112+
'id' => 'choice',
113+
'translation' => 'choice',
114+
'locale' => 'en',
115+
'domain' => 'messages',
116+
'state' => DataCollectorTranslator::MESSAGE_MISSING,
117+
'count' => 3,
118+
'parameters' => array(
119+
array('%count%' => 3),
120+
array('%count%' => 3),
121+
array('%count%' => 4, '%foo%' => 'bar'),
122+
),
123+
'transChoiceNumber' => 3,
124124
),
125125
);
126126

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.