-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- uses generator - the order of calling the filter() and exclude() methods does not matter - the in() and from() methods accept the mask
- Loading branch information
Showing
12 changed files
with
611 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Nette Framework (https://nette.org) | ||
* Copyright (c) 2004 David Grudl (https://davidgrudl.com) | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Nette\Utils; | ||
|
||
use Nette; | ||
|
||
|
||
/** | ||
* Represents the file or directory returned by the Finder. | ||
* @internal do not create instances directly | ||
*/ | ||
final class FileInfo extends \SplFileInfo | ||
{ | ||
private string $relativePath; | ||
|
||
|
||
public function __construct(string $file, string $relativePath = '') | ||
{ | ||
parent::__construct($file); | ||
$this->setInfoClass(static::class); | ||
$this->relativePath = $relativePath; | ||
} | ||
|
||
|
||
/** | ||
* Returns the relative directory path. | ||
*/ | ||
public function getRelativePath(): string | ||
{ | ||
return $this->relativePath; | ||
} | ||
|
||
|
||
/** | ||
* Returns the relative path including file name. | ||
*/ | ||
public function getRelativePathname(): string | ||
{ | ||
return ($this->relativePath === '' ? '' : $this->relativePath . DIRECTORY_SEPARATOR) | ||
. $this->getBasename(); | ||
} | ||
} |
Oops, something went wrong.