X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiCSPReport.php;h=0df0ca97d1cc39ee015681acdfb4409496a6f2d6;hb=dbad540cd37617879aff6f28ce9c016dd8049d4e;hp=3a78c1350c89b11c3702457834c066e4194cb55a;hpb=aae0c8d42562d5d3f70cc18fa687ae331996b66f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiCSPReport.php b/includes/api/ApiCSPReport.php index 3a78c1350c..0df0ca97d1 100644 --- a/includes/api/ApiCSPReport.php +++ b/includes/api/ApiCSPReport.php @@ -63,9 +63,9 @@ class ApiCSPReport extends ApiBase { /** * Log CSP report, with a different severity depending on $flags - * @param $flags Array Flags for this report - * @param $logLine String text of log entry - * @param $context Array logging context + * @param array $flags Flags for this report + * @param string $logLine text of log entry + * @param array $context logging context */ private function logReport( $flags, $logLine, $context ) { if ( in_array( 'false-positive', $flags ) ) { @@ -80,8 +80,8 @@ class ApiCSPReport extends ApiBase { /** * Get extra notes about the report. * - * @param $report Array The CSP report - * @return Array + * @param array $report The CSP report + * @return array */ private function getFlags( $report ) { $reportOnly = $this->getParameter( 'reportonly' ); @@ -115,7 +115,7 @@ class ApiCSPReport extends ApiBase { $req = $this->getRequest(); $contentType = $req->getHeader( 'content-type' ); if ( $contentType !== 'application/json' - && $contentType !=='application/csp-report' + && $contentType !== 'application/csp-report' ) { $this->error( 'wrongformat', __METHOD__ ); } @@ -155,9 +155,9 @@ class ApiCSPReport extends ApiBase { /** * Get text of log line. * - * @param $flags Array of additional markers for this report - * @param $report Array the csp report - * @return String Text to put in log + * @param array $flags of additional markers for this report + * @param array $report the csp report + * @return string Text to put in log */ private function generateLogLine( $flags, $report ) { $flagText = ''; @@ -177,8 +177,8 @@ class ApiCSPReport extends ApiBase { /** * Stop processing the request, and output/log an error * - * @param $code String error code - * @param $method String method that made error + * @param string $code error code + * @param string $method method that made error * @throws ApiUsageException Always */ private function error( $code, $method ) { @@ -216,6 +216,7 @@ class ApiCSPReport extends ApiBase { /** * Mark as internal. This isn't meant to be used by normal api users + * @return bool */ public function isInternal() { return true; @@ -223,6 +224,7 @@ class ApiCSPReport extends ApiBase { /** * Even if you don't have read rights, we still want your report. + * @return bool */ public function isReadMode() { return false; @@ -232,6 +234,7 @@ class ApiCSPReport extends ApiBase { * Doesn't touch db, so max lag should be rather irrelavent. * * Also, this makes sure that reports aren't lost during lag events. + * @return bool */ public function shouldCheckMaxLag() { return false;