Definition at line 13 of file CodeStyle.php.
Elgg\Project\CodeStyle::analyzeFile |
( |
|
$filepath, |
|
|
|
$content = null |
|
) |
| |
Analyze a file for problems and return a report.
- Parameters
-
string | $filepath | Path of file to analyze |
string | $content | The file's content (optional) |
- Returns
- array Report with keys:
remaining_problems : string[] Problems which could not be fixed
corrections : string[] Problems which were fixed
new_content : string|null Null if no corrections made, otherwise the corrected content
Definition at line 96 of file CodeStyle.php.
Elgg\Project\CodeStyle::findFiles |
( |
|
$dir, |
|
|
& |
$files |
|
) |
| |
|
protected |
Find files within a directory (recurse for subdirectories)
- Parameters
-
string | $dir | Directory to search |
array | &$files | Reference to found files |
- Returns
- void
Definition at line 147 of file CodeStyle.php.
Elgg\Project\CodeStyle::findFilesToAnalyze |
( |
|
$root | ) |
|
Find files which can be analyzed/fixed by this component.
- Parameters
-
string | $root | Root directory |
- Returns
- string[] File paths. All directory separators will be "/"
Definition at line 77 of file CodeStyle.php.
Elgg\Project\CodeStyle::fixDirectory |
( |
|
$root, |
|
|
|
$dry_run = false |
|
) |
| |
Fix problems in a directory of files and return a report.
- Parameters
-
string | $root | Root directory |
bool | $dry_run | If set to true, no files will be written |
- Returns
- array Report of notable files
Definition at line 38 of file CodeStyle.php.
Elgg\Project\CodeStyle::normalizePath |
( |
|
$path | ) |
|
|
protected |
Normalize a path.
- Parameters
-
string | $path | A file/dir path |
- Returns
- string
Definition at line 194 of file CodeStyle.php.
Elgg\Project\CodeStyle::$file_pattern = '~\.(?:php|js|css|xml|json|yml|txt|rst|md|gitignore|htaccess|mailmap|sh)$~' |
|
protected |
Elgg\Project\CodeStyle::$substr_start |
|
protected |
const Elgg\Project\CodeStyle::KEY_CORRECTIONS = 'corrections' |
const Elgg\Project\CodeStyle::KEY_NEW_CONTENT = 'new_content' |
const Elgg\Project\CodeStyle::KEY_REMAINING = 'remaining' |
The documentation for this class was generated from the following file: