aboutsummaryrefslogtreecommitdiffstats
path: root/includes/editpage/Constraint/EditConstraintRunner.php
Commit message (Collapse)AuthorAgeFilesLines
* Remove 2-line PHPDocs that just repeat the types from the codethiemowmde2025-01-171-10/+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
* 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
* Various doc fixes about false on method arguments/return typesUmherirrender2022-11-101-1/+1
| | | | | | Doc-only changes Change-Id: I5177f582ae7ee70c357e9389fed14819faf79463
* build: Updating dependencieslibraryupgrader2021-07-221-3/+3
| | | | | | | | | | | | | | 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
* Minor tweaks to edit constraintsDannyS7122020-11-031-8/+35
| | | | | | | | | | - EditConstraintRunner debug logging uses `info` for the failed constraint - Differentiate between the two PageSizeConstraints in debug logs - Add or tweak some comments - Normalize SpamRegexConstraint logs Bug: T157658 Change-Id: I9d0e8d48a104320f29831357b45a4003942b04fd
* EditPage: Migrate more checks to constraintDannyS7122020-10-261-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add - ContentModelChangeConstraint - EditRightConstraint - ImageRedirectConstraint - ReadOnlyConstraint - UserBlockConstraint - UserRateLimitConstraint Additionally: - Split EditPageTest into a separate file for all of the constraints being tested - Add a helper EditConstraintTestTrait - Add debug logging for EditConstraintRunner for the result of each constraint - Changed the order of some of the checks, which may result in a different failure code if multiple checks were going to fail, but shouldn't change the overall result of whether an edit fails or not. Bug: T157658 Change-Id: Ib8f8b62b9928544e5559c96d82bf850dd8cf9b05
* Add EditConstraintFactory, migrate SimpleAntiSpamConstraintDannyS7122020-10-211-1/+1
| | | | | | | | | Factory is a service in ServiceWiring, given the number of dependencies that will eventually be needed, but is internal and has no corresponding method in MediaWikiServices Bug: T157658 Change-Id: I801a09f5133bed14da10c64a42ca0658024357d3
* Introduce EditConstraint system, migrate unicode check to constraintDannyS7122020-10-201-0/+102
This is the start of "Phase 1" of the migration described in T157658#6191234. For now, only a single constraint, the requirement that EditPage::$unicodeCheck match the expected value, is moved to the new system, in the UnicodeConstraint class. Both the EditConstraintRunner and the new UnicodeConstraint have 100% test coverage with pure unit tests. Bug: T157658 Change-Id: I4fc806ec0fd631e265948a59244295eebec691fa