/** * Reviews a file potentially modifying it, and returning issues * * @param type $fileResource * @param type $options * @return array[CodeIssue] an array of issues found */ function reviewTarget(Target $target, $options = null) { if (!$this->isSupported($target->getType())) { return false; } return $this->reviewFile($target->getPath(), $options); }
/** * Tests Target::unlink */ public function testUnlinkSuccess() { $path = sys_get_temp_dir() . '/foo'; $filename = 'foo.txt'; $target = new Target($path, $filename); $target->setupPath(); // create the file file_put_contents($target->getPathname(), 'content'); $target->unlink(); rmdir($target->getPath()); $this->assertFalse(file_exists($target->getPathname())); $this->assertFalse(is_dir($target->getPath())); }