Commit graph

8 commits

Author SHA1 Message Date
Aryeh Gregor
c503f129c3 Introduce TitleParser::makeTitleValueSafe()
This works exactly the same as Title::makeTitleSafe(), but for
TitleValues. 100% test coverage of splitTitleString(). Also added
identical parallel tests for Title::makeTitleSafe() to verify that
behavior is the same.

Along the way, I discovered that TitleValue doesn't allow an empty page
name even if there's an interwiki prefix, which is wrong, so I fixed it.

Bug: T220966
Change-Id: I4b915244ceee4c1857178dd68dcdf57f1ee32200
2019-08-14 21:34:39 +03:00
Thiemo Kreuz
1fcc6632da title: Remove misplaced documentation from TitleParser
There is no $form.

Change-Id: I1468f8dbaceaa78e12d7c23170ceba1fbb2b129e
2019-05-09 16:00:42 +00:00
Kunal Mehta
f339c90851 Have TitleParser::parseTitle() default to NS_MAIN to match Title
Matches the default parameters of Title::newFromText().

Change-Id: Id08312d424be9ae7e64688bb21687204ae77c560
2018-08-14 20:58:34 -07:00
Timo Tijhof
bee9f4db96 Remove various redundant '@license' tags in file headers
Redundant given this is the project-wide license already,
especially in file headers that already include the GPL license
header.

This and other minor fixups based on feedback from Ie0cea0ef5027c7e5.

* Add @file where missing.
* Move @ingroup and @deprecated from file to class doc where needed.

Change-Id: I7067abb7abee1f0c238cb2536e16192e946d8daa
2018-01-12 18:15:11 +00:00
Niklas Laxström
e7470d8994 Add @since to classes and interface in title
Follow-up to 154bcdc63f

Change-Id: I0c1dc41d29cc3b3c1938ed6df6bb11cc1b4a8e8f
2014-12-23 16:47:39 +00:00
umherirrender
768ac15c70 Cleanup some docs (includes/[s-z])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: Ie419638e909a47aa72a274043604247830ee1a81
2014-07-24 19:43:44 +02:00
Siebrand Mazeland
db2726675c Update formatting of includes/title/
Change-Id: I862dde47b569ca99f098d795e13b1999a33d790b
2014-04-21 09:32:30 +00:00
daniel
154bcdc63f Introducing TitleValue
TitleValue is intended to be a light weight alternative to the Title
class. Any operations on TitleValue are implemented in separate
service classes, like TitleFormatter and PageLinkRenderer. See
<https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue>
for more information.

This change updates SpecialCategories and SpecialLinkSearch to use
TitleValue instead of Title, to demonstrate how TitleValue would be
used, and how the necessary services can be injected and applied.

The intention is to improve testability and reusability; these
advantages will however only become apparent with further refactoring
of the respective special pages. This will be done in follow-up
changes.

More work will be needed to migrate essential functionality from
Title and Linker classes into the respective service classes,
MediaWikiTitleCodec and MediaWikiPageLinkRenderer.

Change-Id: I8eef5a165de4ffcacfbc4911fdacdb15d502fff4
2014-03-28 18:42:17 +00:00