Skip to content

Commit b13a23f

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Show more accurate message in profiler when missing stopwatch CS Fixes: Not double split with one array argument Remove redundant animation prefixes Remove redundant `box-sizing` prefixes Rework firewall access denied rule fixed CS Fix missing $extraDirs when open_basedir returns
2 parents 98e0975 + 32c448f commit b13a23f

File tree

14 files changed

+151
-113
lines changed

14 files changed

+151
-113
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,12 @@ public function testEncodePasswordOutput()
126126

127127
public function testEncodePasswordEmptySaltOutput()
128128
{
129-
$this->passwordEncoderCommandTester->execute(
130-
[
131-
'command' => 'security:encode-password',
132-
'password' => 'p@ssw0rd',
133-
'user-class' => 'Symfony\Component\Security\Core\User\User',
134-
'--empty-salt' => true,
135-
]
136-
);
129+
$this->passwordEncoderCommandTester->execute([
130+
'command' => 'security:encode-password',
131+
'password' => 'p@ssw0rd',
132+
'user-class' => 'Symfony\Component\Security\Core\User\User',
133+
'--empty-salt' => true,
134+
]);
137135

138136
$this->assertContains('Password encoding succeeded', $this->passwordEncoderCommandTester->getDisplay());
139137
$this->assertContains(' Encoded password p@ssw0rd', $this->passwordEncoderCommandTester->getDisplay());

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@
9797

9898
<h2>Execution timeline</h2>
9999

100-
{% if collector.events is empty %}
100+
{% if not collector.isStopwatchInstalled() %}
101+
<div class="empty">
102+
<p>The Stopwatch component is not installed. If you want to see timing events, run: <code>composer require symfony/stopwatch</code>.</p>
103+
</div>
104+
{% elseif collector.events is empty %}
101105
<div class="empty">
102106
<p>No timing events have been recorded. Check that symfony/stopwatch is installed and debugging enabled in the kernel.</p>
103107
</div>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
background-color: #222;
66
border-top-left-radius: 4px;
77
bottom: 0;
8-
-webkit-box-sizing: border-box;
9-
-moz-box-sizing: border-box;
108
box-sizing: border-box;
119
display: none;
1210
height: 36px;
@@ -36,8 +34,6 @@
3634
}
3735

3836
.sf-toolbarreset * {
39-
-webkit-box-sizing: content-box;
40-
-moz-box-sizing: content-box;
4137
box-sizing: content-box;
4238
vertical-align: baseline;
4339
letter-spacing: normal;
@@ -371,21 +367,8 @@ div.sf-toolbar .sf-toolbar-block a:hover {
371367
text-align: right;
372368
}
373369
.sf-ajax-request-loading {
374-
-webkit-animation: sf-blink .5s ease-in-out infinite;
375-
-o-animation: sf-blink .5s ease-in-out infinite;
376-
-moz-animation: sf-blink .5s ease-in-out infinite;
377370
animation: sf-blink .5s ease-in-out infinite;
378371
}
379-
@-webkit-keyframes sf-blink {
380-
0% { background: #222; }
381-
50% { background: #444; }
382-
100% { background: #222; }
383-
}
384-
@-moz-keyframes sf-blink {
385-
0% { background: #222; }
386-
50% { background: #444; }
387-
100% { background: #222; }
388-
}
389372
@keyframes sf-blink {
390373
0% { background: #222; }
391374
50% { background: #444; }

src/Symfony/Bundle/WebProfilerBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": "^7.1.3",
2020
"symfony/config": "^4.2",
21-
"symfony/http-kernel": "~4.2",
21+
"symfony/http-kernel": "^4.2.6",
2222
"symfony/routing": "~3.4|~4.0",
2323
"symfony/twig-bundle": "~4.2",
2424
"symfony/var-dumper": "~3.4|~4.0",

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

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -205,38 +205,36 @@ public function configureOptions(OptionsResolver $resolver)
205205
}));
206206
};
207207

208-
$resolver->setDefaults(
209-
[
210-
'with_years' => true,
211-
'with_months' => true,
212-
'with_days' => true,
213-
'with_weeks' => false,
214-
'with_hours' => false,
215-
'with_minutes' => false,
216-
'with_seconds' => false,
217-
'with_invert' => false,
218-
'years' => range(0, 100),
219-
'months' => range(0, 12),
220-
'weeks' => range(0, 52),
221-
'days' => range(0, 31),
222-
'hours' => range(0, 24),
223-
'minutes' => range(0, 60),
224-
'seconds' => range(0, 60),
225-
'widget' => 'choice',
226-
'input' => 'dateinterval',
227-
'placeholder' => $placeholderDefault,
228-
'by_reference' => true,
229-
'error_bubbling' => false,
230-
// If initialized with a \DateInterval object, FormType initializes
231-
// this option to "\DateInterval". Since the internal, normalized
232-
// representation is not \DateInterval, but an array, we need to unset
233-
// this option.
234-
'data_class' => null,
235-
'compound' => $compound,
236-
'empty_data' => $emptyData,
237-
'labels' => [],
238-
]
239-
);
208+
$resolver->setDefaults([
209+
'with_years' => true,
210+
'with_months' => true,
211+
'with_days' => true,
212+
'with_weeks' => false,
213+
'with_hours' => false,
214+
'with_minutes' => false,
215+
'with_seconds' => false,
216+
'with_invert' => false,
217+
'years' => range(0, 100),
218+
'months' => range(0, 12),
219+
'weeks' => range(0, 52),
220+
'days' => range(0, 31),
221+
'hours' => range(0, 24),
222+
'minutes' => range(0, 60),
223+
'seconds' => range(0, 60),
224+
'widget' => 'choice',
225+
'input' => 'dateinterval',
226+
'placeholder' => $placeholderDefault,
227+
'by_reference' => true,
228+
'error_bubbling' => false,
229+
// If initialized with a \DateInterval object, FormType initializes
230+
// this option to "\DateInterval". Since the internal, normalized
231+
// representation is not \DateInterval, but an array, we need to unset
232+
// this option.
233+
'data_class' => null,
234+
'compound' => $compound,
235+
'empty_data' => $emptyData,
236+
'labels' => [],
237+
]);
240238
$resolver->setNormalizer('placeholder', $placeholderNormalizer);
241239
$resolver->setNormalizer('labels', $labelsNormalizer);
242240

src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,10 @@ function ($object) { return $object->value; }
144144

145145
public function testCreateFromChoicesGrouped()
146146
{
147-
$list = $this->factory->createListFromChoices(
148-
[
149-
'Group 1' => ['A' => $this->obj1, 'B' => $this->obj2],
150-
'Group 2' => ['C' => $this->obj3, 'D' => $this->obj4],
151-
]
152-
);
147+
$list = $this->factory->createListFromChoices([
148+
'Group 1' => ['A' => $this->obj1, 'B' => $this->obj2],
149+
'Group 2' => ['C' => $this->obj3, 'D' => $this->obj4],
150+
]);
153151

154152
$this->assertObjectListWithGeneratedValues($list);
155153
}

src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function collect(Request $request, Response $response, \Exception $except
4747
'token' => $response->headers->get('X-Debug-Token'),
4848
'start_time' => $startTime * 1000,
4949
'events' => [],
50+
'stopwatch_installed' => \class_exists(Stopwatch::class, false),
5051
];
5152
}
5253

@@ -139,6 +140,14 @@ public function getStartTime()
139140
return $this->data['start_time'];
140141
}
141142

143+
/**
144+
* @return bool whether or not the stopwatch component is installed
145+
*/
146+
public function isStopwatchInstalled()
147+
{
148+
return $this->data['stopwatch_installed'];
149+
}
150+
142151
/**
143152
* {@inheritdoc}
144153
*/

src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpFoundation\Response;
1717
use Symfony\Component\HttpKernel\DataCollector\TimeDataCollector;
18+
use Symfony\Component\Stopwatch\Stopwatch;
1819

1920
/**
2021
* @group time-sensitive
@@ -51,5 +52,6 @@ public function testCollect()
5152

5253
$c->collect($request, new Response());
5354
$this->assertEquals(123456000, $c->getStartTime());
55+
$this->assertSame(\class_exists(Stopwatch::class, false), $c->isStopwatchInstalled());
5456
}
5557
}

src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -851,13 +851,11 @@ public function testResolveFailsWithCorrectLevelsButWrongScalar()
851851
$this->resolver->setDefined('foo');
852852
$this->resolver->setAllowedTypes('foo', 'int[][]');
853853

854-
$this->resolver->resolve(
855-
[
856-
'foo' => [
857-
[1.2],
858-
],
859-
]
860-
);
854+
$this->resolver->resolve([
855+
'foo' => [
856+
[1.2],
857+
],
858+
]);
861859
}
862860

863861
/**
@@ -1918,13 +1916,11 @@ public function testNestedArrays()
19181916
1, 2,
19191917
],
19201918
],
1921-
], $this->resolver->resolve(
1922-
[
1923-
'foo' => [
1924-
[1, 2],
1925-
],
1926-
]
1927-
));
1919+
], $this->resolver->resolve([
1920+
'foo' => [
1921+
[1, 2],
1922+
],
1923+
]));
19281924
}
19291925

19301926
public function testNested2Arrays()
@@ -1964,17 +1960,15 @@ public function testNestedArraysException()
19641960
$this->resolver->setDefined('foo');
19651961
$this->resolver->setAllowedTypes('foo', 'float[][][][]');
19661962

1967-
$this->resolver->resolve(
1968-
[
1969-
'foo' => [
1963+
$this->resolver->resolve([
1964+
'foo' => [
1965+
[
19701966
[
1971-
[
1972-
[1, 2],
1973-
],
1967+
[1, 2],
19741968
],
19751969
],
1976-
]
1977-
);
1970+
],
1971+
]);
19781972
}
19791973

19801974
/**

src/Symfony/Component/Process/ExecutableFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function addSuffix($suffix)
5151
public function find($name, $default = null, array $extraDirs = [])
5252
{
5353
if (ini_get('open_basedir')) {
54-
$searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir'));
54+
$searchPath = array_merge(explode(PATH_SEPARATOR, ini_get('open_basedir')), $extraDirs);
5555
$dirs = [];
5656
foreach ($searchPath as $path) {
5757
// Silencing against https://bugs.php.net/69240

0 commit comments

Comments
 (0)