Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ parameters:
path: pinc/DifferenceEngineWrapper.inc
- message: '#Call to function is_array\(\) with array<string> will always evaluate to true.#'
path: pinc/3rdparty/mediawiki/WordLevelDiff.php
- message: '#Function get_dpl_enforcement_for_user\(\) never returns null.*#'
path: pinc/daily_page_limit.inc

- message: '#invoked with \d+ parameter(s?), \d+((-\d+)?) required#'
- message: '#Variable .* might not be defined#'
Expand Down
12 changes: 9 additions & 3 deletions pinc/daily_page_limit.inc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ function get_dpl_count_for_user_in_round(string $username, Round $round): int
*/
function get_dpl_enforcement_for_user(string $username, Round $round, Project $project): ?int
{
// This function is a placeholder for sites to add any per-project
// customizations that might bypass the DPL enforcement. So while it
// doesn't currently return null, it might after site-specific updates.
// pgdp-production - projects with some primary languages bypass DPL
$dpl_exempt_languages = [
"French",
"French, Middle (ca.1400-1600)",
"French, Old (842-ca.1400)",
];
if (in_array($project->languages[0], $dpl_exempt_languages)) {
return null;
}

return get_dpl_count_for_user_in_round($username, $round);
}