Skip to content

Commit 8a928d8

Browse files
committed
Apply feedback
1 parent 2f349fa commit 8a928d8

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

components/filesystem.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Its behavior is the following::
250250
.. note::
251251

252252
If you wish to canonicalize the path without checking its existence, you can
253-
use :method:`Symfony\\Component\\Filesystem\\Path::canonicalize` instead.
253+
use :method:`Symfony\\Component\\Filesystem\\Path::canonicalize` method instead.
254254

255255
``makePathRelative``
256256
~~~~~~~~~~~~~~~~~~~~
@@ -354,13 +354,8 @@ those issues.
354354
Canonicalization
355355
~~~~~~~~~~~~~~~~
356356

357-
*Canonicalization* is the transformation of a path into a normalized (the
358-
"canonical") format. You can canonicalize a path with :method:`Symfony\\Component\\Filesystem\\Path::canonicalize`::
359-
360-
echo Path::canonicalize('/var/www/vhost/webmozart/../config.ini');
361-
// => /var/www/vhost/config.ini
362-
363-
The following modifications happen during canonicalization:
357+
Returns the shortest path name equivalent to the given path. It applies the
358+
following rules iteratively until no further processing can be done:
364359

365360
- "." segments are removed;
366361
- ".." segments are resolved;
@@ -370,9 +365,14 @@ The following modifications happen during canonicalization:
370365
- schemes (such as "phar://") are kept;
371366
- replace "~" with the user's home directory.
372367

373-
You can pass absolute paths and relative paths to :method:`Symfony\\Component\\Filesystem\\Path::canonicalize`.
374-
When a relative path is passed, ".." segments at the beginning of the path are
375-
kept::
368+
You can canonicalize a path with :method:`Symfony\\Component\\Filesystem\\Path::canonicalize`::
369+
370+
echo Path::canonicalize('/var/www/vhost/webmozart/../config.ini');
371+
// => /var/www/vhost/config.ini
372+
373+
You can pass absolute paths and relative paths to the
374+
:method:`Symfony\\Component\\Filesystem\\Path::canonicalize` method. When a
375+
relative path is passed, ".." segments at the beginning of the path are kept::
376376

377377
echo Path::canonicalize('../uploads/../config/config.yaml');
378378
// => ../config/config.yaml
@@ -389,8 +389,8 @@ Absolute/relative paths can be converted with the methods
389389
:method:`Symfony\\Component\\Filesystem\\Path::makeAbsolute`
390390
and :method:`Symfony\\Component\\Filesystem\\Path::makeRelative`.
391391

392-
:method:`Symfony\\Component\\Filesystem\\Path::makeAbsolute` expects a relative
393-
path and a base path to base that relative path upon::
392+
:method:`Symfony\\Component\\Filesystem\\Path::makeAbsolute` method expects a
393+
relative path and a base path to base that relative path upon::
394394

395395
echo Path::makeAbsolute('config/config.yaml', '/var/www/project');
396396
// => /var/www/project/config/config.yaml

0 commit comments

Comments
 (0)