1 | <?php |
||
25 | class SpecialSetAliases extends SpecialModifyTerm { |
||
|
|||
26 | |||
27 | public function __construct( |
||
43 | |||
44 | public static function factory(): self { |
||
45 | $wikibaseRepo = WikibaseRepo::getDefaultInstance(); |
||
46 | |||
47 | $settings = $wikibaseRepo->getSettings(); |
||
48 | $copyrightView = new SpecialPageCopyrightView( |
||
49 | new CopyrightMessageBuilder(), |
||
50 | $settings->getSetting( 'dataRightsUrl' ), |
||
51 | $settings->getSetting( 'dataRightsText' ) |
||
52 | ); |
||
53 | |||
54 | return new self( |
||
55 | $copyrightView, |
||
56 | $wikibaseRepo->getSummaryFormatter(), |
||
57 | $wikibaseRepo->getEntityTitleLookup(), |
||
58 | $wikibaseRepo->newEditEntityFactory(), |
||
59 | $wikibaseRepo->getEntityPermissionChecker() |
||
60 | ); |
||
61 | } |
||
62 | |||
63 | public function doesWrites() { |
||
66 | |||
67 | /** |
||
68 | * @see SpecialModifyTerm::validateInput |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | protected function validateInput() { |
||
79 | |||
80 | /** |
||
81 | * @see SpecialModifyTerm::getPostedValue() |
||
82 | * |
||
83 | * @return string|null |
||
84 | */ |
||
85 | protected function getPostedValue() { |
||
88 | |||
89 | /** |
||
90 | * @see SpecialModifyTerm::getValue() |
||
91 | * |
||
92 | * @param EntityDocument $entity |
||
93 | * @param string $languageCode |
||
94 | * |
||
95 | * @throws InvalidArgumentException |
||
96 | * @return string |
||
97 | */ |
||
98 | protected function getValue( EntityDocument $entity, $languageCode ) { |
||
108 | |||
109 | /** |
||
110 | * @see SpecialModifyTerm::setValue() |
||
111 | * |
||
112 | * @param EntityDocument $entity |
||
113 | * @param string $languageCode |
||
114 | * @param string $value |
||
115 | * |
||
116 | * @throws UserInputException|InvalidArgumentException |
||
117 | * @return Summary |
||
118 | * @suppress PhanTypeMismatchArgument |
||
119 | */ |
||
120 | protected function setValue( EntityDocument $entity, $languageCode, $value ) { |
||
140 | |||
141 | /** |
||
142 | * Screams and throws an error if any of existing aliases has pipe character |
||
143 | * |
||
144 | * @param EntityDocument $entity |
||
145 | * @param string $languageCode |
||
146 | * |
||
147 | * @throws UserInputException |
||
148 | * @suppress PhanTypeMismatchDeclaredParam Intersection type |
||
149 | */ |
||
150 | private function assertNoPipeCharacterInAliases( AliasesProvider $entity, $languageCode ) { |
||
169 | |||
170 | } |
||
171 |