8000 Merge branch '3.1' · symfony/symfony@0691506 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0691506

Browse files
committed
Merge branch '3.1'
* 3.1: fixed CS fixed CS fixed CS fixed CS tweaked default CS fixer config [HttpKernel] Dont close the output stream in debug move HttpKernel component to require section Fixed oci and sqlsrv merge queries when emulation is disabled - fixes #17284 [Session] fix PDO transaction aborted under PostgreSQL [Console] Use InputInterface inherited doc as possible Mention generating absolute urls in UPGRADE files and CHANGELOG parse embedded mappings only if value is a string add docblock type elements to support newly added IteratorAggregate::getIterator PhpStorm support FormBuilderInterface: fix getForm() return type. [YAML] Fixed parsing problem with nested DateTime lists Fixed typo in PHPDoc
2 parents a4ce063 + 04f2659 commit 0691506

File tree

48 files changed

+253
-245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+253
-245
lines changed

.php_cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
return Symfony\CS\Config\Config::create()
44
->setUsingLinter(false)
55
->setUsingCache(true)
6+
->fixers(array(
7+
'long_array_syntax',
8+
'php_unit_construct',
9+
))
610
->finder(
711
Symfony\CS\Finder\DefaultFinder::create()
812
->in(__DIR__)
@@ -12,6 +16,9 @@ return Symfony\CS\Config\Config::create()
1216
'src/Symfony/Component/Routing/Tests/Fixtures/dumper',
1317
// fixture templates
1418
'src/Symfony/Component/Templating/Tests/Fixtures/templates',
19+
'src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
20+
// generated fixtures
21+
'src/Symfony/Component/VarDumper/Tests/Fixtures',
1522
// resource templates
1623
'src/Symfony/Bundle/FrameworkBundle/Resources/views/Form',
1724
))

UPGRADE-3.0.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,30 @@ UPGRADE FROM 2.x to 3.0
939939
* The `getMatcherDumperInstance()` and `getGeneratorDumperInstance()` methods in the
940940
`Symfony\Component\Routing\Router` have been changed from `public` to `protected`.
941941

942+
* Use the constants defined in the UrlGeneratorInterface for the $referenceType argument of the UrlGeneratorInterface::generate method.
943+
944+
Before:
945+
946+
```php
947+
// url generated in controller
948+
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
949+
950+
// url generated in @router service
951+
$router->generate('blog_show', array('slug' => 'my-blog-post'), true);
952+
```
953+
954+
After:
955+
956+
```php
957+
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
958+
959+
// url generated in controller
960+
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
961+
962+
// url generated in @router service
963+
$router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
964+
```
965+
942966
### Security
943967

944968
* The `vote()` method from the `VoterInterface` was changed to now accept arbitrary

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ class RegisterMappingsPassTest extends \PHPUnit_Framework_TestCase
1414
*/
1515
public function testNoDriverParmeterException()
1616
{
17-
$container = $this->createBuilder([
17+
$container = $this->createBuilder(array(
1818

19-
]);
20-
$this->process($container, [
19+
));
20+
$this->process($container, array(
2121
'manager.param.one',
2222
'manager.param.two',
23-
]);
23+
));
2424
}
2525

2626
private function process(ContainerBuilder $container, array $managerParamNames)
2727
{
2828
$pass = new ConcreteMappingsPass(
2929
new Definition('\stdClass'),
30-
[],
30+
array(),
3131
$managerParamNames,
3232
'some.%s.metadata_driver'
3333
);

src/Symfony/Bridge/Monolog/composer.json

Lines changed: 2 additions & 2 deletions
< F438 thead class="sr-only">
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
],
1818
"require": {
1919
"php": ">=5.5.9",
20-
"monolog/monolog": "~1.11"
20+
"monolog/monolog": "~1.11",
21+
"symfony/http-kernel": "~2.8|~3.0"
2122
},
2223
"require-dev": {
23-
"symfony/http-kernel": "~2.8|~3.0",
2424
"symfony/console": "~2.8|~3.0",
2525
"symfony/event-dispatcher": "~2.8|~3.0"
2626
},

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function listBundles($output)
3232
$rows = array();
3333

3434
$bundles = $this->getContainer()->get('kernel')->getBundles();
35-
usort($bundles, function($bundleA, $bundleB) {
35+
usort($bundles, function ($bundleA, $bundleB) {
3636
return strcmp($bundleA->getName(), $bundleB->getName());
3737
});
3838

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
276276

277277
$calls = $definition->getMethodCalls();
278278
if (count($calls) > 0) {
279-
$callInformation = [];
279+
$callInformation = array();
280280
foreach ($calls as $call) {
281281
$callInformation[] = $call[0];
282282
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
913913
// Run after serializer.normalizer.object
914914
$definition = $container->register('serializer.normalizer.data_uri', DataUriNormalizer::class);
915915
$definition->setPublic(false);
916-
$definition->addTag('serializer.normalizer', ['priority' => -920]);
916+
$definition->addTag('serializer.normalizer', array('priority' => -920));
917917
}
918918

919919
if (class_exists('Symfony\Component\Serializer\Normalizer\DateTimeNormalizer')) {

src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/AssetsHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function setUp()
2525
$fooPackage = new Package(new StaticVersionStrategy('42', '%s?v=%s'));
2626
$barPackage = new Package(new StaticVersionStrategy('22', '%s?%s'));
2727

28-
$packages = new Packages($fooPackage, ['bar' => $barPackage]);
28+
$packages = new Packages($fooPackage, array('bar' => $barPackage));
2929

3030
$this->helper = new AssetsHelper($packages);
3131
}

src/Symfony/Component/Console/Helper/HelperSet.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
*/
2222
class HelperSet implements \IteratorAggregate
2323
{
24+
/**
25+
* @var Helper[]
26+
*/
2427
private $helpers = array();
2528
private $command;
2629

@@ -102,6 +105,9 @@ public function getCommand()
102105
return $this->command;
103106
}
104107

108+
/**
109+
* @return Helper[]
110+
*/
105111
public function getIterator()
106112
{
107113
return new \ArrayIterator($this->helpers);

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

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class ArgvInput extends Input
4646
/**
4747
* Constructor.
4848
*
49-
* @param array $argv An array of parameters from the CLI (in the argv format)
50-
* @param InputDefinition $definition A InputDefinition instance
49+
* @param array|null $argv An array of parameters from the CLI (in the argv format)
50+
* @param InputDefinition|null $definition A InputDefinition instance
5151
*/
5252
public function __construct(array $argv = null, InputDefinition $definition = null)
5353
{
@@ -69,7 +69,7 @@ protected function setTokens(array $tokens)
6969
}
7070

7171
/**
72-
* Processes command line arguments.
72+
* {@inheritdoc}
7373
*/
7474
protected function parse()
7575
{
@@ -253,9 +253,7 @@ private function addLongOption($name, $value)
253253
}
254254

255255
/**
256-
* Returns the first argument from the raw parameters (not parsed).
257-
*
258-
* @return string The value of the first argument or null otherwise
256+
* {@inheritdoc}
259257
*/
260258
public function getFirstArgument()
261259
{
@@ -269,15 +267,7 @@ public function getFirstArgument()
269267
}
270268

271269
/**
272-
* Returns true if the raw parameters (not parsed) contain a value.
273-
*
274-
* This method is to be used to introspect the input parameters
275-
* before they have been validated. It must be used carefully.
276-
*
277-
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
278-
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
279-
*
280-
* @return bool true if the value is contained in the raw parameters
270+
* {@inheritdoc}
281271
*/
282272
public function hasParameterOption($values, $onlyParams = false)
283273
{
@@ -298,16 +288,7 @@ public function hasParameterOption($values, $onlyParams = false)
298288
}
299289

300290
/**
301-
* Returns the value of a raw option (not parsed).
302-
*
303-
* This method is to be used to introspect the input parameters
304-
* before they have been validated. It must be used carefully.
305-
*
306-
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
307-
* @param mixed $default The default value to return if no result is found
308-
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
309-
*
310-
* @return mixed The option value
291+
* {@inheritdoc}
311292
*/
312293
public function getParameterOption($values, $default = false, $onlyParams = false)
313294
{

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

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class ArrayInput extends Input
3030
/**
3131
* Constructor.
3232
*
33-
* @param array $parameters An array of parameters
34-
* @param InputDefinition $definition A InputDefinition instance
33+
* @param array $parameters An array of parameters
34+
* @param InputDefinition|null $definition A InputDefinition instance
3535
*/
3636
public function __construct(array $parameters, InputDefinition $definition = null)
3737
{
@@ -41,9 +41,7 @@ public function __construct(array $parameters, InputDefinition $definition = nul
4141
}
4242

4343
/**
44-
* Returns the first argument from the raw parameters (not parsed).
45-
*
46-
* @return string The value of the first argument or null otherwise
44+
* {@inheritdoc}
4745
*/
4846
public function getFirstArgument()
4947
{
@@ -57,15 +55,7 @@ public function getFirstArgument()
5755
}
5856

5957
/**
60-
* Returns true if the raw parameters (not parsed) contain a value.
61-
*
62-
* This method is to be used to introspect the input parameters
63-
* before they have been validated. It must be used carefully.
64-
*
65-
* @param string|array $values The values to look for in the raw parameters (can be an array)
66-
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
67-
*
68-
* @return bool true if the value is contained in the raw parameters
58+
* {@inheritdoc}
6959
*/
7060
public function hasParameterOption($values, $onlyParams = false)
7161
{
@@ -89,16 +79,7 @@ public function hasParameterOption($values, $onlyParams = false)
8979
}
9080

9181
/**
92-
* Returns the value of a raw option (not parsed).
93-
*
94-
* This method is to be used to introspect the input parameters
95-
* before they have been validated. It must be used carefully.
96-
*
97-
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
98-
* @param mixed $default The default value to return if no result is found
99-
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
100-
*
101-
* @return mixed The option value
82+
* {@inheritdoc}
10283
*/
10384
public function getParameterOption($values, $default = false, $onlyParams = false)
10485
{
@@ -141,7 +122,7 @@ public function __toString()
141122
}
142123

143124
/**
144-
* Processes command line arguments.
125+
* {@inheritdoc}
145126
*/
146127
protected function parse()
147128
{

0 commit comments

Comments
 (0)
0