Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7093fc1

Browse files
committed
Merge branch '3.2' into 3.3
* 3.2: fixed tests swiftmailer bridge is gone [TwigBundle] add back exception check Dont call count on non countable object Fix undefined variable $filesystem
2 parents 87601ba + 59094b4 commit 7093fc1

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
"Symfony\\Bridge\\Doctrine\\": "src/Symfony/Bridge/Doctrine/",
116116
"Symfony\\Bridge\\Monolog\\": "src/Symfony/Bridge/Monolog/",
117117
"Symfony\\Bridge\\ProxyManager\\": "src/Symfony/Bridge/ProxyManager/",
118-
"Symfony\\Bridge\\Swiftmailer\\": "src/Symfony/Bridge/Swiftmailer/",
119118
"Symfony\\Bridge\\Twig\\": "src/Symfony/Bridge/Twig/",
120119
"Symfony\\Bundle\\": "src/Symfony/Bundle/",
121120
"Symfony\\Component\\": "src/Symfony/Component/"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
158158
// remove the assets of the bundles that no longer exist
159159
foreach (new \FilesystemIterator($bundlesDir) as $dir) {
160160
if (!in_array($dir, $validAssetDirs)) {
161-
$filesystem->remove($dir);
161+
$this->filesystem->remove($dir);
162162
}
163163
}
164164

src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected function findTemplate(Request $request, $format, $code, $showException
123123
// default to a generic HTML exception
124124
$request->setRequestFormat('html');
125125

126-
return sprintf('@Twig/Exception/%s.html.twig', $name);
126+
return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name);
127127
}
128128

129129
// to be removed when the minimum required version of Twig is >= 3.0

src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ public function testFallbackToHtmlIfNoTemplateForRequestedFormat()
4848
$this->assertEquals('html', $request->getRequestFormat());
4949
}
5050

51+
public function testFallbackToHtmlWithFullExceptionIfNoTemplateForRequestedFormatAndExceptionsShouldBeShown()
52+
{
53+
$twig = $this->createTwigEnv(array('@Twig/Exception/exception_full.html.twig' => '<html></html>'));
54+
55+
$request = $this->createRequest('txt');
56+
$request->attributes->set('showException', true);
57+
$exception = FlattenException::create(new \Exception());
58+
$controller = new ExceptionController($twig, false);
59+
60+
$controller->showAction($request, $exception);
61+
62+
$this->assertEquals('html', $request->getRequestFormat());
63+
}
64+
5165
public function testResponseHasRequestedMimeType()
5266
{
5367
$twig = $this->createTwigEnv(array('@Twig/Exception/error.json.twig' => '{}'));

src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
5252

5353
$resOffset = $this->getPosition($data);
5454

55-
$data .= pack('v', count($messages))
55+
$data .= pack('v', count($messages->all($domain)))
5656
.$indexes
5757
.$this->writePadding($data)
5858
.$resources
@@ -63,11 +63,11 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
6363
$root = pack('V7',
6464
$resOffset + (2 << 28), // Resource Offset + Resource Type
6565
6, // Index length
66-
$keyTop, // Index keys top
67-
$bundleTop, // Index resources top
68-
$bundleTop, // Index bundle top
69-
count($messages), // Index max table length
70-
0 // Index attributes
66+
$keyTop, // Index keys top
67+
$bundleTop, // Index resources top
68+
$bundleTop, // Index bundle top
69+
count($messages->all($domain)), // Index max table length
70+
0 // Index attributes
7171
);
7272

7373
$header = pack('vC2v4C12@32',

0 commit comments

Comments
 (0)