Skip to content

Commit fc6f187

Browse files
committed
minor #19107 [Filesystem] remove unused makeRelative example (devojifr)
This PR was merged into the 5.4 branch. Discussion ---------- [Filesystem] remove unused makeRelative example To illustrate getLongestCommonBasePath() usage, a makeRelative example is mentioned but not used. Commits ------- f22a72f [Filesystem] remove unused makeRelative example
2 parents ffe66c4 + f22a72f commit fc6f187

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

components/filesystem.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ Especially when storing many paths, the amount of duplicated information is
435435
noticeable. You can use :method:`Symfony\\Component\\Filesystem\\Path::getLongestCommonBasePath`
436436
to check a list of paths for a common base path::
437437

438-
Path::getLongestCommonBasePath(
438+
$basePath = Path::getLongestCommonBasePath(
439439
'/var/www/vhosts/project/httpdocs/config/config.yaml',
440440
'/var/www/vhosts/project/httpdocs/config/routing.yaml',
441441
'/var/www/vhosts/project/httpdocs/config/services.yaml',
@@ -444,17 +444,14 @@ to check a list of paths for a common base path::
444444
);
445445
// => /var/www/vhosts/project/httpdocs
446446

447-
Use this path together with :method:`Symfony\\Component\\Filesystem\\Path::makeRelative`
448-
to shorten the stored paths::
449-
450-
$bp = '/var/www/vhosts/project/httpdocs';
447+
Use this path together to shorten the stored paths::
451448

452449
return [
453-
$bp.'/config/config.yaml',
454-
$bp.'/config/routing.yaml',
455-
$bp.'/config/services.yaml',
456-
$bp.'/images/banana.gif',
457-
$bp.'/uploads/images/nicer-banana.gif',
450+
$basePath.'/config/config.yaml',
451+
$basePath.'/config/routing.yaml',
452+
$basePath.'/config/services.yaml',
453+
$basePath.'/images/banana.gif',
454+
$basePath.'/uploads/images/nicer-banana.gif',
458455
];
459456

460457
:method:`Symfony\\Component\\Filesystem\\Path::getLongestCommonBasePath` always

0 commit comments

Comments
 (0)