aboutsummaryrefslogtreecommitdiffstats
path: root/includes/editpage/Constraint/MissingCommentConstraint.php
Commit message (Collapse)AuthorAgeFilesLines
* Remove 2-line PHPDocs that just repeat the types from the codethiemowmde2025-01-171-4/+0
| | | | | | | | | | | | | | | | Same as Ia294bf4 did for 1-line comments. This patch removes slightly more complex 2-line PHPDoc comments that don't add any new information to the code, but literally repeat what the code already says. They say "don't document the code, code the documentation", and we are doing this more and more. We just tend to forget to remove the obsolete comments. Note I'm also removing a line of text in a few cases when it's very short and literally says the same as the method name. Again, such comments add zero new information. Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
* editpage/Constraint: Resolve TODOs about `==` / `===`Bartosz Dziewoński2024-07-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In all of these comparisons, both sides are strings (enforced by type hints), so we don't need to worry about type jugging, and only need to consider if it's possible for both sides to be numeric strings [1] before we change the `==` comparisons to `===`. AutoSummaryMissingSummaryConstraint.php: The return value of md5() is very unlikely to be a numeric string (and when it is, this code would work incorrectly, in effect only comparing a part of the hash). Seems safe to change it. MissingCommentConstraint.php: NewSectionMissingSubjectConstraint.php: The empty string is not a numeric string. Safe to change. [1] "If both operands are numeric strings [2] [...] then the comparison is done numerically." https://www.php.net/manual/en/language.operators.comparison.php [2] "A PHP string is considered numeric if it can be interpreted as an int or a float." https://www.php.net/manual/en/language.types.numeric-strings.php Change-Id: Id47f006797df9df392323610480196b1ce09a0f4
* EditPage::internalAttemptSave() - move more logic to constraintsDannyS7122024-07-111-3/+6
| | | | | | | | | Instead of conditionally adding the NewSectionMissingSubjectConstraint and MissingCommentConstraint based on creating a new section, always add those and have the constraints themselves just pass if not creating a new section Bug: T157658 Change-Id: Ie5bf352bd714b6b706445f4f02c986706f26bb1f
* Update property declarations to use type hints in editpage/Constraint/Doğu Abaris2024-07-111-2/+1
| | | | | | This change improves type safety and code readability. Change-Id: I839bff97e10188af79d658b44caa5413f6c538ad
* build: Updating dependencieslibraryupgrader2021-07-221-2/+2
| | | | | | | | | | | | | | composer: * mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0 The following sniffs now pass and were enabled: * Generic.ControlStructures.InlineControlStructure * MediaWiki.PHPUnit.AssertCount.NotUsed npm: * svgo: 2.3.0 → 2.3.1 * https://npmjs.com/advisories/1754 (CVE-2021-33587) Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
* EditPage: Factor out more constraintsDannyS7122020-11-041-0/+61
CreationPermissionConstraint DefaultTextConstraint MissingCommentConstraint MissingSummaryConstraint Bug: T157658 Change-Id: I55cf336ff6dfb990045e43e6dcd7437a241a46b2