8000 Merge branch '3.0' · symfony/symfony@728bb0f · GitHub
[go: up one dir, main page]

Skip to content

Commit 728bb0f

Browse files
Merge branch '3.0'
* 3.0: [Validator] Test DNS Url constraints using checkdnsrr() mock 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 #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: phpunit.xml.dist
2 parents 04eed4e + 1b3ad91 commit 728bb0f

File tree

20 files changed

+171
-61
lines changed

20 files changed

+171
-61
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ addons:
1515
env:
1616
global:
1717
- MIN_PHP=5.5.9
18+
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/versions/5.6/bin/php
1819

1920
matrix:
2021
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: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@
5656
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
5757
<arguments>
5858
<array>
59-
<element><string>Cache\IntegrationTests</string></element>
60-
<element><string>Doctrine\Common\Cache</string></element>
61-
<element><string>Symfony\Component\HttpFoundation</string></element>
59+
<element key="time-sensitive">
60+
<array>
61+
<element><string>Cache\IntegrationTests</string></element>
62+
<element><string>Doctrine\Common\Cache</string></element>
63+
<element><string>Symfony\Component\HttpFoundation</string></element>
64+
</array>
65+
</element>
6266
</array>
6367
</arguments>
6468
</listener>

src/Symfony/Bridge/Propel1/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Symfony/Bridge/Swiftmailer/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

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
@@ -163,7 +163,15 @@ public function reverseTransform($value)
163163
$value = str_replace(',', $decSep, $value);
164164
}
165165

166-
$result = $formatter->parse($value, \NumberFormatter::TYPE_DOUBLE, $position);
166+
if (false !== strpos($value, $decSep)) {
167+
$type = \NumberFormatter::TYPE_DOUBLE;
168+
} else {
169+
$type = PHP_INT_SIZE === 8
170+
? \NumberFormatter::TYPE_INT64
171+
: \NumberFormatter::TYPE_INT32;
172+
}
173+
174+
$result = $formatter->parse($value, $type, $position);
167175

168176
if (intl_is_failure($formatter->getErrorCode())) {
169177
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
@@ -636,4 +636,11 @@ public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte()
636636

637637
$transformer->reverseTransform("12\xc2\xa0345,678foo");
638638
}
639+
640+
public function testReverseTransformBigint()
641+
{
642+
$transformer = new NumberToLocalizedStringTransformer(null, true);
643+
644+
$this->assertEquals(PHP_INT_MAX - 1, (int) $transformer->reverseTransform((string) (PHP_INT_MAX - 1)));
645+
}
639646
}

0 commit comments

Comments
 (0)
0