-
-
Notifications
You must be signed in to change notification settings - Fork 0
ExistenceChecker
github-actions edited this page Apr 11, 2026
·
1 revision
Checks the existence of files and directories in a given base path.
This class determines which candidate paths from the canonical list actually exist in the target repository, enabling selective export-ignore rules.
- Full name:
\FastForward\DevTools\GitAttributes\ExistenceChecker - This class is marked as final and can't be subclassed
- This class implements:
\FastForward\DevTools\GitAttributes\ExistenceCheckerInterface - This class is a Final class
public __construct(\Symfony\Component\Filesystem\Filesystem $filesystem = new \Symfony\Component\Filesystem\Filesystem()): mixedParameters:
| Parameter | Type | Description |
|---|---|---|
$filesystem |
\Symfony\Component\Filesystem\Filesystem |
Checks if a path exists as a file or directory.
public exists(string $basePath, string $path): boolParameters:
| Parameter | Type | Description |
|---|---|---|
$basePath |
string | the repository base path used to resolve the candidate |
$path |
string | The path to check (e.g., "/.github/" or "/.editorconfig") |
Return Value:
True if the path exists as a file or directory
Filters a list of paths to only those that exist.
public filterExisting(string $basePath, list<string> $paths): list<string>Parameters:
| Parameter | Type | Description |
|---|---|---|
$basePath |
string | the repository base path used to resolve the candidates |
$paths |
list | The paths to filter |
Return Value:
Only the paths that exist
Checks if a path is a directory.
public isDirectory(string $basePath, string $path): boolParameters:
| Parameter | Type | Description |
|---|---|---|
$basePath |
string | the repository base path used to resolve the candidate |
$path |
string | The path to check (e.g., "/.github/") |
Return Value:
True if the path exists and is a directory
Checks if a path is a file.
public isFile(string $basePath, string $path): boolParameters:
| Parameter | Type | Description |
|---|---|---|
$basePath |
string | the repository base path used to resolve the candidate |
$path |
string | The path to check (e.g., "/.editorconfig") |
Return Value:
True if the path exists and is a file