Page MenuHomePhabricator

Add an isAbsolutePath method
ClosedPublic

Authored by joshuaspence on May 26 2015, 11:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 6, 8:51 PM
Unknown Object (File)
Wed, Apr 3, 7:53 PM
Unknown Object (File)
Tue, Apr 2, 10:14 PM
Unknown Object (File)
Mar 21 2024, 12:23 AM
Unknown Object (File)
Mar 3 2024, 10:10 AM
Unknown Object (File)
Feb 13 2024, 10:53 AM
Unknown Object (File)
Feb 11 2024, 12:39 AM
Unknown Object (File)
Feb 6 2024, 6:57 PM

Details

Summary

Add a Filesystem::isAbsolutePath method as this functionality is fairly general purpose and reusable.

Test Plan

This logic has just been moved from Filesystem::resolvePath.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add an isAbsolutePath method.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.May 26 2015, 11:41 PM
epriestley edited edge metadata.

maybe this should be less reversed

This revision now requires changes to proceed.May 26 2015, 11:46 PM

This still seems questionable to me:

$is_absolute = self::isRelativePath($path);

Specifically, this code is good if you rename the method to isAbsolutePath(), or this method name is fine if you invert the logic and invert the return value before assigning. But this is setting $is_absolute = is_relative(), which doesn't make sense, and isRelativePath() is returning true for absolute (i.e., not relative) paths.

epriestley edited edge metadata.

See above.

This revision now requires changes to proceed.May 28 2015, 10:26 PM
epriestley edited edge metadata.
This revision is now accepted and ready to land.May 31 2015, 2:37 PM
This revision was automatically updated to reflect the committed changes.