Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33e9571

Browse files
committed
Merge branch '2.2' into 2.3
* 2.2: [FrameworkBundle][Security] Replaced void return type with null for consistency fixed CS NativeSessionStorage regenerate removed unneeded comment Use setTimeZone if this method exists. Fix FileResource test fixed wrong usage of unset() [HttpFoundation] Fixed the way path to directory is trimmed. [Console] Fixed argument parsing when a single dash is passed. Conflicts: src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php
2 parents 8899e31 + 96165bc commit 33e9571

File tree

10 files changed

+20
-10
lines changed

10 files changed

+20
-10
lines changed

src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class GlobalVariables
2626
{
2727
protected $container;
2828

29+
/**
30+
* @param ContainerInterface $container The DI container
31+
*/
2932
public function __construct(ContainerInterface $container)
3033
{
3134
$this->container = $container;
@@ -46,7 +49,7 @@ public function getSecurity()
4649
/**
4750
* Returns the current user.
4851
*
49-
* @return mixed|void
52+
* @return mixed
5053
*
5154
* @see TokenInterface::getUser()
5255
*/

src/Symfony/Component/Config/Tests/Resource/FileResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FileResourceTest extends \PHPUnit_Framework_TestCase
2020

2121
protected function setUp()
2222
{
23-
$this->file = sys_get_temp_dir().'/tmp.xml';
23+
$this->file = realpath(sys_get_temp_dir()).'/tmp.xml';
2424
touch($this->file);
2525
$this->resource = new FileResource($this->file);
2626
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function parse()
8484
$parseOptions = false;
8585
} elseif ($parseOptions && 0 === strpos($token, '--')) {
8686
$this->parseLongOption($token);
87-
} elseif ($parseOptions && '-' === $token[0]) {
87+
} elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {
8888
$this->parseShortOption($token);
8989
} else {
9090
$this->parseArgument($token);

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,4 +306,11 @@ public function provideGetParameterOptionValues()
306306
array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), '1'),
307307
);
308308
}
309+
310+
public function testParseSingleDashAsArgument()
311+
{
312+
$input = new ArgvInput(array('cli.php', '-'));
313+
$input->bind(new InputDefinition(array(new InputArgument('file'))));
314+
$this->assertEquals(array('file' => '-'), $input->getArguments(), '->parse() parses single dash as an argument');
315+
}
309316
}

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function handleFatal()
137137
return;
138138
}
139139

140-
unset($this->reservedMemory);
140+
$this->reservedMemory = '';
141141
$type = $error['type'];
142142
if (0 === $this->level || !in_array($type, array(E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE))) {
143143
return;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ private function formatTimestamps(\IntlDateFormatter $formatter, $regex, array $
247247
$pattern = $formatter->getPattern();
248248
$timezone = $formatter->getTimezoneId();
249249

250-
if (version_compare(\PHP_VERSION, '5.5.0-dev', '>=')) {
250+
if ($setTimeZone = method_exists($formatter, 'setTimeZone')) {
251251
$formatter->setTimeZone('UTC');
252252
} else {
253253
$formatter->setTimeZoneId('UTC');
@@ -265,7 +265,7 @@ private function formatTimestamps(\IntlDateFormatter $formatter, $regex, array $
265265
$formatter->setPattern($pattern);
266266
}
267267

268-
if (version_compare(\PHP_VERSION, '5.5.0-dev', '>=')) {
268+
if ($setTimeZone) {
269269
$formatter->setTimeZone($timezone);
270270
} else {
271271
$formatter->setTimeZoneId($timezone);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected function getTargetFile($directory, $name = null)
137137
throw new FileException(sprintf('Unable to write in the "%s" directory', $directory));
138138
}
139139

140-
$target = trim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));
140+
$target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));
141141

142142
return new File($target, false);
143143
}

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ public function regenerate($destroy = false, $lifetime = null)
219219
} else {
220220
session_start();
221221
}
222+
223+
$this->loadSession();
222224
}
223225

224226
return $ret;

src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function onKernelResponse(FilterResponseEvent $event)
136136
if ($master) {
137137
$this->saveProfiles($profile);
138138

139-
unset($this->children);
139+
$this->children = new \SplObjectStorage();
140140
}
141141
}
142142

src/Symfony/Component/Security/Core/User/UserInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ public function getUsername();
8080
*
8181
* This is important if, at any given point, sensitive information like
8282
* the plain-text password is stored on this object.
83-
*
84-
* @return void
8583
*/
8684
public function eraseCredentials();
8785
}

0 commit comments

Comments
 (0)