Debian Codegraph @

includes/parser/ParserOutputLinkTypes.php

raw symbols SCIP
1 <?php
2
3 /**
4 * Registry of flags used with ParserOutput::{getLinkList,appendLink}()
5 * within MediaWiki core.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * http://www.gnu.org/copyleft/gpl.html
21 *
22 * @since 1.43
23 *
24 * @file
25 * @ingroup Parser
26 */
27
28 namespace MediaWiki\Parser;
29
30 /**
31 * Registry of flags used with ParserOutput::{getLinkList,appendLink}()
32 * within MediaWiki core.
33 *
34 * All link types used should be defined in this class.
35 *
36 * @package MediaWiki\Parser
37 */
38 class ParserOutputLinkTypes {
39
40 /**
41 * @var string Category links
42 * @see ParserOutput::addCategory
43 * @see ParserOutput::getCategoryMap
44 * @see ParserOutput::getCategoryNames
45 */
46 public const CATEGORY = 'category';
47
48 /**
49 * @var string Interwiki links
50 * @see ParserOutput::addInterwikiLink
51 * @see ParserOutput::getInterwikiLinks
52 */
53 public const INTERWIKI = 'interwiki';
54
55 /**
56 * @var string Language links
57 * @see ParserOutput::addLanguageLink
58 * @see ParserOutput::getLanguageLinks
59 */
60 public const LANGUAGE = 'language';
61
62 /**
63 * @var string Local links
64 * @see ParserOutput::addLink
65 * @see ParserOutput::getLinks
66 */
67 public const LOCAL = 'local';
68
69 /**
70 * @var string Links to media
71 * @see ParserOutput::addImage
72 * @see ParserOutput::getImages
73 * @see ParserOutput::getFileSearchOptions
74 */
75 public const MEDIA = 'media';
76
77 /**
78 * @var string Links to special pages
79 * @see ParserOutput::addLink
80 * @see ParserOutput::getLinksSpecial
81 */
82 public const SPECIAL = 'special';
83
84 /**
85 * @var string Links to templates
86 * @see ParserOutput::addTemplate
87 * @see ParserOutput::getTemplates
88 * @see ParserOutput::getTemplateIds
89 */
90 public const TEMPLATE = 'template';
91
92 public static function cases(): array {
93 return [
94 self::CATEGORY,
95 self::INTERWIKI,
96 self::LANGUAGE,
97 self::LOCAL,
98 self::MEDIA,
99 self::SPECIAL,
100 self::TEMPLATE,
101 ];
102 }
103 }