src/Hash.php
private function validate($hash, string $validation_regex): void {
    if(!is_string($hash) || preg_match($validation_regex, $hash) === 0) {
      throw new InvalidArgumentException('Expected hash, but got ' . var_export($hash, true) . '] instead');
    }
  }
private function validate($hash, string $validation_regex): void {
    if(!is_string($hash) || preg_match($validation_regex, $hash) === 0) {
      throw new InvalidArgumentException('Expected hash, but got ' . var_export($hash, true) . '] instead');
    }
  }
private function validate ( $ hash , string $ validation_regex ) : void { if ( ! is_string ( $ hash ) || preg_match ( $ validation_regex , $ hash ) === 0 ) { throw new InvalidArgumentException ( 'Expected hash, but got ' . var_export ( $ hash , true ) . '] instead' ) ; } }
Ensures the hash passed in is valid

@param  string  $hash
@param  string  $validation_regex
Ensures the hash passed in is valid