예제 #1
0
 /**
  * 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);
 }
예제 #2
0
 /**
  * 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()));
 }