Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor RealPath #198

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Refactor RealPath #198

merged 1 commit into from
Nov 14, 2024

Conversation

ramchale
Copy link
Contributor

Q A
Documentation yes
Bugfix no
BC Break yes
New Feature no
RFC no
QA no

Description

Refactor RealPath for #177

gsteel

This comment was marked as outdated.

@gsteel

This comment was marked as outdated.

Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ramchale, but, we still need to "make up" the real path for non-existent files when appropriate

docs/book/v3/standard-filters.md Outdated Show resolved Hide resolved
docs/book/v3/standard-filters.md Outdated Show resolved Hide resolved
src/RealPath.php Show resolved Hide resolved
src/RealPath.php Outdated Show resolved Hide resolved
@ramchale
Copy link
Contributor Author

Thanks @ramchale, but, we still need to "make up" the real path for non-existent files when appropriate

🤦 sorry. Not my best work. I've reworked some of the tests to better cover that with the return value changes.
I've added a test that should check whether the statement about BSD is true, but don't have access to a BSD machine to check and the docker support attempts seem to have petered out.

Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ramchale - this is looking much better - could we improve the test testExistingFileReturnsRealPath with a data provider along the lines of

[
   __DIR__ . '/_files/foo/../bar/../file.1',
   __DIR__ . '/_files/././file.1',
   __DIR__ . '///_files///file.1',
   // etc…
]

@ramchale
Copy link
Contributor Author

Thanks @gsteel . I've added those.
__DIR__ . '/_files/foo/../bar/../file.1' is invalid, but seemed like the sort of edge-case that might come up, so I've dropped it in it's own test.
Once you're happy with the changes, is there any issue with me squashing this before it's merged to cut down on some of the undoing of changes in the commit history?

Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @ramchale - Great improvement

Let me know when you're done squashing and I'll merge 👍

- Drop Windows support
- Add additional tests for existing and non-existing paths

Signed-off-by: ramchale <[email protected]>
@ramchale
Copy link
Contributor Author

@gsteel Thanks. Should be ready now

@gsteel gsteel self-assigned this Nov 14, 2024
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gsteel gsteel merged commit 5f964f2 into laminas:3.0.x Nov 14, 2024
16 of 17 checks passed
@gsteel gsteel mentioned this pull request Nov 14, 2024
54 tasks
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