|
|
@@ -182,25 +182,23 @@ class Path
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get the name of the file or path.
|
|
|
+ * Get the base name of the path.
|
|
|
*
|
|
|
- * @return array|string Returns the name of the file or path.
|
|
|
- * If the path has an extension, it returns the name without the extension as a string.
|
|
|
- * If the path doesn't have an extension, it returns the name as an array containing the directory name and the file name.
|
|
|
+ * @return string The base name of the path.
|
|
|
*/
|
|
|
- public function name(): array|string
|
|
|
+ public function basename(): string
|
|
|
{
|
|
|
- return pathinfo($this->path, PATHINFO_FILENAME);
|
|
|
+ return pathinfo($this->path, PATHINFO_BASENAME);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get the base name of the path.
|
|
|
+ * Get the name of the file or path.
|
|
|
*
|
|
|
- * @return string The base name of the path.
|
|
|
+ * @return string Returns the name of the file without its extension
|
|
|
*/
|
|
|
- public function basename(): string
|
|
|
+ public function name(): string
|
|
|
{
|
|
|
- return pathinfo($this->path, PATHINFO_BASENAME);
|
|
|
+ return pathinfo($this->path, PATHINFO_FILENAME);
|
|
|
}
|
|
|
|
|
|
/**
|