This class can parse PHP code to check if it matches given syntax rules.
It can parse PHP scripts in a given directory or from a given PHP code string and obtain the PHP tokens that represent the parsed code.
The class check if the code matches given syntax rules defined as sequences of tokens read from a separate configuration file.
The rules may be used to detect if the parsed code is using malicious code hidden as function calls with names defined as variables.
It can also reformat the parsed PHP code and generate a new code version that may be more readable than the original. |