Astrotomic / Astrotomic/php-path
API / use-cases
- Dominant language
- No language data
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
So after writing with @mallardduck on Twitter I think it's better to discuss the API and use-cases here in an issue so all can see it.
For me it's far more important to provide a good DX and make app code really easier to read/understand than a real node.js path port. So it's totally fine for me to be an "opinionated/enhanced/inspired" port of that module but still a standalone package.
The package shouldn't have any dependencies, except `mb-string`.
And I think that the real public API should be thought/built around real use-cases/issues and not just a theoretical port of something.
**Things we need - developer-facing:**
* [ ] 📌 `Path` class as the easy everything entry point - possibly only holding `public static function` methods.
* [ ] `PathBuilder` class providing the fluent path builder API, beside wrapping `DIRECTORY_SEPARATOR` also wrapping the `ltrim()`/`rtrim()` stuff.
* [ ] `PathInfo` DTO hydrated by `pathinfo()` and possibly other optional packages.
* [ ] `StringPathInterface` and `FilesystemPathInterface` to separate `str_replace()` functions from `is_dir()` stuff.
> **Note**
> all namings are to be defined till they are explicitly fixed/pinned. 📌
Contributor guide
Assessment
This issue has not been assessed yet.