Esempio n. 1
0
 /**
  * Sets the running file (the Phar that will be updated).
  *
  * @param string $file The file name or path.
  *
  * @throws Exception\Exception
  * @throws InvalidArgumentException If the file path is invalid.
  */
 public function setRunningFile($file)
 {
     if (false === is_file($file)) {
         throw InvalidArgumentException::create('The file "%s" is not a file or it does not exist.', $file);
     }
     $this->runningFile = $file;
 }
 /**
  * Sets the SHA256 hash of the publicKey file.
  * 
  * @param string $file SHA256 hash for publicKey
  * 
  * @throws Exception\Exception
  * @throws InvalidArgumentException If the hash is invalid.
  */
 public function setPublicKeyHash($hash)
 {
     if (strlen($hash) != 64) {
         throw InvalidArgumentException::create('The hash has an invalid length');
     }
     $this->publicKeyHash = $hash;
 }