ExistenceCheckerInterface
Checks the existence of files and directories in a given base path.
Description
This interface defines the contract for determining which candidate paths actually exist in the target repository.
Methods
Checks if a path exists as a file or directory.
Filters a list of paths to only those that exist.
Checks if a path is a directory.
Checks if a path is a file.
Checks if a path exists as a file or directory.
public
exists(
string
$basePath,
string
$path) : bool
Parameters
$basePath
:
string
Description
the repository base path used to resolve the candidate
$path
:
string
Description
The path to check (e.g., "/.github/" or "/.editorconfig")
Return values
Description
True if the path exists as a file or directory
Filters a list of paths to only those that exist.
public
filterExisting(
string
$basePath,
array<int, string>
$paths) : array<int, string>
Parameters
$basePath
:
string
Description
the repository base path used to resolve the candidates
$paths
:
array<int, string>
Description
The paths to filter
Return values
Description
Only the paths that exist
Checks if a path is a directory.
public
isDirectory(
string
$basePath,
string
$path) : bool
Parameters
$basePath
:
string
Description
the repository base path used to resolve the candidate
$path
:
string
Description
The path to check (e.g., "/.github/")
Return values
Description
True if the path exists and is a directory
Checks if a path is a file.
public
isFile(
string
$basePath,
string
$path) : bool
Parameters
$basePath
:
string
Description
the repository base path used to resolve the candidate
$path
:
string
Description
The path to check (e.g., "/.editorconfig")
Return values
Description
True if the path exists and is a file