8000 Merge branch '2.7' into 2.8 · symfony/symfony@7236571 · GitHub
[go: up one dir, main page]

6607 Skip to content

Commit 7236571

Browse files
Merge branch '2.7' into 2.8
Conflicts: src/Symfony/Component/Security/Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php src/Symfony/Component/Security/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php src/Symfony/Component/Security/composer.json
2 parents a1c7af1 + 380e2ba commit 7236571

File tree

22 files changed

+157
-52
lines changed

22 files changed

+157
-52
lines changed

src/Symfony/Bridge/Twig/Command/DebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private function getMetadata($type, $entity)
149149
return;
150150
}
151151
$refl = new \ReflectionMethod($cb[0], $cb[1]);
152-
} elseif (is_object($cb) && is_callable($cb)) {
152+
} elseif (is_object($cb) && method_exists($cb, '__invoke')) {
153153
$refl = new \ReflectionMethod($cb, '__invoke');
154154
} elseif (function_exists($cb)) {
155155
$refl = new \ReflectionFunction($cb);

src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<service id="debug.debug_handlers_listener" class="%debug.debug_handlers_listener.class%">
1515
<tag name="kernel.event_subscriber" />
1616
<tag name="monolog.logger" channel="php" />
17-
<argument /><!-- Exception handler -->
17+
<argument>null</argument><!-- Exception handler -->
1818
<argument type="service" id="logger" on-invalid="null" />
1919
<argument>null</argument><!-- Log levels map for enabled error levels -->
2020
<argument>null</argument>

src/Symfony/Component/Console/Descriptor/ApplicationDescription.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,17 @@ private function inspectApplication()
137137
private function sortCommands(array $commands)
138138
{
139139
$namespacedCommands = array();
140+
$globalCommands = array();
140141
foreach ($commands as $name => $command) {
141142
$key = $this->application->extractNamespace($name, 1);
142143
if (!$key) {
143-
$key = '_global';
144+
$globalCommands['_global'][$name] = $command;
145+
} else {
146+
$namespacedCommands[$key][$name] = $command;
144147
}
145-
146-
$namespacedCommands[$key][$name] = $command;
147148
}
148149
ksort($namespacedCommands);
150+
$namespacedCommands = array_merge($globalCommands, $namespacedCommands);
149151

150152
foreach ($namespacedCommands as &$commandsSet) {
151153
ksort($commandsSet);

src/Symfony/Component/Console/Question/Question.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function getMaxAttempts()
220220
*
221221
* The normalizer can be a callable (a string), a closure or a class implementing __invoke.
222222
*
223-
* @param string|\Closure $normalizer
223+
* @param callable $normalizer
224224
*
225225
* @return Question The current instance
226226
*/
@@ -236,7 +236,7 @@ public function setNormalizer($normalizer)
236236
*
237237
* The normalizer can ba a callable (a string), a closure or a class implementing __invoke.
238238
*
239-
* @return string|\Closure
239+
* @return callable
240240
*/
241241
public function getNormalizer()
242242
{

src/Symfony/Component/Console/Tests/Command/ListCommandTest.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,52 @@ public function testExecuteListsCommandsWithNamespaceArgument()
6161

6262
$this->assertEquals($output, $commandTester->getDisplay(true));
6363
}
64+
65+
public function testExecuteListsCommandsOrder()
66+
{
67+
require_once realpath(__DIR__.'/../Fixtures/Foo6Command.php');
68+
$application = new Application();
69+
$application->add(new \Foo6Command());
70+
E377 $commandTester = new CommandTester($command = $application->get('list'));
71+
$commandTester->execute(array('command' => $command->getName()), array('decorated' => false));
72+
$output = <<<EOF
73+
Console Tool
74+
75+
Usage:
76+
command [options] [arguments]
77+
78+
Options:
79+
-h, --help Display this help message
80+
-q, --quiet Do not output any message
81+
-V, --version Display this application version
82+
--ansi Force ANSI output
83+
--no-ansi Disable ANSI output
84+
-n, --no-interaction Do not ask any interactive question
85+
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
86+
87+
Available commands:
88+
help Displays help for a command
89+
list Lists commands
90+
0foo
91+
0foo:bar 0foo:bar command
92+
EOF;
93+
94+
$this->assertEquals($output, trim($commandTester->getDisplay(true)));
95+
}
96+
97+
public function testExecuteListsCommandsOrderRaw()
98+
{
99+
require_once realpath(__DIR__.'/../Fixtures/Foo6Command.php');
100+
$application = new Application();
101+
$application->add(new \Foo6Command());
102+
$commandTester = new CommandTester($command = $application->get('list'));
103+
$commandTester->execute(array('command' => $command->getName(), '--raw' => true));
104+
$output = <<<EOF
105+
help Displays help for a command
106+
list Lists commands
107+
0foo:bar 0foo:bar command
108+
EOF;
109+
110+
$this->assertEquals($output, trim($commandTester->getDisplay(true)));
111+
}
64112
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
4+
use Symfony\Component\Console\Command\Command;
5+
6+
class Foo6Command extends Command
7+
{
8+
protected function configure()
9+
{
10+
$this->setName('0foo:bar')->setDescription('0foo:bar command');
11+
}
12+
}

src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class CustomFilterIterator extends FilterIterator
2626
/**
2727
* Constructor.
2828
*
29-
* @param \Iterator $iterator The Iterator to filter
30-
* @param array $filters An array of PHP callbacks
29+
* @param \Iterator $iterator The Iterator to filter
30+
* @param callable[] $filters An array of PHP callbacks
3131
*
3232
* @throws \InvalidArgumentException
3333
*/

src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ protected function doGetArguments(Request $request, $controller, array $paramete
131131
*
132132
* @param string $controller A Controller string
133133
*
134-
* @return mixed A PHP callable
134+
* @return callable A PHP callable
135135
*
136136
* @throws \InvalidArgumentException
137137
*/

src/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class FilterControllerEvent extends KernelEvent
2929
{
3030
/**
3131
* The current controller.
32-
*
33-
* @var callable
3432
*/
3533
private $controller;
3634

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ private function getDescriptors()
12701270
*
12711271
* @param callable|null $callback The user defined PHP callback
12721272
*
1273-
* @return callable A PHP callable
1273+
* @return \Closure A PHP closure
12741274
*/
12751275
protected function buildCallback($callback)
12761276
{

0 commit comments

Comments
 (0)
0