Skip to content
Permalink
Browse files

add doc for _basename()

  • Loading branch information...
saeideng committed Feb 26, 2018
1 parent 1f3507b commit 902e05e75f81131bab03d246eb89b3599955be13
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/Filesystem/File.php
@@ -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;

0 comments on commit 902e05e

Please sign in to comment.
You can’t perform that action at this time.