code: public function setDir(string $dir)
      {
          if (!is_dir($dir)) {
              throw new Exception('Directory does not exist: ' . $dir);
          }
  
          $this->config['dir'] = rtrim($dir, '/\\') . DIRECTORY_SEPARATOR;
      }
docs: Set the dir.
  
  @param string $dir
  
  @throws Exception