Todaymade\Daux\Tree\Builder::getName PHP Method

getName() protected static method

Get name for a file
protected static getName ( string $path ) : string
$path string
return string
    protected static function getName($path)
    {
        // ['dir' => 1, 'basename' => 2, 'filename' => 3, 'extension' => 5]
        preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\\.([^\\.\\\\/]+?)|))[\\\\/\\.]*$%im', $path, $m);
        if (!isset($m[3])) {
            throw new RuntimeException('Name not found');
        }
        return $m[3];
    }