It is based on Node.js's path module.
composer require okapi/path
<?php
use Okapi\Path\Path;
// Resolve
$path = Path::resolve('./path/to/file.txt');
// --> /project/path/to/file.txt
$path = Path::resolve([
'./path/to/file.txt',
'../project2/file.txt',
]);
// [0] --> /project/path/to/file.txt
// [1] --> /project2/file.txt
// Join
$path = Path::join('/project', 'path', 'to', 'file.txt');
// --> /project/path/to/file.txt
- Run
composer run-script test
or - Run
composer run-script test-coverage
Give a ⭐ if this project helped you!
Copyright © 2023 Valentin Wotschel.
This project is MIT licensed.