- [BC BREAK] Path resolvers refactored:
PathResolverInterface
is for resolvers that don't require a base path or other information passed toresolve()
.BasePathResolverInterface
is for resolvers that take a base path inresolve()
.BasePathResolver
replacesPathResolver
.FixedBasePathResolver
replacesBoundPathResolver
.
- [BC BREAK] Class/interface deletions:
AbstractAbsoluteFileSystemPath
AbstractRelativeFileSystemPath
NormalizingPathResolver
(just usenormalize()
after resolution)NormalizingPathResolverTrait
(just usenormalize()
after resolution)PathResolverTrait
(useresolve()
method or an injected resolver class)WorkingDirectoryResolver
(see the readme for a replacement solution)
- [BC BREAK] Class/interface renames:
UndefinedPathAtomException
->UndefinedAtomException
- [BC BREAK] The following methods no longer accept an optional normalizer:
PathInterface::parent()
PathInterface::normalize()
AbsolutePathInterface::isRoot()
AbsolutePathInterface::isParentOf()
AbsolutePathInterface::isAncestorOf()
AbsolutePathInterface::relativeTo()
RelativePathInterface::isSelf()
- [NEW] Static factory methods available for all path types. Examples
include:
Path::fromString()
Path::fromAtoms()
WindowsPath::fromDriveAndAtoms()
- [NEW] Implemented
AbsolutePathInterface::resolve()
andRelativePathInterface::resolveAgainst
as alternatives to using a resolver instance. - [NEW] Implemented
nameAtomAt()
andnameAtomAtDefault()
. - [NEW] Implemented
InvalidPathExceptionInterface
for all exceptions that involve a complete, but invalid path. Various new exceptions of this type may be thrown when appropriate. - [IMPROVED] Improved Windows path support:
- Relative paths now support drive specifiers (yes, it's a thing).
- Drive-less absolute paths are now represented as a relative path (after all, it is relative to the current drive).
- Absolute paths now always have a drive specifier.
- Implemented new
WindowsPathInterface
methodsmatchesDrive()
andmatchesDriveOrNull()
. - Implemented
WindowsBasePathResolver
.
- [IMPROVED] Path factories will now create relative paths by default, rather than absolute ones.
- [IMPROVED]
atomAt()
andatomAtDefault()
now accept negative indices to indicate an offset from the last index. - [IMPROVED] Extra care is taken to avoid trailing separators in all result paths.
- [IMPROVED] Extra care is taken to avoid constructing new instances of static dependencies. Should result in minor memory usage / performance improvements.
- [MAINTENANCE] General repository maintenance
- [NEW] All paths now implement
atomAt()
andatomAtDefault()
(#28).
- [NEW] All paths now implement
toAbsolute()
andtoRelative()
(#27).
- [BC BREAK] Constants moved from path interface into implementation class, so that they can be overridden.
- [FIXED] Unix paths now return Unix paths as results (#25).
- [NEW] All paths can now be normalized by calling
normalize()
, which takes an optional normalizer to use. - [NEW] Unix paths now have first-class representations, and their own factory.
- [IMPROVED] File system paths will automatically normalize the result of
the
parent()
method (#21). - [NEW] Implemented dependency consumer traits (#22).
- [NEW] Implemented simple methods for matching strings and patterns in paths and path names (#19).
- [FIXED] AbsolutePath::relativeTo() now works for paths with common suffixes (#20).
- [FIXED] AbsolutePath::relativeTo() no longer works backwards (#18).
- [NEW] Initial implementation.