Skip to content

Commit 449a180

Browse files
committed
Generic/UselessOverridingMethod: add additional tests
Those tests were suggested during the PR review.
1 parent 96c98c0 commit 449a180

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.1.inc

+32
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,36 @@ class Bar {
4444

4545
return 1;
4646
}
47+
48+
public function ignoreNoParentVoidMethod($a, $b) {
49+
$c = $a + $b;
50+
}
51+
52+
public function modifiesParentReturnValue($a, $b) {
53+
return parent::modifiesParentReturnValue($a, $b) + $b;
54+
}
55+
56+
public function uselessMethodCallTrailingComma($a) {
57+
return parent::uselessMethodCallTrailingComma($a,);
58+
}
59+
60+
public function differentParameterOrder($a, $b) {
61+
return parent::differentParameterOrder($b, $a);
62+
}
63+
64+
public function sameNumberDifferentParameters($a, $b) {
65+
return parent::sameNumberDifferentParameters($this->prop[$a], $this->{$b});
66+
}
67+
}
68+
69+
abstract class AbstractFoo {
70+
abstract public function sniffShouldBailEarly();
71+
}
72+
73+
interface InterfaceFoo {
74+
public function sniffShouldBailEarly();
75+
}
76+
77+
trait TraitFoo {
78+
abstract public function sniffShouldBailEarly();
4779
}

src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function getWarningList($testFile='')
5353
4 => 1,
5454
16 => 1,
5555
38 => 1,
56+
56 => 1,
5657
];
5758
default:
5859
return [];

0 commit comments

Comments
 (0)