@@ -38,6 +38,7 @@ final class Path implements \Stringable
3838 /**
3939 * @param non-empty-string $path The filesystem path. In never ends with a separator.
4040 * Might be ended with "." or ".." if the path is a directory.
41+ * @psalm-mutation-free
4142 */
4243 private function __construct (
4344 private readonly string $ path ,
@@ -46,6 +47,9 @@ private function __construct(
4647
4748 /**
4849 * Create a new path object
50+ *
51+ * @psalm-pure
52+ * @psalm-mutation-free
4953 */
5054 public static function create (self |string $ path = '' ): self
5155 {
@@ -58,6 +62,7 @@ public static function create(self|string $path = ''): self
5862 * Join this path with one or more path components
5963 *
6064 * @psalm-immutable
65+ * @psalm-mutation-free
6166 */
6267 public function join (self |string ...$ paths ): self
6368 {
@@ -88,6 +93,7 @@ public function join(self|string ...$paths): self
8893 * Return the file or directory name (the final path component)
8994 *
9095 * @return non-empty-string
96+ * @psalm-mutation-free
9197 */
9298 public function name (): string
9399 {
@@ -101,6 +107,7 @@ public function name(): string
101107 * Return the file stem (the file name without its extension)
102108 *
103109 * @return non-empty-string
110+ * @psalm-mutation-free
104111 */
105112 public function stem (): string
106113 {
@@ -111,6 +118,8 @@ public function stem(): string
111118
112119 /**
113120 * Return the file suffix (extension) without the leading dot
121+ *
122+ * @psalm-mutation-free
114123 */
115124 public function extension (): string
116125 {
@@ -123,6 +132,7 @@ public function extension(): string
123132 * Return the parent directory path
124133 *
125134 * @psalm-immutable
135+ * @psalm-mutation-free
126136 */
127137 public function parent (): self
128138 {
@@ -152,6 +162,8 @@ public function parent(): self
152162
153163 /**
154164 * Return whether this path is absolute
165+ *
166+ * @psalm-mutation-free
155167 */
156168 public function isAbsolute (): bool
157169 {
@@ -160,6 +172,8 @@ public function isAbsolute(): bool
160172
161173 /**
162174 * Return whether this path is relative
175+ *
176+ * @psalm-mutation-free
163177 */
164178 public function isRelative (): bool
165179 {
0 commit comments