OK...
Moodle code checking has changed for arrays. I've run CodeSniffer to fix the issues sequentially:
Change array() to []:
phpcbf . --standard=Generic --sniffs=Generic.Arrays.DisallowLongArraySyntax
Add a comma to end of multiline array declarations:
phpcbf . --standard=NormalizedArrays --sniffs=NormalizedArrays.Arrays.CommaAfterLast
This causes code checker to throw errors as the commas are not followed by whitespace.
To fix, put new line after opening bracket and before closing bracket of multiline array:
phpcbf . --standard=NormalizedArrays --sniffs=NormalizedArrays.Arrays.ArrayBraceSpacing
This breaks indentation.
To fix:
phpcbf . --standard=Generic --sniffs=Generic.Arrays.ArrayIndent
Giving us almost 50,000 changes!
Nearly all the remaining flagged code checker issues are 'Missing required "MDL-[0-9]+" information in inline comment: // TODO...' Should we just change to TO-DO? I've tidied up 20-30 other issues, leaving around 20 that need a closer look.
Might, be worth checking the code generator (cli/ast_test_generator.php) for those tests/ast_filter... cases, as it will bring things back at some point otherwise.
OK... Moodle code checking has changed for arrays. I've run CodeSniffer to fix the issues sequentially: Change array() to []: phpcbf . --standard=Generic --sniffs=Generic.Arrays.DisallowLongArraySyntax Add a comma to end of multiline array declarations: phpcbf . --standard=NormalizedArrays --sniffs=NormalizedArrays.Arrays.CommaAfterLast This causes code checker to throw errors as the commas are not followed by whitespace. To fix, put new line after opening bracket and before closing bracket of multiline array: phpcbf . --standard=NormalizedArrays --sniffs=NormalizedArrays.Arrays.ArrayBraceSpacing This breaks indentation. To fix: phpcbf . --standard=Generic --sniffs=Generic.Arrays.ArrayIndent
Giving us almost 50,000 changes!
Nearly all the remaining flagged code checker issues are 'Missing required "MDL-[0-9]+" information in inline comment: // TODO...' Should we just change to TO-DO? I've tidied up 20-30 other issues, leaving around 20 that need a closer look.