Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Dec 18, 2024
1 parent 5d1465d commit ecdc91c
Show file tree
Hide file tree
Showing 21 changed files with 95 additions and 167 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_preview_error:
path: /{code}.{_format}
controller: error_controller::preview
defaults:
_format: html
requirements:
code: \d+
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_webhook_controller:
path: /{type}
controller: webhook.controller::handle
requirements:
type: .+

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -41,7 +40,7 @@ public function testLoadEmptyConfiguration()
$container->loadFromExtension('twig');
$this->compileContainer($container);

$this->assertEquals(Environment::class, $container->getDefinition('twig')->getClass(), '->load() loads the twig.xml file');
$this->assertEquals(Environment::class, $container->getDefinition('twig')->getClass(), '->load() loads the twig.yml file');

$this->assertContains('form_div_layout.html.twig', $container->getParameter('twig.form.resources'), '->load() includes default template for form resources');

Expand All @@ -66,7 +65,7 @@ public function testLoadFullConfiguration(string $format)
$this->loadFromFile($container, 'full', $format);
$this->compileContainer($container);

$this->assertEquals(Environment::class, $container->getDefinition('twig')->getClass(), '->load() loads the twig.xml file');
$this->assertEquals(Environment::class, $container->getDefinition('twig')->getClass(), \sprintf('->load() loads the twig.%s file', $format));

// Form resources
$resources = $container->getParameter('twig.form.resources');
Expand Down Expand Up @@ -234,7 +233,6 @@ public static function getFormats(): array
return [
['php'],
['yml'],
['xml'],
];
}

Expand Down Expand Up @@ -347,7 +345,6 @@ private function loadFromFile(ContainerBuilder $container, string $file, string

$loader = match ($format) {
'php' => new PhpFileLoader($container, $locator),
'xml' => new XmlFileLoader($container, $locator),
'yml' => new YamlFileLoader($container, $locator),
};

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
_profiler_home:
path: /
controller: web_profiler.controller.profiler::homeAction

_profiler_search:
path: /search
controller: web_profiler.controller.profiler::searchAction

_profiler_search_bar:
path: /search_bar
controller: web_profiler.controller.profiler::searchBarAction

_profiler_phpinfo:
path: /phpinfo
controller: web_profiler.controller.profiler::phpinfoAction

_profiler_xdebug:
path: /xdebug
controller: web_profiler.controller.profiler::xdebugAction

_profiler_font:
path: /font/{fontName}.woff2
controller: web_profiler.controller.profiler::fontAction

_profiler_search_results:
path: /{token}/search/results
controller: web_profiler.controller.profiler::searchResultsAction

_profiler_open_file:
path: /open
controller: web_profiler.controller.profiler::openAction

_profiler:
path: /{token}
controller: web_profiler.controller.profiler::panelAction

_profiler_router:
path: /{token}/router
controller: web_profiler.controller.router::panelAction

_profiler_exception:
path: /{token}/exception
controller: web_profiler.controller.exception_panel::body

_profiler_exception_css:
path: /{token}/exception.css
controller: web_profiler.controller.exception_panel::stylesheet

_profiler_router:
path: /{token}/router
controller: web_profiler.controller.router::panelAction

_profiler_exception:
path: /{token}/exception
controller: web_profiler.controller.exception_panel::body

_profiler_exception_css:
path: /{token}/exception.css
controller: web_profiler.controller.exception_panel::stylesheet

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_wdt_stylesheet:
path: /styles.css
controller: web_profiler.controller.profiler::toolbarStylesheetAction

_wdt:
path: /{token}
controller: web_profiler.controller.profiler::toolbarAction
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function registerBundles(): iterable

protected function configureRoutes(RoutingConfigurator $routes): void
{
$routes->import(__DIR__.'/../../Resources/config/routing/profiler.xml')->prefix('/_profiler');
$routes->import(__DIR__.'/../../Resources/config/routing/wdt.xml')->prefix('/_wdt');
$routes->import(__DIR__.'/../../Resources/config/routing/profiler.yml')->prefix('/_profiler');
$routes->import(__DIR__.'/../../Resources/config/routing/wdt.yml')->prefix('/_wdt');
$routes->add('_', '/')->controller('kernel::homepageController');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private function createContainerLoader(ContainerBuilder $container, string $env,
$buildDir = $container->getParameter('kernel.build_dir');
$locator = new FileLocator();
$resolver = new LoaderResolver([
new XmlFileLoader($container, $locator, $env, $prepend),
new XmlFileLoader($container, $locator, $env, $prepend, false, false),
new YamlFileLoader($container, $locator, $env, $prepend),
new IniFileLoader($container, $locator, $env),
new PhpFileLoader($container, $locator, $env, new ConfigBuilderGenerator($buildDir), $prepend),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ public function __construct(
FileLocatorInterface $locator,
?string $env = null,
protected bool $prepend = false,
bool $triggerDeprecation = true,
) {
trigger_deprecation('symfony/dependency-injection', '7.3', \sprintf('The "%s" class is deprecated.', __CLASS__));
if ($triggerDeprecation) {
trigger_deprecation('symfony/dependency-injection', '7.3', \sprintf('The "%s" class is deprecated.', __CLASS__));
}

parent::__construct($container, $locator, $env, $prepend);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ protected function getContainerLoader(ContainerInterface $container): Delegating
$env = $this->getEnvironment();
$locator = new FileLocator($this);
$resolver = new LoaderResolver([
new XmlFileLoader($container, $locator, $env),
new XmlFileLoader($container, $locator, $env, false, false),
new YamlFileLoader($container, $locator, $env),
new IniFileLoader($container, $locator, $env),
new PhpFileLoader($container, $locator, $env, class_exists(ConfigBuilderGenerator::class) ? new ConfigBuilderGenerator($this->getBuildDir()) : null),
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpKernel/Tests/KernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function testLocateResourceThrowsExceptionWhenNameIsUnsafe()
public function testLocateResourceThrowsExceptionWhenBundleDoesNotExist()
{
$this->expectException(\InvalidArgumentException::class);
$this->getKernel()->locateResource('@FooBundle/config/routing.xml');
$this->getKernel()->locateResource('@FooBundle/config/routing.yml');
}

public function testLocateResourceThrowsExceptionWhenResourceDoesNotExist()
Expand All @@ -277,7 +277,7 @@ public function testLocateResourceThrowsExceptionWhenResourceDoesNotExist()
->willReturn($this->getBundle(__DIR__.'/Fixtures/Bundle1Bundle'))
;

$kernel->locateResource('@Bundle1Bundle/config/routing.xml');
$kernel->locateResource('@Bundle1Bundle/config/routing.yml');
}

public function testLocateResourceReturnsTheFirstThatMatches()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ class XmlFileLoader extends FileLoader

public function __construct(
protected string $file,
bool $triggerDeprecation = true,
) {
trigger_deprecation('symfony/validator', '7.3', \sprintf('The "%s" class is deprecated.', __CLASS__));
if ($triggerDeprecation) {
trigger_deprecation('symfony/validator', '7.3', \sprintf('The "%s" class is deprecated.', __CLASS__));
}

parent::__construct($file);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Validator/ValidatorBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function getLoaders(): array
$loaders = [];

foreach ($this->xmlMappings as $xmlMapping) {
$loaders[] = new XmlFileLoader($xmlMapping);
$loaders[] = new XmlFileLoader($xmlMapping, false);
}

foreach ($this->yamlMappings as $yamlMappings) {
Expand Down

0 comments on commit ecdc91c

Please sign in to comment.