Skip to content

Commit c7686a3

Browse files
Merge branch '2.3' into 2.7
* 2.3: Improved the PHPdoc of FileSystem::copy() [Validator] Test DNS Email constraints using checkdnsrr() mock [travis] Run real php subprocesses on hhvm for Process component tests bug symfony#18161 [Translation] Add support for fuzzy tags in PoFileLoader [Form] Fix NumberToLocalizedStringTransformer::reverseTransform with big integers [Form] Fix INT64 cast to float in IntegerType. [SecurityBundle][PHPDoc] Added method doumentation for SecurityFactoryInterface FrameworkBundle: Client: getContainer(): fixed phpdoc [Validator] Updating inaccurate docblock comment Conflicts: .travis.yml src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php
2 parents 67e9ba0 + 56624e6 commit c7686a3

File tree

16 files changed

+132
-26
lines changed

16 files changed

+132
-26
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ addons:
1313
env:
1414
global:
1515
- MIN_PHP=5.3.9
16+
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/versions/5.6/bin/php
1617

1718
matrix:
1819
include:

phpunit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
// Please update when phpunit needs to be reinstalled with fresh deps:
14-
// Cache-Id-Version: 2015-11-28 09:05 UTC
14+
// Cache-Id-Version: 2016-03-16 15:36 UTC
1515

1616
use Symfony\Component\Process\ProcessUtils;
1717

@@ -52,7 +52,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
5252
$zip->close();
5353
chdir("phpunit-$PHPUNIT_VERSION");
5454
passthru("$COMPOSER remove --no-update symfony/yaml");
55-
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
55+
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=3.1@dev\"");
5656
passthru("$COMPOSER install --prefer-dist --no-progress --ansi");
5757
file_put_contents('phpunit', <<<EOPHP
5858
<?php

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
5353
<arguments>
5454
<array>
55-
<element><string>Symfony\Component\HttpFoundation</string></element>
55+
<element key="time-sensitive"><string>Symfony\Component\HttpFoundation</string></element>
5656
</array>
5757
</arguments>
5858
</listener>

src/Symfony/Bundle/FrameworkBundle/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(KernelInterface $kernel, array $server = array(), Hi
4242
/**
4343
* Returns the container.
4444
*
45-
* @return ContainerInterface
45+
* @return ContainerInterface|null Returns null when the Kernel has been shutdown or not started yet
4646
*/
4747
public function getContainer()
4848
{

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@
2121
*/
2222
interface SecurityFactoryInterface
2323
{
24+
/**
25+
* Configures the container services required to use the authentication listener.
26+
*
27+
* @param ContainerBuilder $container
28+
* @param string $id The unique id of the firewall
29+
* @param array $config The options array for the listener
30+
* @param string $userProvider The service id of the user provider
31+
* @param string $defaultEntryPoint
32+
*
33+
* @return array containing three values:
34+
* - the provider id
35+
* - the listener id
36+
* - the entry point id
37+
*/
2438
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint);
2539

2640
/**
@@ -31,6 +45,12 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
3145
*/
3246
public function getPosition();
3347

48+
/**
49+
* Defines the configuration key used to reference the provider
50+
* in the firewall configuration.
51+
*
52+
* @return string
53+
*/
3454
public function getKey();
3555

3656
public function addConfiguration(NodeDefinition $builder);

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ class Filesystem
2424
/**
2525
* Copies a file.
2626
*
27-
* This method only copies the file if the origin file is newer than the target file.
27+
* If the target file is older than the origin file, it's always overwritten.
28+
* If the target file is newer, it is overwritten only when the
29+
* $overwriteNewerFiles option is set to true.
2830
*
29-
* By default, if the target already exists, it is not overridden.
30-
*
31-
* @param string $originFile The original filename
32-
* @param string $targetFile The target filename
33-
* @param bool $override Whether to override an existing file or not
31+
* @param string $originFile The original filename
32+
* @param string $targetFile The target filename
33+
* @param bool $overwriteNewerFiles If true, target files newer than origin files are overwritten
3434
*
3535
* @throws FileNotFoundException When originFile doesn't exist
3636
* @throws IOException When copy fails
3737
*/
38-
public function copy($originFile, $targetFile, $override = false)
38+
public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
3939
{
4040
if (stream_is_local($originFile) && !is_file($originFile)) {
4141
throw new FileNotFoundException(sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile);
@@ -44,7 +44,7 @@ public function copy($originFile, $targetFile, $override = false)
4444
$this->mkdir(dirname($targetFile));
4545

4646
$doCopy = true;
47-
if (!$override && null === parse_url($originFile, PHP_URL_HOST) && is_file($targetFile)) {
47+
if (!$overwriteNewerFiles && null === parse_url($originFile, PHP_URL_HOST) && is_file($targetFile)) {
4848
$doCopy = filemtime($originFile) > filemtime($targetFile);
4949
}
5050

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,15 @@ public function reverseTransform($value)
187187
$value = str_replace(',', $decSep, $value);
188188
}
189189

190-
$result = $formatter->parse($value, \NumberFormatter::TYPE_DOUBLE, $position);
190+
if (false !== strpos($value, $decSep)) {
191+
$type = \NumberFormatter::TYPE_DOUBLE;
192+
} else {
193+
$type = PHP_INT_SIZE === 8
194+
? \NumberFormatter::TYPE_INT64
195+
: \NumberFormatter::TYPE_INT32;
196+
}
197+
198+
$result = $formatter->parse($value, $type, $position);
191199

192200
if (intl_is_failure($formatter->getErrorCode())) {
193201
throw new TransformationFailedException($formatter->getErrorMessage());

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,4 +641,11 @@ public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte()
641641

642642
$transformer->reverseTransform("12\xc2\xa0345,678foo");
643643
}
644+
645+
public function testReverseTransformBigint()
646+
{
647+
$transformer = new NumberToLocalizedStringTransformer(null, true);
648+
649+
$this->assertEquals(PHP_INT_MAX - 1, (int) $transformer->reverseTransform((string) (PHP_INT_MAX - 1)));
650+
}
644651
}

src/Symfony/Component/HttpKernel/Tests/HttpCache/ResponseCacheStrategyTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
namespace Symfony\Component\HttpKernel\Tests\HttpCache;
1717

1818
use Symfony\Component\HttpFoundation\Response;
19-
use Symfony\Component\HttpKernel\HttpCache\EsiResponseCacheStrategy;
19+
use Symfony\Component\HttpKernel\HttpCache\ResponseCacheStrategy;
2020

21-
class EsiResponseCacheStrategyTest extends \PHPUnit_Framework_TestCase
21+
class ResponseCacheStrategyTest extends \PHPUnit_Framework_TestCase
2222
{
2323
public function testMinimumSharedMaxAgeWins()
2424
{
25-
$cacheStrategy = new EsiResponseCacheStrategy();
25+
$cacheStrategy = new ResponseCacheStrategy();
2626

2727
$response1 = new Response();
2828
$response1->setSharedMaxAge(60);
@@ -41,7 +41,7 @@ public function testMinimumSharedMaxAgeWins()
4141

4242
public function testSharedMaxAgeNotSetIfNotSetInAnyEmbeddedRequest()
4343
{
44-
$cacheStrategy = new EsiResponseCacheStrategy();
44+
$cacheStrategy = new ResponseCacheStrategy();
4545

4646
$response1 = new Response();
4747
$response1->setSharedMaxAge(60);
@@ -59,7 +59,7 @@ public function testSharedMaxAgeNotSetIfNotSetInAnyEmbeddedRequest()
5959

6060
public function testSharedMaxAgeNotSetIfNotSetInMasterRequest()
6161
{
62-
$cacheStrategy = new EsiResponseCacheStrategy();
62+
$cacheStrategy = new ResponseCacheStrategy();
6363

6464
$response1 = new Response();
6565
$response1->setSharedMaxAge(60);

src/Symfony/Component/HttpKernel/phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
3131
<arguments>
3232
<array>
33-
<element><string>Symfony\Component\HttpFoundation</string></element>
33+
<element key="time-sensitive"><string>Symfony\Component\HttpFoundation</string></element>
3434
</array>
3535
</arguments>
3636
</listener>

0 commit comments

Comments
 (0)