aboutsummaryrefslogtreecommitdiffstats
path: root/includes/content
Commit message (Collapse)AuthorAgeFilesLines
* Namespace all remaining files in includes/changetagsJames D. Forrester2025-03-251-1/+1
| | | | | Bug: T353458 Change-Id: I3cf44dfe5425f2efb8409c83571c427447b053af
* Namespace all remaining files in includes/exceptionJames D. Forrester2025-03-256-8/+8
| | | | | | | | | In MediaWiki/Exception, to follow PSR-4 per plural vs. singular (this can be changed later if people really care). Also, move the couple of exceptions in here that were already namespaced in the MW-top-level into the new space. Bug: T353458 Change-Id: I12ed850ae99effb699a6d7ada173f54e72f0570e
* Namespace all remaining files in includes/loggingJames D. Forrester2025-03-191-2/+2
| | | | | Bug: T353458 Change-Id: Ibe1810f1c71316a9124e1dc6ae405097dafd5267
* Namespace all remaining files in includes/actionsJames D. Forrester2025-03-191-1/+1
| | | | | Bug: T353458 Change-Id: Id3ca24e22877e544b707a8a527a58e00cc1bc247
* Namespace all remaining files in includes/pageJames D. Forrester2025-03-1810-10/+10
| | | | | Bug: T353458 Change-Id: I7a9c74f2106655d41ae029742090253f541bd4a6
* content: Improve class docs for various Content classesTimo Tijhof2025-03-1218-318/+182
| | | | | | | | | | | | | * Move duplicate brief and ingroup from file doc to class doc. <https://gerrit.wikimedia.org/r/q/message:ingroup+owner:Krinkle> * Ensure methods have an understable brief, separate from other text. <https://www.mediawiki.org/wiki/Manual:Coding_conventions/Documentation> * Remove obsolete `todo` comments. Bug: T364652 Change-Id: I6eebbf20775e73d008ef86c592a7128456abcb06
* Use $string === '' instead of strlen( $string ) === 0Fomafix2025-01-301-1/+1
| | | | | | | | | Add $string === false or $string === null where $string can have other types than a string. Also document null as possible return value in FileRepo. Change-Id: Iaa29ba01c3fd6bea506debdc6f929edfe881c808
* Remove 2-line PHPDocs that just repeat the types from the codethiemowmde2025-01-172-9/+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
* Remove trivial 1-line PHPDocs that just repeat the codethiemowmde2025-01-167-61/+0
| | | | | | | | | | | | | I assume these are all either auto-generated by an IDE or the language-level type declarations have been added later. In any case the comments don't add any new information to what the code already says. This is just extra clutter that makes the code harder to read, I would argue. There are many, many more comments like this. In this patch I intentionally focus on the most trivial 1-line comments. Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
* ParserOptions: don't rely on Title in setupFakeRevision()daniel2024-11-271-1/+6
| | | | | | | | | | Avoid using Title in setupFakeRevision. This removes a blocker for narrowing the return type of RevisionRecord::getPage() to ProperRevisionRecord(). Bug: T380536 Depends-On: I54f75059f3d78100b393827db7bc25f253a559e8 Change-Id: I7cec5a47e269d3583306ff4ebd3123be500ec217
* Use ParserOutput::getLinkList() internallyC. Scott Ananian2024-11-151-2/+1
| | | | | | | | This replaces the internal uses of the deprecated ParserOutput::get* methods and isolates the ParserOutput internal representation from most of the users. Change-Id: I32df68714ffdf2f0745b974f47bc3ccceef1f41c
* Merge "Use explicit nullable type on parameter arguments"jenkins-bot2024-10-167-21/+21
|\
| * Use explicit nullable type on parameter argumentsUmherirrender2024-10-167-21/+21
| | | | | | | | | | | | | | | | | | | | | | Implicitly marking parameter $... as nullable is deprecated in php8.4, the explicit nullable type must be used instead Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a Break one long line in SpecialPage.php Bug: T376276 Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
* | Replace uses of deprecated ChangeTags static methodsJames D. Forrester2024-10-161-2/+1
|/ | | | | Bug: T360664 Change-Id: I3363a225e54bb2cae01ba066d432a8b7b21933d2
* Namespace all remaining classes in includes/parserJames D. Forrester2024-10-1510-10/+10
| | | | | Bug: T353458 Change-Id: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
* Document ParserOutput::resetParseStartTime() contract a bit moreLucas Werkmeister2024-10-071-0/+3
| | | | | | | See Wikibase change I6bba35cea2. Bug: T376433 Change-Id: Idb6fea7530839f2a769d12b18e6c6703f9e86636
* Switch over a bunch of class_alias uses to actualsJames D. Forrester2024-10-031-1/+1
| | | | Change-Id: Id175a83e71cc910eaee5d5890a9106872a3ca3b8
* Add namespace to IDBAccessObject and DBAccessObjectUtilsJames D. Forrester2024-09-271-1/+1
| | | | | Bug: T353458 Change-Id: I23cf7991f8792d4d000d1780463d8ce76dc0aee0
* Provide previous parse results to parser when renderingC. Scott Ananian2024-08-233-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | This patch lays the groundwork for incremental/selective parsing in Parsoid by ensuring that we can pass previous cached parses through the parse pipeline to Parsoid. We do this by adding a new render hint type, `previous-output`, and ensuring it is passed along. Because revisions can contain a ParserOutput which is the combination of separate ParserOutput objects for each of their slots, RenderedRevision also contains a method to unsplit the combined ParserOutput to reconstruct an original ParserOutput for use in incremental parsing. Currently this is mostly a stub, but illustrates how slot combination and splitting can work, assuming those transformations are reversible. Extra calls to ParserCache::getDirty() are added to some code paths in order to ensure that any previously-cached ParserOutput is available for selective update. In order to mitigate any performance concerns, these are only done for the Parsoid parser at the moment. Future patches will add additional metrics to quantify the cost/benefit ratio of the additional cache lookups on these paths. Bug: T363421 Bug: T371713 Change-Id: I440884f1d7e09c1ff9806f848b7b53a636367690
* Fix some typosMatěj Suchánek2024-08-181-1/+1
| | | | Change-Id: I1a41f33c65bc9edf2df248581a2c45c5c79c4f93
* Move Language and friends into Language namespaceJames D. Forrester2024-08-104-4/+4
| | | | | Bug: T353458 Change-Id: Id3202c0c4f4a2043bf97b7caee081acab684155c
* Move remaining four classes in includes/content into Content namespaceJames D. Forrester2024-08-1026-32/+47
| | | | | Bug: T353458 Change-Id: Ia0f3e22078550be410c4b87faf6aa4eabe6e270d
* Drop MessageContent, deprecated since 1.38James D. Forrester2024-08-103-166/+1
| | | | Change-Id: Ib53d4a04e6faa82b0ea553221e6c0c827f36017a
* Merge "Made the JsonContent Responsive"jenkins-bot2024-08-081-11/+13
|\
| * Made the JsonContent ResponsiveAnuj Agrawal2024-08-081-11/+13
| | | | | | | | | | | | | | Wrapped the HTML of JsonContent with a div and added a custom class to it. The class .noresize in mediawiki.content.json.less sets the overflow-x to auto and white-space to nowrap. This will make the JsonContent responsive with a horizontal scroll bar. Updated tests for the new behaviour of the JsonContent. Bug: T366300 Change-Id: Ibf1494fa0940c37cf36ebfa18442d86c318dd1d1
* | Add namespace to ContentModelChangeEbrahim Byagowi2024-08-081-1/+21
| | | | | | | | | | | | | | It adds MediaWiki\Content namespace to ContentModelChange Bug: T353458 Change-Id: Ia9fbff3b7d25a83be58fffbfc01274c9fcc7a482
* | Add namespace to FileContentHandlerEbrahim Byagowi2024-08-072-2/+8
| | | | | | | | | | | | It adds MediaWiki\Content namespace to FileContentHandler Change-Id: I2db36de12a60c78524ea6ee2d8866ff901a48cac
* | Add namespace to WikitextContentEbrahim Byagowi2024-08-065-3/+51
| | | | | | | | | | | | | | It adds MediaWiki\Content namespace to WikitextContent and two classes related. Change-Id: Ib74e4c5b3edac6aa0e35d3b2093ce1d0b794cb6d
* | Add namespace to CodeContentHandlerEbrahim Byagowi2024-08-064-4/+7
| | | | | | | | | | | | It adds MediaWiki\Content namespace to CodeContentHandler Change-Id: Ie02c727a66af7d0dae568eab67b242d5ffdf6431
* | Merge "[ParsoidParser] Remove unneeded code to set render ID"jenkins-bot2024-07-301-1/+20
|\ \
| * | [ParsoidParser] Remove unneeded code to set render IDC. Scott Ananian2024-07-191-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since I72c5e6f86b7f081ab5ce7a56f5365d2f75067a78 it is part of the contract of ContentRenderer::getParserOutput() that the render ID (and other cache parameters) will be set when it returns. (ContentHandler::getParserOutput() can set them even earlier if it has custom content-based overrides.) We had a lot of temporary backward-compatibility code "later" in the parse process to try to close the barn door if some code path "forgot" to set them, but these are unnecessary now. This patch removes that backward-compatibility code in ParsoidParser; there is similar remaining code in ParserCache etc. which can be addressed in follow ups. (For compatibility we do have to temporarily copy the render ID code inside ParsoidOutputAccess::parseUncachable, but that class is deprecated and will be removed.) The HtmlOutputRendererHelper path which used to call ParsoidParser::parseFakeRevision() is now replaced with a codepath that goes through RevisionRenderer. In order to maintain the same behavior of the ParsoidHandler, we have also added 'useParsoid' handling to the JsonContentHandler. This support can perhaps be deprecated eventually. Bug: T350538 Change-Id: I0853624cf785f72fd956c6c2336f979f4402a68f
* | | Merge "WikiTextStructure: Drop message fallback to old cirrussearch message"jenkins-bot2024-07-301-4/+0
|\ \ \
| * | | WikiTextStructure: Drop message fallback to old cirrussearch messageReedy2024-07-291-4/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | Code has been around since Aug 4, 2016 Follows-Up: I4178f872996800379843301f7119840f4a4551df Bug: T344806 Change-Id: I48259c5b3230ce79d45e66e46733248f46d1a4a8
* / / Replace deprecated LogFormatter::newFromRow/newFromEntryUmherirrender2024-07-291-1/+5
|/ / | | | | | | Change-Id: I453ce3148a46fcb9cc5c685cee92274e0cb4f98a
* | Deprecate wfMergeErrorArrays()Bartosz Dziewoński2024-07-181-1/+1
| | | | | | | | | | | | No longer used anywhere. Change-Id: Id764fa47ab57875e99fee7d8b87d009cde73ea52
* | Replace User, Title, and WikiPage in more signaturesDaimona Eaytoy2024-07-101-6/+12
|/ | | | Change-Id: I04e408e734edc5498c32c4433f02da613bbfafa6
* diff: migrate TextSlotDiffRenderer to use StatsFactoryCole White2024-06-281-2/+1
| | | | | Bug: T359241 Change-Id: I4f443b004b9ed77b9e6b8b1144d0cc2847a55d16
* MessageContent: move deprecation from file to classNovem Linguae2024-06-251-1/+1
| | | | | | | | Having the @deprecation in the file means it is invisible to Doxygen and invisible to VS Code Intelephense. Move it down to the class docblock to fix this. Change-Id: I47084899a26b3225cdc8d87fc21ed4ccaeae7d30
* Merge "Use namespaced classes (1)"jenkins-bot2024-06-182-0/+3
|\
| * Use namespaced classes (1)Umherirrender2024-06-162-0/+3
| | | | | | | | | | | | | | Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
* | diff: Mark TextSlotDiffRenderer DI setters as `@internal`Timo Tijhof2024-06-151-1/+0
|/ | | | | | For use by I4f443b004b9ed7 (T359241). Change-Id: If6acfb4fbb041dc13c7b4ccfaae4abd6f5b9b550
* Merge "Use StatusValue::getMessages() instead of deprecated methods"jenkins-bot2024-05-291-1/+1
|\
| * Use StatusValue::getMessages() instead of deprecated methodsBartosz Dziewoński2024-05-181-1/+1
| | | | | | | | | | | | | | | | | | This commit replaces some of the uses of getErrorsArray(), getWarningsArray(), getErrorsByType(), and getErrors(). In many cases the code becomes shorter and clearer. Follow-up to Ibc4ce11594cf36ce7b2495d2636ee080d3443b04. Change-Id: Id0ebeac26ae62231edb48458dbd2e13ddcbd0a9e
* | Add MediaWiki\Content namespace to FallbackContent{,Handler}Ebrahim Byagowi2024-05-212-0/+15
| | | | | | | | | | | | | | | | | | This adds MediaWiki\Content namespace to FallbackContent and FallbackContentHandler and declares the unnamespaced version as deprecated since version 1.43. Bug: T353458 Change-Id: I3ee80aea379788b71539cc1c7a4ec216b753e042
* | Add namespace and deprecation alias to JsonContentHandlerEbrahim Byagowi2024-05-211-2/+7
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Content to JsonContentHandler and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: Ia4ba6d3eddcb7b3f3d9f41a5ff80f724dbd01b22
* | Add namespace and deprecation alias to JsonContentEbrahim Byagowi2024-05-203-3/+7
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Content to JsonContent and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I44abb1ab5bd1fabf9886dc1457e241d7cae068bc
* | Add namespace and deprecation alias to TextContentHandlerEbrahim Byagowi2024-05-204-2/+12
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Content to TextContentHandler and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I2c72dacf28ee72fb70b15acdd81d0eb717ea949a
* | Add namespace and deprecation alias to TextContentEbrahim Byagowi2024-05-197-2/+15
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Content to TextContent and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: Ic251b1ddfcf6db9c85cb54cddf912aa827d2bc3a
* | Add namespace and deprecation alias to CssContentHandlerEbrahim Byagowi2024-05-191-1/+9
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Content to CssContentHandler and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I5504c21b4fabd6ce82c4dac37aacd1c74462c41b
* | Add namespace and deprecation alias to CssContentEbrahim Byagowi2024-05-182-0/+6
|/ | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Content to CssContent and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I6ab25787893cb2195f8cd2ba125ed8dd5a60de43