RelativePath
in package
implements
RelativePathInterface
Represent and manipulate unixoid paths as immutables.
Tags
Interfaces, Classes, Traits and Enums
- RelativePathInterface
- Represents either an absolute or a relative Path
Table of Contents
- $path : string
- TODO PHP 8.1 make readonly
- __construct() : mixed
- Constructor.
- __toString() : string
- normalize() : RelativePathInterface
- Normalize a path
Properties
$path read-only
TODO PHP 8.1 make readonly
private
string
$path
Tags
Methods
__construct()
Constructor.
public
__construct(string $path) : mixed
No default on purpose.
use ::fromCurrentDir to get the absolute path to cwd. use '' or './' for the path relative to self
Parameters
- $path : string
Tags
Return values
mixed —__toString()
public
__toString() : string
Return values
string —normalize()
Normalize a path
public
normalize() : RelativePathInterface
Remove noop . and // Remove ../ together with the preceding level unless it hits the root Remove trailing slashes unless it is the root slash.