Skip to content

Commit

Permalink
fix(core): `\LastDragon_ru\LaraASP\Core\Path\FilePath::getExtension()…
Browse files Browse the repository at this point in the history
…` cannot return empty string.
  • Loading branch information
LastDragon-ru committed Feb 14, 2025
1 parent 5410f3a commit cc7d283
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/Path/FilePath.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ protected function getDirectory(): DirectoryPath {
return new DirectoryPath(dirname($this->path));
}

/**
* @return ?non-empty-string
*/
public function getExtension(): ?string {
$extension = pathinfo($this->path, PATHINFO_EXTENSION);
$extension = $extension !== '' ? $extension : null;
Expand Down
3 changes: 3 additions & 0 deletions packages/documentator/src/Processor/FileSystem/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public function __construct(
}
}

/**
* @return ?non-empty-string
*/
public function getExtension(): ?string {
return $this->path->getExtension();
}
Expand Down

0 comments on commit cc7d283

Please sign in to comment.