10000 Merge branch '2.6' into 2.7 · symfony/symfony@bbd4a1e · GitHub
[go: up one dir, main page]

Skip to content

Commit bbd4a1e

Browse files
committed
Merge branch '2.6' into 2.7
Conflicts: src/Symfony/Component/PropertyAccess/PropertyAccessor.php src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
2 parents 9a4f3e1 + f9ddaeb commit bbd4a1e

35 files changed

+407
-315
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
803803

804804
if ('file' === $config['cache']) {
805805
$cacheDir = $container->getParameterBag()->resolveValue($config['file_cache_dir']);
806-
if (!is_dir($cacheDir) && false === @mkdir($cacheDir, 0777, true)) {
806+
if (!is_dir($cacheDir) && false === @mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
807807
throw new \RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir));
808808
}
809809

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ interface SecurityFactoryInterface
2323
{
2424
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint);
2525

26+
/**
27+
* Defines the position at which the provider is called.
28+
* Possible values: pre_auth, form, http, and remember_me.
29+
*
30+
* @return string
31+
*/
2632
public function getPosition();
2733

2834
public function getKey();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
{% set link = collector.controller.file|file_link(collector.controller.line) %}
77
{% if collector.controller.method %}
88
<span class="sf-toolbar-info-class sf-toolbar-info-with-next-pointer">{{ collector.controller.class|abbr_class }}</span>
9-
<span class="sf-toolbar-info-method" onclick="{% if link %}window.location='{{link|e('js')}}';window.event.stopPropagation();return false;{% endif %}">
9+
<span class="sf-toolbar-info-method"{% if link %} onclick="window.location='{{link|e('js')}}';window.event.stopPropagation();return false;"{% endif %}>
1010
{{ collector.controller.method }}
1111
</span>
1212
{% else %}
13-
<span class="sf-toolbar-info-class" onclick="{% if link %}window.location='{{link|e('js')}}';window.event.stopPropagation();return false;{% endif %}">{{ collector.controller.class|abbr_class }}</span>
13+
<span class="sf-toolbar-info-class"{% if link %} onclick="window.location='{{link|e('js')}}';window.event.stopPropagation();return false;"{% endif %}>{{ collector.controller.class|abbr_class }}</span>
1414
{% endif %}
1515
{% else %}
1616
<span class="sf-toolbar-info-class">{{ collector.controller }}</span>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
174174
var addEventListener;
175175
176-
if (document.addEventListener) {
176+
if (document.attachEvent) {
177177
addEventListener = function (element, eventName, callback) {
178178
element.attachEvent('on' + eventName, callback);
179179
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div id="sfToolbarClearer-{{ token }}" style="clear: both; height: 38px;"></div>
2525
{% endif %}
2626

27-
<div id="sfToolbarMainContent-{{ token }}" class="sf-toolbarreset" data-no-turbolink>
27+
<div id="sfToolbarMainContent-{{ token }}" class="sf-toolbarreset clear-fix" data-no-turbolink>
2828
{% for name, template in templates %}
2929
{{ template.renderblock('toolbar', {
3030
'collector': profile.getcollector(name),

src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class EnumNodeDefinition extends ScalarNodeDefinition
2222
{
2323
private $values;
2424

25+
/**
26+
* @param array $values
27+
*
28+
* @return EnumNodeDefinition|$this
29+
*/
2530
public function values(array $values)
2631
{
2732
$values = array_unique($values);

src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct($name, NodeParentInterface $parent = null)
5656
*
5757
* @param NodeParentInterface $parent The parent
5858
*
59-
* @return NodeDefinition
59+
* @return NodeDefinition|$this
6060
*/
6161
public function setParent(NodeParentInterface $parent)
6262
{
@@ -70,7 +70,7 @@ public function setParent(NodeParentInterface $parent)
7070
*
7171
* @param string $info The info text
7272
*
73-
* @return NodeDefinition
73+
* @return NodeDefinition|$this
7474
*/
7575
public function info($info)
7676
{
@@ -82,7 +82,7 @@ public function info($info)
8282
*
8383
* @param string|array $example
8484
*
85-
* @return NodeDefinition
85+
* @return NodeDefinition|$this
8686
*/
8787
public function example($example)
8888
{
@@ -95,7 +95,7 @@ public function example($example)
9595
* @param string $key
9696
* @param mixed $value
9797
*
98-
* @return NodeDefinition
98+
* @return NodeDefinition|$this
9999
*/
100100
public function attribute($key, $value)
101101
{
@@ -146,7 +146,7 @@ public function getNode($forceRootNode = false)
146146
*
147147
* @param mixed $value The default value
148148
*
149-
* @return NodeDefinition
149+
* @return NodeDefinition|$this
150150
*/
151151
public function defaultValue($value)
152152
{
@@ -159,7 +159,7 @@ public function defaultValue($value)
159159
/**
160160
* Sets the node as required.
161161
*
162-
* @return NodeDefinition
162+
* @return NodeDefinition|$this
163163
*/
164164
public function isRequired()
165165
{
@@ -173,7 +173,7 @@ public function isRequired()
173173
*
174174
* @param mixed $value
175175
*
176-
* @return NodeDefinition
176+
* @return NodeDefinition|$this
177177
*/
178178
public function treatNullLike($value)
179179
{
@@ -187,7 +187,7 @@ public function treatNullLike($value)
187187
*
188188
* @param mixed $value
189189
*
190-
* @return NodeDefinition
190+
* @return NodeDefinition|$this
191191
*/
192192
public function treatTrueLike($value)
193193
{
@@ -201,7 +201,7 @@ public function treatTrueLike($value)
201201
*
202202
* @param mixed $value
203203
*
204-
* @return NodeDefinition
204+
* @return NodeDefinition|$this
205205
*/
206206
public function treatFalseLike($value)
207207
{
@@ -213,7 +213,7 @@ public function treatFalseLike($value)
213213
/**
214214
* Sets null as the default value.
215215
*
216-
* @return NodeDefinition
216+
* @return NodeDefinition|$this
217217
*/
218218
public function defaultNull()
219219
{
@@ -223,7 +223,7 @@ public function defaultNull()
223223
/**
224224
* Sets true as the default value.
225225
*
226-
* @return NodeDefinition
226+
* @return NodeDefinition|$this
227227
*/
228228
public function defaultTrue()
229229
{
@@ -233,7 +233,7 @@ public function defaultTrue()
233233
/**
234234
* Sets false as the default value.
235235
*
236-
* @return NodeDefinition
236+
* @return NodeDefinition|$this
237237
*/
238238
public function defaultFalse()
239239
{
@@ -253,7 +253,7 @@ public function beforeNormalization()
253253
/**
254254
* Denies the node value being empty.
255255
*
256-
* @return NodeDefinition
256+
* @return NodeDefinition|$this
257257
*/
258258
public function cannotBeEmpty()
259259
{
@@ -281,7 +281,7 @@ public function validate()
281281
*
282282
* @param bool $deny Whether the overwriting is forbidden or not
283283
*
284-
* @return NodeDefinition
284+
* @return NodeDefinition|$this
285285
*/
286286
public function cannotBeOverwritten($deny = true)
287287
{

src/Symfony/Component/Console/Command/Command.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
173173
/**
174174
* Interacts with the user.
175175
*
176+
* This method is executed before the InputDefinition is validated.
177+
* This means that this is the only place where the command can
178+
* interactively ask for values of missing required arguments.
179+
*
176180
* @param InputInterface $input An InputInterface instance
177181
* @param OutputInterface $output An OutputInterface instance
178182
*/

src/Symfony/Component/Console/Input/ArrayInput.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ public function getParameterOption($values, $default = false)
100100
$values = (array) $values;
101101

102102
foreach ($this->parameters as $k => $v) {
103-
if (is_int($k) && in_array($v, $values)) {
104-
return true;
103+
if (is_int($k)) {
104+
if (in_array($v, $values)) {
105+
return true;
106+
}
105107
} elseif (in_array($k, $values)) {
106108
return $v;
107109
}

src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ public function testHasParameterOption()
3838
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
3939
}
4040

41+
public function testGetParameterOption()
42+
{
43+
$input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar'));
44+
$this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
45+
46+
$input = new ArrayInput(array('Fabien', '--foo' => 'bar'));
47+
$this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
48+
}
49+
4150
public function testParseArguments()
4251
{
4352
$input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'))));

src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,15 @@ public function testGetOptionDefaults()
341341
new InputOption('foo7', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', array(1, 2)),
342342
));
343343
$defaults = array(
344-
'foo1' => null,
344+
'foo1' => false,
345345
'foo2' => null,
346346
'foo3' => 'default',
347347
'foo4' => null,
348348
'foo5' => 'default',
349349
'foo6' => array(),
350350
'foo7' => array(1, 2),
351351
);
352-
$this->assertEquals($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options');
352+
$this->assertSame($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options');
353353
}
354354

355355
public function testGetSynopsis()

src/Symfony/Component/Finder/Finder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public function depth($level)
234234
* $finder->date('> now - 2 hours');
235235
* $finder->date('>= 2005-10-15');
236236
*
237-
* @param string $date A date rage string
237+
* @param string $date A date range string
238238
*
239239
* @return Finder The current Finder instance
240240
*

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ CHANGELOG
1010
2.6.2
1111
-----
1212

13-
* Added back the `model_timezone` and `view_timezone` options for `TimeType`, `DateType`
14-
and `BirthdayType`
13+
* Added back the `model_timezone` and `view_timezone` options for `TimeType`, `DateType`
14+
and `BirthdayType`
1515

1616
2.6.0
1717
-----

src/Symfony/Component/HttpFoundation/File/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function move($directory, $name = null)
130130
protected function getTargetFile($directory, $name = null)
131131
{
132132
if (!is_dir($directory)) {
133-
if (false === @mkdir($directory, 0777, true)) {
133+
if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) {
134134
throw new FileException(sprintf('Unable to create the "%s" directory', $directory));
135135
}
136136
} elseif (!is_writable($directory)) {

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,8 @@ public static function getTrustedHosts()
616616
* The following header keys are supported:
617617
*
618618
* * Request::HEADER_CLIENT_IP: defaults to X-Forwarded-For (see getClientIp())
619-
* * Request::HEADER_CLIENT_HOST: defaults to X-Forwarded-Host (see getClientHost())
620-
* * Request::HEADER_CLIENT_PORT: defaults to X-Forwarded-Port (see getClientPort())
619+
* * Request::HEADER_CLIENT_HOST: defaults to X-Forwarded-Host (see getHost())
620+
* * Request::HEADER_CLIENT_PORT: defaults to X-Forwarded-Port (see getPort())
621621
* * Request::HEADER_CLIENT_PROTO: defaults to X-Forwarded-Proto (see getScheme() and isSecure())
622622
*
623623
* Setting an empty value allows to disable the trusted header for the given key.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function dump(Data $data)
115115

116116
if (false === $name) {
117117
$name = strtr($file, '\\', '/');
118-
$name = substr($file, strrpos($file, '/') + 1);
118+
$name = substr($name, strrpos($name, '/') + 1);
119119
}
120120

121121
$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt');

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ protected function buildContainer()
614614
{
615615
foreach (array('cache' => $this->getCacheDir(), 'logs' => $this->getLogDir()) as $name => $dir) {
616616
if (!is_dir($dir)) {
617-
if (false === @mkdir($dir, 0777, true)) {
617+
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
618618
throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir));
619619
}
620620
} elseif (!is_writable($dir)) {

0 commit comments

Comments
 (0)
0