This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
34
35
public function getName() {
36
return 'delete';
37
}
38
39
public function onView() {
40
return null;
41
}
42
43
public function show() {
44
$this->useTransactionalTimeLimit();
45
46
$out = $this->getOutput();
47
if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
48
$out->addModuleStyles( [
49
'mediawiki.ui.input',
50
'mediawiki.ui.checkbox',
51
] );
52
}
53
$this->addHelpLink( 'Help:Sysop deleting and undeleting' );
The method delete does only exist in Article and CategoryPage and ImagePage, but not in Page and WikiPage.
It seems like the method you are trying to call exists only in some of the
possible types.
Let’s take a look at an example:
classA{publicfunctionfoo(){}}classBextendsA{publicfunctionbar(){}}/** * @param A|B $x */functionsomeFunction($x){$x->foo();// This call is fine as the method exists in A and B.$x->bar();// This method only exists in B and might cause an error.}
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.