/**
* 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 ) ) {
/**
* 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' );
$req = $this->getRequest();
$contentType = $req->getHeader( 'content-type' );
if ( $contentType !== 'application/json'
- && $contentType !=='application/csp-report'
+ && $contentType !== 'application/csp-report'
) {
$this->error( 'wrongformat', __METHOD__ );
}
/**
* 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 = '';
/**
* 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 ) {
/**
* Load basic request parameters for this Special page.
- * @param $subPage
+ * @param string $subPage
*/
private function loadRequestParameters( $subPage ) {
if ( $this->mLoadedRequest ) {
// Don't show a "create account" link if the user can't.
if ( $this->showCreateAccountLink() ) {
// link to the other action
- $linkTitle = $this->getTitleFor( $this->isSignup() ? 'Userlogin' :'CreateAccount' );
+ $linkTitle = $this->getTitleFor( $this->isSignup() ? 'Userlogin' : 'CreateAccount' );
$linkq = $this->getReturnToQueryStringFragment();
// Pass any language selection on to the mode switch link
if ( $this->mLanguage ) {
/**
* Adds fields provided via the deprecated UserLoginForm / UserCreateForm hooks
- * @param $fieldDefinitions array
+ * @param array $fieldDefinitions
* @param FakeAuthTemplate $template
* @return array
*/
/**
* Create a language object for a given language code
* @param string $code
- * @param $fallback boolean Whether we're going through language fallback chain
+ * @param bool $fallback Whether we're going through language fallback chain
* @throws MWException
* @return Language
*/
* @return int[]
*/
private static function tsToIranian( $ts ) {
- $gy = substr( $ts, 0, 4 ) -1600;
- $gm = substr( $ts, 4, 2 ) -1;
- $gd = substr( $ts, 6, 2 ) -1;
+ $gy = substr( $ts, 0, 4 ) - 1600;
+ $gm = substr( $ts, 4, 2 ) - 1;
+ $gd = substr( $ts, 6, 2 ) - 1;
# Days passed from the beginning (including leap years)
$gDayNo = 365 * $gy
(int)( ( 275 * $zm ) / 9 ) + $zd + 1729777;
}
- $zl = $zjd -1948440 + 10632;
+ $zl = $zjd - 1948440 + 10632;
$zn = (int)( ( $zl - 1 ) / 10631 );
$zl = $zl - 10631 * $zn + 354;
$zj = ( (int)( ( 10985 - $zl ) / 5316 ) ) * ( (int)( ( 50 * $zl ) / 17719 ) ) +
if ( $start < 0 ) {
$start = 0;
}
- $groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber;
+ $groupedNumber = substr( $number, $start, $end - $start ) . $groupedNumber;
$end = $start;
if ( $numMatches > 1 ) {
// use the last pattern for the rest of the number