Skip to content

Conversation

@yoeunes
Copy link
Contributor

@yoeunes yoeunes commented Nov 3, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Issues n/a
License MIT

This PR fixes a bug and removes duplicated code between Filesystem::isAbsolutePath() and Path::isAbsolute().

These two methods had different implementations. The logic in Path incorrectly reported stream wrappers (http://, vfs://) and paths like C:css/style.css as being relative.

This PR makes Path::isAbsolute() the single source of truth by adopting the more robust logic from Filesystem. Filesystem::isAbsolutePath() now delegates to it.

Note on Path Class Scope

This change ensures isAbsolute() correctly handles stream wrappers. This is consistent with the component's scope, as other methods like canonicalize() already support and preserve schemes (e.g., phar://).

@yoeunes yoeunes force-pushed the filesystem-unify-isabsolutepath-method branch from 4e43c84 to 6c9cc87 Compare November 5, 2025 09:52
@yoeunes
Copy link
Contributor Author

yoeunes commented Nov 5, 2025

Hi @nicolas-grekas, done - docblocks aligned as suggested! Thank you.

@nicolas-grekas
Copy link
Member

Thank you @yoeunes.

@nicolas-grekas nicolas-grekas merged commit 71634de into symfony:7.3 Nov 5, 2025
10 of 11 checks passed
alexandre-daubois added a commit that referenced this pull request Nov 19, 2025
This PR was merged into the 7.3 branch.

Discussion
----------

 Add missing Path class required for `link` tool

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

After #62283, the `Path` class becomes a new requirement for the `link` tool.

Current error:
```bash
Fatal error: Uncaught Error: Class "Symfony\Component\Filesystem\Path" not found in src/Symfony/Component/Filesystem/Filesystem.php:583
```

Commits
-------

4465ec9 Add missing Path class required for `link` tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants