Skip to content

Commit 9cbec2c

Browse files
committed
Merge branch '3.0' into 3.1
* 3.0: 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 symfony#17284 [Session] fix PDO transaction aborted under PostgreSQL [Console] Use InputInterface inherited doc as possible Mention generating absolute urls in UPGRADE files and CHANGELOG add docblock type elements to support newly added IteratorAggregate::getIterator PhpStorm support FormBuilderInterface: fix getForm() return type. Fixed typo in PHPDoc
2 parents e7e9bef + be0b8f0 commit 9cbec2c

File tree

32 files changed

+216
-203
lines changed

32 files changed

+216
-203
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/Monolog/composer.json

Lines changed: 2 additions & 2 deletions
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/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
{

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

Lines changed: 13 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ abstract class Input implements InputInterface
3838
/**
3939
* Constructor.
4040
*
41-
* @param InputDefinition $definition A InputDefinition instance
41+
* @param InputDefinition|null $definition A InputDefinition instance
4242
*/
4343
public function __construct(InputDefinition $definition = null)
4444
{
@@ -51,9 +51,7 @@ public function __construct(InputDefinition $definition = null)
5151
}
5252

5353
/**
54-
* Binds the current Input instance with the given arguments and options.
55-
*
56-
* @param InputDefinition $definition A InputDefinition instance
54+
* {@inheritdoc}
5755
*/
5856
public function bind(InputDefinition $definition)
5957
{
@@ -70,9 +68,7 @@ public function bind(InputDefinition $definition)
7068
abstract protected function parse();
7169

7270
/**
73-
* Validates the input.
74-
*
75-
* @throws RuntimeException When not enough arguments are given
71+
* {@inheritdoc}
7672
*/
7773
public function validate()
7874
{
@@ -89,43 +85,31 @@ public function validate()
8985
}
9086

9187
/**
92-
* Checks if the input is interactive.
93-
*
94-
* @return bool Returns true if the input is interactive
88+
* {@inheritdoc}
9589
*/
9690
public function isInteractive()
9791
{
9892
return $this->interactive;
9993
}
10094

10195
/**
102-
* Sets the input interactivity.
103-
*
104-
* @param bool $interactive If the input should be interactive
96+
* {@inheritdoc}
10597
*/
10698
public function setInteractive($interactive)
10799
{
108100
$this->interactive = (bool) $interactive;
109101
}
110102

111103
/**
112-
* Returns the argument values.
113-
*
114-
* @return array An array of argument values
104+
* {@inheritdoc}
115105
*/
116106
public function getArguments()
117107
{
118108
return array_merge($this->definition->getArgumentDefaults(), $this->arguments);
119109
}
120110

121111
/**
122-
* Returns the argument value for a given argument name.
123-
*
124-
* @param string $name The argument name
125-
*
126-
* @return mixed The argument value
127-
*
128-
* @throws InvalidArgumentException When argument given doesn't exist
112+
* {@inheritdoc}
129113
*/
130114
public function getArgument($name)
131115
{
@@ -137,12 +121,7 @@ public function getArgument($name)
137121
}
138122

139123
/**
140-
* Sets an argument value by name.
141-
*
142-
* @param string $name The argument name
143-
* @param string $value The argument value
144-
*
145-
* @throws InvalidArgumentException When argument given doesn't exist
124+
* {@inheritdoc}
146125
*/
147126
public function setArgument($name, $value)
148127
{
@@ -154,35 +133,23 @@ public function setArgument($name, $value)
154133
}
155134

156135
/**
157-
* Returns true if an InputArgument object exists by name or position.
158-
*
159-
* @param string|int $name The InputArgument name or position
160-
*
161-
* @return bool true if the InputArgument object exists, false otherwise
136+
* {@inheritdoc}
162137
*/
163138
public function hasArgument($name)
164139
{
165140
return $this->definition->hasArgument($name);
166141
}
167142

168143
/**
169-
* Returns the options values.
170-
*
171-
* @return array An array of option values
144+
* {@inheritdoc}
172145
*/
173146
public function getOptions()
174147
{
175148
return array_merge($this->definition->getOptionDefaults(), $this->options);
176149
}
177150

178151
/**
179-
* Returns the option value for a given option name.
180-
*
181-
* @param string $name The option name
182-
*
183-
* @return mixed The option value
184-
*
185-
* @throws InvalidArgumentException When option given doesn't exist
152+
* {@inheritdoc}
186153
*/
187154
public function getOption($name)
188155
{
@@ -194,12 +161,7 @@ public function getOption($name)
194161
}
195162

196163
/**
197-
* Sets an option value by name.
198-
*
199-
* @param string $name The option name
200-
* @param string|bool $value The option value
201-
*
202-
* @throws InvalidArgumentException When option given doesn't exist
164+
* {@inheritdoc}
203165
*/
204166
public function setOption($name, $value)
205167
{
@@ -211,11 +173,7 @@ public function setOption($name, $value)
211173
}
212174

213175
/**
214-
* Returns true if an InputOption object exists by name.
215-
*
216-
* @param string $name The InputOption name
217-
*
218-
* @return bool true if the InputOption object exists, false otherwise
176+
* {@inheritdoc}
219177
*/
220178
public function hasOption($name)
221179
{

0 commit comments

Comments
 (0)