/** * Report unused parameters, so the client gets a hint in case it gave us parameters we don't know, * for example in case of spelling mistakes or a missing 'g' prefix for generators. */ protected function reportUnusedParams() { $paramsUsed = $this->getParamsUsed(); $allParams = $this->getRequest()->getValueNames(); if (!$this->mInternalMode) { // Printer has not yet executed; don't warn that its parameters are unused $printerParams = array_map(array($this->mPrinter, 'encodeParamName'), array_keys($this->mPrinter->getFinalParams() ?: array())); $unusedParams = array_diff($allParams, $paramsUsed, $printerParams); } else { $unusedParams = array_diff($allParams, $paramsUsed); } if (count($unusedParams)) { $s = count($unusedParams) > 1 ? 's' : ''; $this->setWarning("Unrecognized parameter{$s}: '" . implode($unusedParams, "', '") . "'"); } }