/** * @param string $filename * @param Settings $settings * @return Result[] */ public function checkFile($filename, Settings $settings = null) { if ($settings === null) { $settings = new Settings(); } $content = $this->loadFile($filename); $checker = new Checker($settings); $results = $checker->check($content); $this->setFilePathToResults($results, $filename); return $results; }
/** * Test for check. * * @dataProvider checkerProvider */ public function testAllLevels($subject, $codiceFiscaleToCheck, $omocodiaLevel, $expected) { $checker = new Checker($subject, array('codiceFiscaleToCheck' => $codiceFiscaleToCheck, 'omocodiaLevel' => $omocodiaLevel)); $actual = $checker->check(); $this->assertEquals($expected, $actual); }
} else { usage($_SERVER['argv']); } continue; } if ($option == "-e" || $option == "--exclude") { $i++; if ($i < $_SERVER['argc']) { $chk->exclude = $_SERVER['argv'][$i]; } else { usage($_SERVER['argv']); } continue; } $needhelp = false; $chk->check($option); } if ($needhelp) { usage($_SERVER['argv']); } class Checker { public $debug = 0; public $exclude = ''; protected $_filename; const DEPRECATED = 'deprecated-func'; const DEPRECATED_ALT = 'deprecated-with-alt'; const KEYWORD = 'keyword'; const TOSTRING = 'tostring-noparam'; const NOSTATIC = 'no-static'; const NOTPUBLIC = 'not-public';