Skip to content

Commit

Permalink
commited 7.2 to 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
indianmodassir committed Oct 29, 2024
1 parent c92c058 commit 1178b67
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Release Notes
## [Unreleased](https://github.com/lazervel/path/releases/tag/v7.0.0)
## [Unreleased](https://github.com/lazervel/path/releases/tag/v7.3.0)

## [7.2.0](https://github.com/lazervel/path/releases/tag/v7.1.0) - 30 October 2024
## [7.3.0](https://github.com/lazervel/path/releases/tag/v7.3.0) - 31 October 2024
- Added `Path::canonicalize()` method in `path` develope by [@shahzadamodassir](https://github.com/shahzadamodassir)
- Added `Path::optimize()` method in `path` develope by [@shahzadamodassir](https://github.com/shahzadamodassir)

## [7.2.0](https://github.com/lazervel/path/releases/tag/v7.2.0) - 30 October 2024
- Added `Path::isAbsolute()` method in `path` develope by [@shahzadamodassir](https://github.com/shahzadamodassir)
- Added `Path::isLocal()` method in `path` develope by [@shahzadamodassir](https://github.com/shahzadamodassir)

Expand Down
21 changes: 21 additions & 0 deletions src/Model/PathModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,27 @@ public static function isLocal(string $path) : bool
return $absPath && self::isAbsolute($absPath);
}

/**
*
* @param string $path [required]
* @return string
*/
public static function optimize(string $path) : string
{
return self::doNormalize($path, true);
}

/**
*
* @param string $path [required]
* @return string|false
*/
public static function canonicalize(string $path)
{
$absPath = self::resolve($path);
return self::isLocal($absPath) ? $absPath : false;
}

/**
*
* @param string $path [required]
Expand Down

0 comments on commit 1178b67

Please sign in to comment.