예제 #1
0
파일: Hasher.php 프로젝트: sndsgd/fs
 /**
  * @param string $dir The directory to hash
  * @throws \InvalidArgumentException If the directory is not readable
  */
 public function __construct(string $dir)
 {
     $this->dir = Fs::dir($dir);
     if (!$this->dir->test(Fs::EXISTS | Fs::READABLE)) {
         throw new \InvalidArgumentException(sprintf("failed to hash directory; %s", $this->dir->getError()));
     }
 }