diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 95fea18b4a4a1..90192c059764f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -691,7 +691,7 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode, callable $enabl ->children() ->booleanNode('strict_mode') ->info('Throw an exception if an entry is missing from the manifest.json') - ->defaultFalse() + ->defaultValue('%kernel.debug%') ->end() ->scalarNode('version_strategy')->defaultNull()->end() ->scalarNode('version')->defaultNull()->end() @@ -732,7 +732,7 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode, callable $enabl ->children() ->booleanNode('strict_mode') ->info('Throw an exception if an entry is missing from the manifest.json') - ->defaultFalse() + ->defaultValue('%kernel.debug%') ->end() ->scalarNode('version_strategy')->defaultNull()->end() ->scalarNode('version') diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/assets.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/assets.php index 2457121864afc..2249233b8c1d7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/assets.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/assets.php @@ -79,7 +79,7 @@ ->args([ abstract_arg('manifest path'), service('http_client')->nullOnInvalid(), - false, + abstract_arg('strict mode'), ]) ; }; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 057848db2ba7d..c1b94d2768371 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -86,7 +86,7 @@ public function testAssetsCanBeEnabled() 'base_urls' => [], 'packages' => [], 'json_manifest_path' => null, - 'strict_mode' => false, + 'strict_mode' => '%kernel.debug%', ]; $this->assertEquals($defaultConfig, $config['assets']); @@ -490,7 +490,7 @@ protected static function getBundleDefaultConfig() 'base_urls' => [], 'packages' => [], 'json_manifest_path' => null, - 'strict_mode' => false, + 'strict_mode' => '%kernel.debug%', ], 'cache' => [ 'pools' => [], diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php index f26621001c9ec..1cb012c6ac27b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php @@ -29,6 +29,7 @@ ], 'remote_manifest' => [ 'json_manifest_path' => 'https://cdn.example.com/manifest.json', + 'strict_mode' => false, ], 'var_manifest' => [ 'json_manifest_path' => '%var_json_manifest_path%', diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/assets.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/assets.xml index dadee4529d8b5..4e11d8e9fc5c9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/assets.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/assets.xml @@ -22,7 +22,7 @@ https://bar_version_strategy.example.com - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml index cfd4f07b04346..b28e32fe763fc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml @@ -21,6 +21,7 @@ framework: json_manifest_path: '/path/to/manifest.json' remote_manifest: json_manifest_path: 'https://cdn.example.com/manifest.json' + strict_mode: false var_manifest: json_manifest_path: '%var_json_manifest_path%' env_manifest: diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 045b6ea5f4441..60f3a32538cf8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -659,24 +659,25 @@ public function testAssets() $versionStrategy = $container->getDefinition((string) $package->getArgument(1)); $this->assertEquals('assets.json_manifest_version_strategy', $versionStrategy->getParent()); $this->assertEquals('/path/to/manifest.json', $versionStrategy->getArgument(0)); - $this->assertFalse($versionStrategy->getArgument(2)); + $this->assertTrue($versionStrategy->getArgument(2)); $package = $container->getDefinition($packages['remote_manifest']); $versionStrategy = $container->getDefinition($package->getArgument(1)); $this->assertSame('assets.json_manifest_version_strategy', $versionStrategy->getParent()); $this->assertSame('https://cdn.example.com/manifest.json', $versionStrategy->getArgument(0)); + $this->assertFalse($versionStrategy->getArgument(2)); $package = $container->getDefinition($packages['var_manifest']); $versionStrategy = $container->getDefinition($package->getArgument(1)); $this->assertSame('assets.json_manifest_version_strategy', $versionStrategy->getParent()); $this->assertSame('https://cdn.example.com/manifest.json', $versionStrategy->getArgument(0)); - $this->assertFalse($versionStrategy->getArgument(2)); + $this->assertTrue($versionStrategy->getArgument(2)); $package = $container->getDefinition($packages['env_manifest']); $versionStrategy = $container->getDefinition($package->getArgument(1)); $this->assertSame('assets.json_manifest_version_strategy', $versionStrategy->getParent()); $this->assertStringMatchesFormat('env_%s', $versionStrategy->getArgument(0)); - $this->assertFalse($versionStrategy->getArgument(2)); + $this->assertTrue($versionStrategy->getArgument(2)); $package = $container->getDefinition((string) $packages['strict_manifest_strategy']); $versionStrategy = $container->getDefinition((string) $package->getArgument(1));