Skip to content

Commit 9b99fff

Browse files
committed
Merge branch '3.2'
* 3.2: [TwigBundle] fixed usage when Templating is not installed [Validator] Check cascasdedGroups for being countable [Cache] Add changelog for 3.2 [Cache] Add changelog [Filesystem] Check that the directory is writable after created it in dumpFile() [HttpFoundation] Improved set cookie header tests [Serializer] int is valid when float is expected when deserializing JSON [Console] increased code coverage of Output classes Added missing headers in fixture files [Profiler][VarDumper] Fix minor color issue & duplicated selector
2 parents efe2a93 + 831d0a0 commit 9b99fff

File tree

16 files changed

+162
-27
lines changed

16 files changed

+162
-27
lines changed

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function process(ContainerBuilder $container)
4949
if ($container->has('form.extension')) {
5050
$container->getDefinition('twig.extension.form')->addTag('twig.extension');
5151
$reflClass = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension');
52-
$container->getDefinition('twig.loader.filesystem')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())).'/Resources/views/Form'));
52+
$container->getDefinition('twig.loader.native_filesystem')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())).'/Resources/views/Form'));
5353
}
5454

5555
if ($container->has('translator')) {
@@ -85,15 +85,15 @@ public function process(ContainerBuilder $container)
8585
}
8686

8787
$composerRootDir = $this->getComposerRootDir($container->getParameter('kernel.root_dir'));
88-
$loader = $container->getDefinition('twig.loader.filesystem');
89-
$loader->replaceArgument(2, $composerRootDir);
90-
91-
if (!$container->has('templating')) {
92-
$loader = $container->getDefinition('twig.loader.native_filesystem');
93-
$loader->replaceArgument(1, $composerRootDir);
94-
$loader->addTag('twig.loader');
95-
$loader->setMethodCalls($container->getDefinition('twig.loader.filesystem')->getMethodCalls());
96-
88+
$twigLoader = $container->getDefinition('twig.loader.native_filesystem');
89+
if ($container->has('templating')) {
90+
$loader = $container->getDefinition('twig.loader.filesystem');
91+
$loader->setMethodCalls($twigLoader->getMethodCalls());
92+
$loader->replaceArgument(2, $composerRootDir);
93+
94+
$twigLoader->clearTag('twig.loader');
95+
} else {
96+
$twigLoader->replaceArgument(1, $composerRootDir);
9797
$container->setAlias('twig.loader.filesystem', new Alias('twig.loader.native_filesystem', false));
9898
}
9999

src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function load(array $configs, ContainerBuilder $container)
7878
$envConfiguratorDefinition->replaceArgument(4, $config['number_format']['decimal_point']);
7979
$envConfiguratorDefinition->replaceArgument(5, $config['number_format']['thousands_separator']);
8080

81-
$twigFilesystemLoaderDefinition = $container->getDefinition('twig.loader.filesystem');
81+
$twigFilesystemLoaderDefinition = $container->getDefinition('twig.loader.native_filesystem');
8282

8383
// register user-configured paths
8484
foreach ($config['paths'] as $path => $namespace) {

src/Symfony/Bundle/TwigBundle/Resources/config/templating.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<tag name="twig.loader"/>
1212
</service>
1313

14-
<service id="twig.loader" alias="twig.loader.filesystem" />
15-
1614
<service id="templating.engine.twig" class="Symfony\Bundle\TwigBundle\TwigEngine" public="false">
1715
<argument type="service" id="twig" />
1816
<argument type="service" id="templating.name_parser" />

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function testTwigLoaderPaths($format)
153153
$this->loadFromFile($container, 'extra', $format);
154154
$this->compileContainer($container);
155155

156-
$def = $container->getDefinition('twig.loader.filesystem');
156+
$def = $container->getDefinition('twig.loader.native_filesystem');
157157
$paths = array();
158158
foreach ($def->getMethodCalls() as $call) {
159159
if ('addPath' === $call[0] && false === strpos($call[1][0], 'Form')) {

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,10 @@
172172
font-size: 11px;
173173
padding: 4px 8px 4px 0;
174174
}
175-
.sf-toolbar-block .sf-toolbar-info-piece span {
176-
175+
.sf-toolbar-block:not(.sf-toolbar-block-dump) .sf-toolbar-info-piece span {
176+
color: #F5F5F5;
177177
}
178178
.sf-toolbar-block .sf-toolbar-info-piece span {
179-
color: #F5F5F5;
180179
font-size: 12px;
181180
}
182181

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CHANGELOG
2+
=========
3+
4+
3.2.0
5+
-----
6+
7+
* added TagAwareAdapter for tags-based invalidation
8+
* added PdoAdapter with PDO and Doctrine DBAL support
9+
* added PhpArrayAdapter and PhpFilesAdapter for OPcache-backed shared memory storage (PHP 7+ only)
10+
* added NullAdapter
11+
12+
3.1.0
13+
-----
14+
15+
* added the component with strict PSR-6 implementations
16+
* added ApcuAdapter, ArrayAdapter, FilesystemAdapter and RedisAdapter
17+
* added AbstractAdapter, ChainAdapter and ProxyAdapter
18+
* added DoctrineAdapter and DoctrineProvider for bidirectional interoperability with Doctrine Cache

src/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Console\Tests\Output;
1313

14+
use Symfony\Component\Console\Formatter\OutputFormatter;
1415
use Symfony\Component\Console\Output\ConsoleOutput;
1516
use Symfony\Component\Console\Output\Output;
1617

@@ -22,4 +23,19 @@ public function testConstructor()
2223
$this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
2324
$this->assertSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), '__construct() takes a formatter or null as the third argument');
2425
}
26+
27+
public function testSetFormatter()
28+
{
29+
$output = new ConsoleOutput();
30+
$outputFormatter = new OutputFormatter();
31+
$output->setFormatter($outputFormatter);
32+
$this->assertSame($outputFormatter, $output->getFormatter());
33+
}
34+
35+
public function testSetVerbosity()
36+
{
37+
$output = new ConsoleOutput();
38+
$output->setVerbosity(Output::VERBOSITY_VERBOSE);
39+
$this->assertSame(Output::VERBOSITY_VERBOSE, $output->getVerbosity());
40+
}
2541
}

src/Symfony/Component/Console/Tests/Output/NullOutputTest.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace Symfony\Component\Console\Tests\Output;
1313

14+
use Symfony\Component\Console\Formatter\OutputFormatter;
1415
use Symfony\Component\Console\Output\NullOutput;
16+
use Symfony\Component\Console\Output\Output;
1517
use Symfony\Component\Console\Output\OutputInterface;
1618

1719
class NullOutputTest extends \PHPUnit_Framework_TestCase
@@ -36,4 +38,50 @@ public function testVerbosity()
3638
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
3739
$this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() always returns VERBOSITY_QUIET for NullOutput');
3840
}
41+
42+
public function testSetFormatter()
43+
{
44+
$output = new NullOutput();
45+
$outputFormatter = new OutputFormatter();
46+
$output->setFormatter($outputFormatter);
47+
$this->assertNotSame($outputFormatter, $output->getFormatter());
48+
}
49+
50+
public function testSetVerbosity()
51+
{
52+
$output = new NullOutput();
53+
$output->setVerbosity(Output::VERBOSITY_NORMAL);
54+
$this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity());
55+
}
56+
57+
public function testSetDecorated()
58+
{
59+
$output = new NullOutput();
60+
$output->setDecorated(true);
61+
$this->assertFalse($output->isDecorated());
62+
}
63+
64+
public function testIsQuiet()
65+
{
66+
$output = new NullOutput();
67+
$this->assertTrue($output->isQuiet());
68+
}
69+
70+
public function testIsVerbose()
71+
{
72+
$output = new NullOutput();
73+
$this->assertFalse($output->isVerbose());
74+
}
75+
76+
public function testIsVeryVerbose()
77+
{
78+
$output = new NullOutput();
79+
$this->assertFalse($output->isVeryVerbose());
80+
}
81+
82+
public function testIsDebug()
83+
{
84+
$output = new NullOutput();
85+
$this->assertFalse($output->isDebug());
86+
}
3987
}

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,9 @@ public function dumpFile($filename, $content)
632632

633633
if (!is_dir($dir)) {
634634
$this->mkdir($dir);
635-
} elseif (!is_writable($dir)) {
635+
}
636+
637+
if (!is_writable($dir)) {
636638
throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
637639
}
638640

src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public function provideMakeDispositionFail()
331331
);
332332
}
333333

334-
protected function assertSetCookieHeader($expected, ResponseHeaderBag $actual)
334+
private function assertSetCookieHeader($expected, ResponseHeaderBag $actual)
335335
{
336336
$this->assertRegExp('#^Set-Cookie:\s+'.preg_quote($expected, '#').'$#m', str_replace("\r\n", "\n", (string) $actual));
337337
}

0 commit comments

Comments
 (0)