Skip to content

Commit 2d59b33

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 b330469 + 4909f53 commit 2d59b33

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

ControllerMetadata/ArgumentMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private function getType(\ReflectionParameter $parameter)
101101
$refClass = $parameter->getClass();
102102
} catch (\ReflectionException $e) {
103103
// mandatory; extract it from the exception message
104-
return str_replace(['Class ', ' does not exist'], '', $e->getMessage());
104+
return str_replace(array('Class ', ' does not exist'), '', $e->getMessage());
105105
}
106106

107107
return $refClass ? $refClass->getName() : null;

Kernel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ public function terminate(Request $request, Response $response)
134134
}
135135

136136
if ($this->getHttpKernel() instanceof TerminableInterface) {
137+
if (!$this->debug) {
138+
if (function_exists('fastcgi_finish_request')) {
139+
fastcgi_finish_request();
140+
} elseif ('cli' !== PHP_SAPI) {
141+
Response::closeOutputBuffers(0, true);
142+
}
143+
}
144+
137145
$this->getHttpKernel()->terminate($request, $response);
138146
}
139147
}

Tests/ControllerMetadata/ArgumentMetadataFactoryTest.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function setUp()
2828

2929
public function testSignature1()
3030
{
31-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature1']);
31+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature1'));
3232

3333
$this->assertEquals(array(
3434
new ArgumentMetadata('foo', self::class, false, false, null),
@@ -39,7 +39,7 @@ public function testSignature1()
3939

4040
public function testSignature2()
4141
{
42-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature2']);
42+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature2'));
4343

4444
$this->assertEquals(array(
4545
new ArgumentMetadata('foo', self::class, false, true, null),
@@ -50,7 +50,7 @@ public function testSignature2()
5050

5151
public function testSignature3()
5252
{
53-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature3']);
53+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature3'));
5454

5555
$this->assertEquals(array(
5656
new ArgumentMetadata('bar', __NAMESPACE__.'\FakeClassThatDoesNotExist', false, false, null),
@@ -60,18 +60,18 @@ public function testSignature3()
6060

6161
public function testSignature4()
6262
{
63-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature4']);
63+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature4'));
6464

6565
$this->assertEquals(array(
6666
new ArgumentMetadata('foo', null, false, true, 'default'),
6767
new ArgumentMetadata('bar', null, false, true, 500),
68-
new ArgumentMetadata('baz', null, false, true, []),
68+
new ArgumentMetadata('baz', null, false, true, array()),
6969
), $arguments);
7070
}
7171

7272
public function testSignature5()
7373
{
74-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature5']);
74+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature5'));
7575

7676
$this->assertEquals(array(
7777
new ArgumentMetadata('foo', 'array', false, true, null),
@@ -84,7 +84,7 @@ public function testSignature5()
8484
*/
8585
public function testVariadicSignature()
8686
{
87-
$arguments = $this->factory->createArgumentMetadata([new VariadicController(), 'action']);
87+
$arguments = $this->factory->createArgumentMetadata(array(new VariadicController(), 'action'));
8888

8989
$this->assertEquals(array(
9090
new ArgumentMetadata('foo', null, false, false, null),
@@ -97,7 +97,7 @@ public function testVariadicSignature()
9797
*/
9898
public function testBasicTypesSignature()
9999
{
100-
$arguments = $this->factory->createArgumentMetadata([new BasicTypesController(), 'action']);
100+
$arguments = $this->factory->createArgumentMetadata(array(new BasicTypesController(), 'action'));
101101

102102
$this->assertEquals(array(
103103
new ArgumentMetadata('foo', 'string', false, false, null),
@@ -108,26 +108,21 @@ public function testBasicTypesSignature()
108108

109109
private function signature1(ArgumentMetadataFactoryTest $foo, array $bar, callable $baz)
110110
{
111-
112111
}
113112

114113
private function signature2(ArgumentMetadataFactoryTest $foo = null, FakeClassThatDoesNotExist $bar = null, ImportedAndFake $baz = null)
115114
{
116-
117115
}
118116

119117
private function signature3(FakeClassThatDoesNotExist $bar, ImportedAndFake $baz)
120118
{
121-
122119
}
123120

124-
private function signature4($foo = 'default', $bar = 500, $baz = [])
121+
private function signature4($foo = 'default', $bar = 500, $baz = array())
125122
{
126-
127123
}
128124

129125
private function signature5(array $foo = null, $bar)
130126
{
131-
132127
}
133128
}

0 commit comments

Comments
 (0)