Skip to content

Commit

Permalink
add doc for _basename()
Browse files Browse the repository at this point in the history
  • Loading branch information
saeideng committed Mar 22, 2018
1 parent 1f3507b commit 902e05e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Filesystem/File.php
Expand Up @@ -357,11 +357,13 @@ public function name()
/**
* Returns the file basename. simulate the php basename().
*
* @param string $path Path to file
* @param string|null $ext The name of the extension
* @return string the file basename.
*/
protected function _basename($name, $ext = null)
protected function _basename($path, $ext = null)
{
$splInfo = new SplFileInfo($name);
$splInfo = new SplFileInfo($path);
$name = ltrim($splInfo->getFilename(), DS);
if ($ext === null || rtrim($name, $ext) === '') {
return $name;
Expand Down

0 comments on commit 902e05e

Please sign in to comment.