8000 Merge branch '3.4' · symfony/symfony@1193c26 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1193c26

Browse files
Merge branch '3.4'
* 3.4: [HttpFoundation] Fix bad merge in NativeSessionStorage Bump phpunit-bridge requirement to 3.4|4.0 [Bridge/PhpUnit] Remove trailing "\n" from ClockMock::microtime(false) [Form] Rename `FormConfigBuilder::$nativeRequestProcessor` private variable to `::$nativeRequestHandler` Add a "link" script to ease debugging Flex apps [Form] Add phpdoc to `RequestHandlerInterface::isFileUpload()` method
2 parents 01ff6eb + 2c2044b commit 1193c26

File tree

7 files changed

+74
-7
lines changed

7 files changed

+74
-7
lines changed

link

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
10000
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/*
5+
* This file is part of the Symfony package.
6+
*
7+
* (c) Fabien Potencier <fabien@symfony.com>
8+
*
9+
* For the full copyright and license information, please view the LICENSE
10+
* file that was distributed with this source code.
11+
*/
12+
13+
require __DIR__.'/src/Symfony/Component/Filesystem/Exception/ExceptionInterface.php';
14+
require __DIR__.'/src/Symfony/Component/Filesystem/Exception/IOExceptionInterface.php';
15+
require __DIR__.'/src/Symfony/Component/Filesystem/Exception/IOException.php';
16+
require __DIR__.'/src/Symfony/Component/Filesystem/Filesystem.php';
17+
18+
use Symfony\Component\Filesystem\Filesystem;
19+
20+
/**
21+
* Links dependencies to components to a local clone of the main symfony/symfony GitHub repository.
22+
*
23+
* @author Kévin Dunglas <dunglas@gmail.com>
24+
*/
25+
26+
if (2 !== $argc) {
27+
echo 'Link dependencies to components to a local clone of the main symfony/symfony GitHub repository.'.PHP_EOL.PHP_EOL;
28+
echo "Usage: $argv[0] /path/to/the/project".PHP_EOL;
29+
exit(1);
30+
}
31+
32+
if (!is_dir("$argv[1]/vendor/symfony")) {
33+
echo "The directory \"$argv[1]\" does not exist or the dependencies are not installed, did you forget to run \"composer install\" in your project?".PHP_EOL;
34+
exit(1);
35+
}
36+
37+
$sfPackages = array('symfony/symfony' => __DIR__);
38+
foreach (glob(__DIR__.'/src/Symfony/{Bundle,Bridge,Component,Component/Security}/*', GLOB_BRACE | GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
39+
$sfPackages[json_decode(file_get_contents("$dir/composer.json"))->name] = $dir;
40+
}
41+
42+
$filesystem = new Filesystem();
43+
foreach (glob("$argv[1]/vendor/symfony/*", GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
44+
$package = 'symfony/'.basename($dir);
45+
if (is_link($dir)) {
46+
echo "\"$package\" is already a symlink, skipping.".PHP_EOL;
47+
continue;
48+
}
49+
50+
if (!isset($sfPackages[$package])) {
51+
continue;
52+
}
53+
54+
$sfDir = '\\' === DIRECTORY_SEPARATOR ? $sfPackages[$package] : $filesystem->makePathRelative($sfPackages[$package], dirname(realpath($dir)));
55+
56+
$filesystem->remove($dir);
57+
$filesystem->symlink($sfDir, $dir);
58+
echo "\"$package\" has been linked to \"$sfPackages[$package]\".".PHP_EOL;
59+
}

phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/29fa7b8196870591f35e1554dd69def482e01fb2
4+
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/6d344ad9be7566f875488aa14d905449716c06cf
55

66
if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
77
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\nPlease run `composer update` before running this command.\n";

src/Symfony/Bridge/PhpUnit/ClockMock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static function microtime($asFloat = false)
6666
return self::$now;
6767
}
6868

69-
return sprintf("%0.6f %d\n", self::$now - (int) self::$now, (int) self::$now);
69+
return sprintf('%0.6f %d', self::$now - (int) self::$now, (int) self::$now);
7070
}
7171

7272
public static function register($class)

src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ public function handleRequest(FormInterface $form, $request = null)
108108
$form->submit($data, 'PATCH' !== $method);
109109
}
110110

111+
/**
112+
* {@inheritdoc}
113+
*/
111114
public function isFileUpload($data)
112115
{
113116
return $data instanceof File;

src/Symfony/Component/Form/FormConfigBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface
3232
*
3333
* @var NativeRequestHandler
3434
*/
35-
private static $nativeRequestProcessor;
35+
private static $nativeRequestHandler;
3636

3737
/**
3838
* The accepted request methods.
@@ -496,10 +496,10 @@ public function getMethod()
496496
public function getRequestHandler()
497497
{
498498
if (null === $this->requestHandler) {
499-
if (null === self::$nativeRequestProcessor) {
500-
self::$nativeRequestProcessor = new NativeRequestHandler();
499+
if (null === self::$nativeRequestHandler) {
500+
self::$nativeRequestHandler = new NativeRequestHandler();
501501
}
502-
$this->requestHandler = self::$nativeRequestProcessor;
502+
$this->requestHandler = self::$nativeRequestHandler;
503503
}
504504

505505
return $this->requestHandler;

src/Symfony/Component/Form/NativeRequestHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ public function handleRequest(FormInterface $form, $request = null)
118118
$form->submit($data, 'PATCH' !== $method);
119119
}
120120

121+
/**
122+
* {@inheritdoc}
123+
*/
121124
public function isFileUpload($data)
122125
{
123126
// POST data will always be strings or arrays of strings. Thus, we can be sure

src/Symfony/Component/Form/RequestHandlerInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ interface RequestHandlerInterface
2727
public function handleRequest(FormInterface $form, $request = null);
2828

2929
/**
30-
* @param mixed $data
30+
* Returns true if the given data is a file upload.
31+
*
32+
* @param mixed $data The form field data
3133
*
3234
* @return bool
3335
*/

0 commit comments

Comments
 (0)
0