PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

Storing formatted code in a variable as a string within PHP scripts

Open onet4 opened this issue 2 years ago • 0 comments

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);

onet4 avatar Feb 19 '22 13:02 onet4