aboutsummaryrefslogtreecommitdiffstats
path: root/includes/MWNamespace.php
Commit message (Collapse)AuthorAgeFilesLines
* Hard-deprecate some MWNamespace methodsAlexander Vorwerk2021-07-261-10/+20
| | | | | | | | | | MWNamespace has been deprecated in favor of the NamespaceInfo service in 1.34 and should no longer be used. All methods that are hard-deprecated in this patch are unused in wikimedia-deployed extensions. Change-Id: I79b94aaa3a8bd5c7298a3fe4cb30ae2a35f72651
* Hard-deprecate some MWNamespace methodsAlexander Vorwerk2021-06-301-0/+56
| | | | | | | | | | | | | MWNamespace has been deprecated in favor of the NamespaceInfo service in 1.34 and should no longer be used. All methods that are hard-deprecated in this patch are unused. Also adding @deprecated to all methods so it's more clear that they are deprecated. The @deprecated at the beginning of the class can easily be overlooked. Change-Id: Ic5726297807d7959453407267e852f7be96a3e05
* Update a lot of unspecific "array" types in PHPDocsThiemo Kreuz2020-10-281-3/+3
| | | | | | | | | This includes fixing some mistakes, as well as removing redundant text that doesn't add new information, either because it literally repeats what the code already says, or is actually duplicated. Change-Id: I3a8dd8ce57192deda8916cc444c87d7ab1a36515
* Move getRestrictionLevels from NamespaceInfo to PermissionManager.Petr Pchelko2019-08-221-2/+3
| | | | | Bug: T11977 Change-Id: I051be9148c98086fdf53a66a74bf7c28699016db
* MWNamespace: Remove deprecated method ::canTalk() and test suitDerick Alangi2019-04-201-13/+0
| | | | | | | | | | | This method was deprecated in .30 hence remove as the usage is actually zero in extensions and one only in core. Usage: https://codesearch.wmflabs.org/search/?q=%3A%3AcanTalk%5C(&i=nope&files=&repos= Change-Id: Ia18c63f95c969d13c28ffb1afa376ec2df2002a3
* Fix docs for MWNamespace::clearCaches() removalAryeh Gregor2019-04-111-1/+1
| | | | | | | | | | | | | | Originally I had intended setMwGlobals() to magically reset the namespace-related services if namespace-related settings were changed, but Tim told me to remove it during review and I forgot to update the release notes. Moving forward, everyone will need to reset services after every config change to ensure correctness, and there's no point in trying to reset specific services automatically as special cases. I also moved the note to the 1.34 notes, since this missed the cutoff and should not be backported. Change-Id: Ib7cbdaef22a15ddfc7aaf99d0972b99d3cddc011
* NamespaceInfo service to replace MWNamespaceAryeh Gregor2019-04-101-253/+34
| | | | | | | | | | | | | MWNamespace::clearCaches() has been removed entirely, along with the $rebuild parameter to MWNamespace::getCanonicalNamespaces(). The rest of MWNamespace is deprecated. Diff best viewed with -C1 so git notices that NamespaceInfo is a copy of MWNamespace. Depends-On: Icb7a4a2a5d19fb1f2453b4b57a5271196b0e316d Depends-On: Ib3c914fc99394e4876ac9fe27317a1eafa2ff69e Change-Id: I1a03d4e146f5414ae73c7d1a5807c873323e8abc
* Hard deprecate MWNamespace::canTalk()Max Semenik2019-02-261-0/+1
| | | | | | | Deprecated in 1.30, it had 1 usage outside of tests, removing it in this patch. Change-Id: Ia88b004ac3a5d6f47ece1132f80f713d54a04654
* [MCR] Introduce SlotRoleHandler and SlotRoleRegistrydaniel2018-11-301-2/+7
| | | | | | | | | | | These new classes provide a mechanism for defining the behavior of slots, like the content models it supports. This acts as an extension point for extensions that need to define custom slots, like the MediaInfo extension for the SDC project. Bug: T194046 Change-Id: Ia20c98eee819293199e541be75b5521f6413bc2f
* Fix PhanTypeMismatchDeclaredParamUmherirrender2018-07-071-1/+1
| | | | | | Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
* MWNamespace: Add getCategoryLinkType() methodKevin Israel2018-06-291-0/+22
| | | | | | | | This method returns the value used as cl_type for category links that are "from" pages within the namespace, and is added to avoid duplication of code across a few classes. Change-Id: I4e55932a5a27858cfedb12009b455fcd02f9b5df
* Use PHP 7 '??' operator instead of if-then-elseFomafix2018-06-121-5/+1
| | | | Change-Id: I790b86e2e9e3e41386144637659516a4bfca1cfe
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz Dziewoński2018-05-301-3/+1
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* Improve namespace handling in testsBrad Jorsch2017-09-291-19/+43
| | | | | | | | | | | | MWNamespace has three internal caches, only one of which can be cleared (and that somewhat oddly by passing a boolean to MWNamespace::getCanonicalNamespaces()). This change introduces a MWNamespace::clearCaches() method to clear all three caches. It also adds some resetting in tests that seemed to be missing it. Change-Id: I1dcfcd8713888b3ff8fc75e95329ba72bd95d0c9
* build: Update mediawiki/mediawiki-codesniffer to 0.10.1Kunal Mehta2017-07-221-2/+2
| | | | | | | | | And auto-fix all errors. The `<exclude-pattern>` stanzas are now included in the default ruleset and don't need to be repeated. Change-Id: I928af549dc88ac2c6cb82058f64c7c7f3111598a
* Rename canTalk methodsdaniel2017-06-251-2/+16
| | | | | | | | This renames Title::canTalk to Title::canHaveTalkPage and MWNamespace::canTalk to MWNamespace::hasTalkNamespace. Bug: T165149 Change-Id: I342a273a497b31282388b13bf76dadfb1122dcbb
* Remove empty lines from PHP and JavaScript comment blocksThiemo Mättig2016-12-091-1/+0
| | | | | | | | | This is a pure documentation change. It mostly removes empty lines from comments (and entirely empty comments), as well as adds a few missing documentation blocks and fixes a minor mistake. I hope it's ok to have this in one patch. I can split it, please tell me. Change-Id: I9668338602ac77b903ab6b02ff56bd52743c37c4
* Convert all array() syntax to []Kunal Mehta2016-02-171-10/+10
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Sort MWNamespace::getValidNamespaces list numericallyBryan Davis2015-10-051-0/+2
| | | | | Bug: T109137 Change-Id: Ic6b7635884628c8c3cf1cdfb01dad49bab292d6c
* registration: Fix namespaces added through the ExtensionProcessorKunal Mehta2015-08-271-0/+2
| | | | | | | | | | | | | | | Using $wgExtraNamespaces overrides any localized namespaces with the canonical form, which is not ideal. Namespaces added through extension.json will now store the canonical form and numerical id in a 'ExtensionNamespaces' attribute that is read by MWNamespace::getCanonicalNamespaces(). Also fix the documentation on $wgExtraNamespaces, as using $wgCanonicalNamespaceNames has not been possible since r85327. Bug: T110389 Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
* Hide edit toolbar Signature button in non-discussion namespacesThis, that and the other2015-08-031-0/+12
| | | | | | | | | | | | | | | | Most wikis only use user signatures on pages set aside from discussion, (Talk namespaces and sometimes project/main namespaces depending on the wiki), so having the button available everywhere is confusing. The few wikis that need the button (especially non-content, internal/corporate/planning wikis), can add relevant namespaces to the $wgExtraSignatureNamespaces array in LocalSettings. This would make it possible to solve bugs like T59727 or T53154. Since this is a change to default behavior, a release note is added. Bug: T7645 Change-Id: I7ccf1093b888c7b33721234349ca0ac054c3cd3f
* Replace wfRunHooks calls with direct Hooks::run callsAaron Schulz2014-12-101-2/+2
| | | | | | * This avoids the overhead of an extra function call Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
* Rename MWNamespace, MWDebug and MWTidy files to match their classTimo Tijhof2014-07-151-0/+496
Change-Id: I3e6d13ce366861c865401dde272bc2834a1de670