private function validatePath($path) { if (!is_string($path)) { throw new \InvalidArgumentException("Path must be a valid string."); } if (empty($path)) { throw new \InvalidArgumentException("Path can't be empty."); } }