PhpFixerOptions
class PhpFixerOptions (View source)
Options for PhpFixer.
Properties
protected Repository | $config | ||
private string|null | $webRoot | The absolute path to the web root directory. |
|
private string[]|null | $filterByExtensions | The list of file extensions to be parsed. |
|
private string[]|null | $filterIncludeFiles | The list of additional files (relative to the webroot) to be parsed. |
|
private string[]|null | $ignoredDirectoriesByName | The directory names that should not be parsed. |
|
private string[]|null | $ignoredDirectoriesByPath | The directory paths (relative to the webroot) that should not be parsed (allowed placeholders: |
|
private string[]|null | $bootstrapFiles | The file paths (relative to the webroot) that are executed before checking the PHP version. |
|
private string[]|null | $phpOnlyNonPsr4Files | The file paths (relative to the webroot) that only contain PHP and that don't follow PSR-4 class names (allowed placeholders: |
|
private string[]|null | $phpOnlyNonPsr4Directories | The directory paths (relative to the webroot) that contain PHP-only files that don't follow PSR-4 class names (allowed placeholders: |
|
private string[]|null | $phpOnlyNonPsr4Regexes | The regular expressions describing the paths (relative to the web root) that contain PHP-only files that don't follow PSR-4 class names. |
|
private string[]|null | $phpOnlyPsr4Files | The file paths (relative to the webroot) that only contain PHP and that follow PSR-4 class names (allowed placeholders: |
|
private string[]|null | $phpOnlyPsr4Directories | The directory paths (relative to the webroot) that contain PHP-only files that follow PSR-4 class names (allowed placeholders: |
|
private string[]|null | $phpOnlyPsr4Regexes | The regular expressions describing the paths (relative to the web root) that contain PHP-only files that follow PSR-4 class names. |
|
private string[]|null | $directoriesWithMixedContentsRegex | The list of regular expressions that should be used to check if a directory contains files with mixed flags. |
|
private bool | $isCacheDisabled | Is the fixers cache disabled? |
|
private string | $minimumPhpVersion | The minimum PHP version. |
Methods
Normalize a path.
Get the default absolute path to the web root directory.
Get the absolute path to the web root directory.
Set the absolute path to the web root directory.
Get the list of file extensions to be parsed.
Set the list of file extensions to be parsed.
Get the list of additional files (relative to the webroot) to be parsed.
Set the list of additional files (relative to the webroot) to be parsed.
Get the directory names that should not be parsed.
Set the directory names that should not be parsed.
Get the directory paths (relative to the webroot) that should not be parsed (allowed placeholders:
Set the directory paths (relative to the webroot) that should not be parsed (allowed placeholders:
Get the file paths (relative to the webroot) that are executed before checking the PHP version.
Set the file paths (relative to the webroot) that are executed before checking the PHP version.
Get the file paths (relative to the webroot) that only contain PHP and that don't follow PSR-4 class names (allowed placeholders:
Set the file paths (relative to the webroot) that only contain PHP and that don't follow PSR-4 class names (allowed placeholders:
Get the directory paths (relative to the webroot) that contain PHP-only files that don't follow PSR-4 class names (allowed placeholders:
Set the directory paths (relative to the webroot) that contain PHP-only files that don't follow PSR-4 class names (allowed placeholders:
Get the regular expressions describing the paths (relative to the web root) that contain PHP-only files that don't follow PSR-4 class names.
Get the file paths (relative to the webroot) that only contain PHP and that follow PSR-4 class names (allowed placeholders:
Set the file paths (relative to the webroot) that only contain PHP and that follow PSR-4 class names (allowed placeholders:
Get the directory paths (relative to the webroot) that contain PHP-only files that follow PSR-4 class names (allowed placeholders:
Set the directory paths (relative to the webroot) that contain PHP-only files that follow PSR-4 class names (allowed placeholders:
Get the regular expressions describing the paths (relative to the web root) that contain PHP-only files that don't follow PSR-4 class names.
Is the fixers cache disabled.
Is the fixers cache disabled.
Get the minimum PHP version.
Set the minimum PHP version.
Check if a directory contains PHP files with mixed flags.
Get the list of regular expressions that should be used to check if a directory contains files with mixed flags.
Add items to the list of regular expressions that should be used to check if a directory contains files with mixed flags.
Details
__construct(Repository $config)
Initialize the instance.
string
normalizePath(string $path, bool $isDir, bool $isRelative)
Normalize a path.
static string
getDefaultWebRoot()
Get the default absolute path to the web root directory.
string
getWebRoot()
Get the absolute path to the web root directory.
$this
setWebRoot(string|mixed $value)
Set the absolute path to the web root directory.
string[]
getFilterByExtensions()
Get the list of file extensions to be parsed.
$this
setFilterByExtensions(array $value)
Set the list of file extensions to be parsed.
string[]
getFilterIncludeFiles()
Get the list of additional files (relative to the webroot) to be parsed.
$this
setFilterIncludeFiles(string[] $value)
Set the list of additional files (relative to the webroot) to be parsed.
string[]
getIgnoredDirectoriesByName()
Get the directory names that should not be parsed.
$this
setIgnoredDirectoriesByName(array $value)
Set the directory names that should not be parsed.
string[]
getIgnoredDirectoriesByPath()
Get the directory paths (relative to the webroot) that should not be parsed (allowed placeholders:
$this
setIgnoredDirectoriesByPath(array $value)
Set the directory paths (relative to the webroot) that should not be parsed (allowed placeholders:
string[]
getBootstrapFiles()
Get the file paths (relative to the webroot) that are executed before checking the PHP version.
$this
setBootstrapFiles(array $value)
Set the file paths (relative to the webroot) that are executed before checking the PHP version.
string[]
getPhpOnlyNonPsr4Files()
Get the file paths (relative to the webroot) that only contain PHP and that don't follow PSR-4 class names (allowed placeholders:
$this
setPhpOnlyNonPsr4Files(array $value)
Set the file paths (relative to the webroot) that only contain PHP and that don't follow PSR-4 class names (allowed placeholders:
string[]
getPhpOnlyNonPsr4Directories()
Get the directory paths (relative to the webroot) that contain PHP-only files that don't follow PSR-4 class names (allowed placeholders:
$this
setPhpOnlyNonPsr4Directories(array $value)
Set the directory paths (relative to the webroot) that contain PHP-only files that don't follow PSR-4 class names (allowed placeholders:
string[]
getPhpOnlyNonPsr4Regexes()
Get the regular expressions describing the paths (relative to the web root) that contain PHP-only files that don't follow PSR-4 class names.
string[]
getPhpOnlyPsr4Files()
Get the file paths (relative to the webroot) that only contain PHP and that follow PSR-4 class names (allowed placeholders:
$this
setPhpOnlyPsr4Files(array $value)
Set the file paths (relative to the webroot) that only contain PHP and that follow PSR-4 class names (allowed placeholders:
string[]
getPhpOnlyPsr4Directories()
Get the directory paths (relative to the webroot) that contain PHP-only files that follow PSR-4 class names (allowed placeholders:
$this
setPhpOnlyPsr4Directories(array $value)
Set the directory paths (relative to the webroot) that contain PHP-only files that follow PSR-4 class names (allowed placeholders:
string[]
getPhpOnlyPsr4Regexes()
Get the regular expressions describing the paths (relative to the web root) that contain PHP-only files that don't follow PSR-4 class names.
bool
isCacheDisabled()
Is the fixers cache disabled.
$this
setIsCacheDisabled(bool $value)
Is the fixers cache disabled.
string
getMinimumPhpVersion()
Get the minimum PHP version.
$this
setMinimumPhpVersion(string $value)
Set the minimum PHP version.
bool
isDirectoryWithMixedContents(string $path)
Check if a directory contains PHP files with mixed flags.
protected string[]
getDirectoriesWithMixedContentsRegex()
Get the list of regular expressions that should be used to check if a directory contains files with mixed flags.
protected
addDirectoriesWithMixedContentsRegex(string $path, array $directoriesWithMixedContentsRegex)
Add items to the list of regular expressions that should be used to check if a directory contains files with mixed flags.