Returns the absolute filename of this file.
public getFilename ( ) : string | ||
return | string |
initStandard('PSR2'); $files = $phpcs->process(array(__FILE__)); foreach ($files as $file) { echo $file->getFilename(); }
initStandard('PSR2'); $file = $phpcs->processFile('filename.php'); echo $file->getFilename();In this example, we process a single file ('filename.php') using the processFile method and print the filename of the resulting PHP_CodeSniffer_File object. Based on the code examples provided, it is likely that the PHP_CodeSniffer package library being used is a coding standards enforcement tool for PHP.