public function checkArg(array $opt, &$arg) { if (!empty($opt[self::REALPATH])) { $path = realpath($arg); if ($path === FALSE) { throw new \Exception("File path '{$arg}' not found."); } $arg = $path; } }