Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f7c843

Browse files
committed
Fix solution for Windows
1 parente1e0d85 commit1f7c843

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎src/Symfony/Bridge/Twig/Command/DebugCommand.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ private function findWrongBundleOverrides(): array
362362

363363
if ($this->rootDir &&$this->projectDir) {
364364
$folders =glob($this->rootDir.'/Resources/*/views',GLOB_ONLYDIR);
365-
$relativePath =ltrim(substr($this->rootDir.'/Resources/',\strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
365+
$relativePath =ltrim(substr($this->rootDir.\DIRECTORY_SEPARATOR.'Resources/',\strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
366366
$bundleNames =array_reduce($folders,function ($carry,$absolutePath)use ($relativePath) {
367367
if (0 ===strpos($absolutePath,$this->projectDir)) {
368368
$name =basename(\dirname($absolutePath));
369-
$path =$relativePath.$name;
369+
$path =ltrim($relativePath.$name, \DIRECTORY_SEPARATOR);
370370
$carry[$name] =$path;
371371

372372
@trigger_error(sprintf('Templates directory "%s" is deprecated since Symfony 4.2, use "%s" instead.',$absolutePath,$this->twigDefaultPath.'/bundles/'.$name),E_USER_DEPRECATED);
@@ -378,11 +378,11 @@ private function findWrongBundleOverrides(): array
378378

379379
if ($this->twigDefaultPath &&$this->projectDir) {
380380
$folders =glob($this->twigDefaultPath.'/bundles/*',GLOB_ONLYDIR);
381-
$relativePath =ltrim(substr($this->twigDefaultPath.'/bundles',\strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
381+
$relativePath =ltrim(substr($this->twigDefaultPath.'/bundles/',\strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
382382
$bundleNames =array_reduce($folders,function ($carry,$absolutePath)use ($relativePath) {
383383
if (0 ===strpos($absolutePath,$this->projectDir)) {
384-
$path =ltrim(substr($absolutePath,\strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
385-
$name =ltrim(substr($path,\strlen($relativePath)), \DIRECTORY_SEPARATOR);
384+
$name =basename($absolutePath);
385+
$path =ltrim($relativePath.$name, \DIRECTORY_SEPARATOR);
386386
$carry[$name] =$path;
387387
}
388388

‎src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testWarningsWrongBundleOverriding()
6464

6565
/**
6666
* @group legacy
67-
* @expectedDeprecation Templates directory "%s/Resources/BarBundle/views" is deprecated since Symfony 4.2, use "%s/templates/bundles/BarBundle" instead.
67+
* @expectedDeprecation Templates directory "%sResources/BarBundle/views" is deprecated since Symfony 4.2, use "%stemplates/bundles/BarBundle" instead.
6868
*/
6969
publicfunctiontestDeprecationForWrongBundleOverridingInLegacyPath()
7070
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp