PHP_CodeSniffer
PHP_CodeSniffer copied to clipboard
Storing formatted code in a variable as a string within PHP scripts
Hello,
I'm looking for a way to store formatted code as a string in a variable within PHP scripts, not from a console program. Is it possible with this library? Something like,
$phpcbf = new \PHP_CodeSniffer\Fixer();
$phpcbf->setConfig($config);
$fixedCode = $phpcbf->getFormatted($codeToFix);