public function checkDirArg($name) { $filepath = $this->checkPathArg($name); if (!is_dir($filepath)) { cli_error("'{$filepath}' is not a directory"); } return $filepath; }