Skip to content

Commit 4202976

Browse files
committed
Added more fixtures to test the new verifications.
Updated Ruleset.md to better represent the current state of the verified ruleset.
1 parent be94b0e commit 4202976

23 files changed

+285
-36
lines changed

docs/Ruleset.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,31 @@ Code | Level | Rule
1616
-----|-------|-------
1717
V005 | MAJOR | Class removed
1818
V006 | MAJOR | Class public method removed
19-
V007 | MAJOR | *Class protected method removed*
19+
V007 | MAJOR | Class protected method removed
2020
V008 | MAJOR | *Class public property removed*
2121
V009 | MAJOR | *Class protected property removed*
2222
V010 | MAJOR | Class public method parameter changed
23-
V011 | MAJOR | *Class protected method parameter changed*
23+
V011 | MAJOR | Class protected method parameter changed
2424
V012 | MAJOR | *New public constructor (does not match supertype)*
2525
V013 | MAJOR | *New protected constructor (does not match supertype)*
2626
V014 | MINOR | Class added
2727
V015 | MINOR | Class public method added *(display a notice that the method may overlap)* (MAJOR when not final)
28-
V016 | MINOR | *Class protected method added* *(display a notice that the method may overlap)* (MAJOR when not final)
28+
V016 | MINOR | Class protected method added *(display a notice that the method may overlap)* (MAJOR when not final)
2929
V017 | MINOR | *Final class public method added*
3030
V018 | MINOR | *Final class protected method added*
3131
V019 | MINOR | *Class public property added*
3232
V020 | MINOR | *Class protected property added*
33-
V021 | MINOR | Class protected method parameter changed (MAJOR when not final)
34-
V022 | MAJOR | Final class protected method removed
33+
V021 | MINOR | Class protected method parameter changed *(MAJOR when not final)*
34+
V022 | MAJOR | *Final class protected method removed*
3535
V023 | PATCH | [Final] Class public class method implementation changed
36-
V024 | PATCH | [Final] Class *protected* class method implementation changed
37-
V025 | PATCH | [Final] Class *private* class method implementation changed
36+
V024 | PATCH | [Final] Class protected class method implementation changed
37+
V025 | PATCH | [Final] Class private class method implementation changed
3838
V026 | PATCH | *Class private property added*
3939
V027 | PATCH | *Class private property removed*
40-
V028 | PATCH | *Class private method added*
41-
V029 | PATCH | *Class private method removed*
40+
V028 | PATCH | Class private method added
41+
V029 | PATCH | Class private method removed
4242
V030 | PATCH | *Final class protected method added*
43-
V031 | PATCH | *Class private method parameter changed*
43+
V031 | PATCH | Class private method parameter changed
4444
V060 | PATCH | Class public method parameter name changed
4545
V061 | PATCH | Class protected method parameter name changed
4646
V062 | PATCH | Class private method parameter name changed
@@ -62,29 +62,31 @@ Code | Level | Rule
6262
-----|-------|-------
6363
V037 | MAJOR | Trait removed
6464
V038 | MAJOR | Trait public method removed
65-
V039 | MAJOR | *Trait protected method removed*
65+
V039 | MAJOR | Trait protected method removed
6666
V040 | MAJOR | *Trait public property removed*
6767
V041 | MAJOR | *Trait protected property removed*
6868
V042 | MAJOR | Trait public method parameter changed
69-
V043 | MAJOR | *Trait protected method parameter changed*
69+
V043 | MAJOR | Trait protected method parameter changed
7070
V044 | MAJOR | *New public constructor (does not match supertype)*
7171
V045 | MAJOR | *New protected constructor (does not match supertype)*
7272
V046 | MINOR | Trait added
7373
V047 | MINOR | Trait public method added *(display a notice that the method may overlap)* (MAJOR when not final)
74-
V048 | MINOR | *Trait protected method added* *(display a notice that the method may overlap)* (MAJOR when not final)*
74+
V048 | MINOR | Trait protected method added *(display a notice that the method may overlap)* (MAJOR when not final)
7575
V049 | MINOR | *Trait public property added*
7676
V050 | MINOR | *Trait protected property added*
77-
V051 | MINOR | *Trait protected method parameter changed (MAJOR when not final)*
78-
V052 | PATCH | Trait public trait method implementation changed
79-
V053 | PATCH | *Trait *protected* trait method implementation changed*
80-
V054 | PATCH | *Trait *private* trait method implementation changed*
77+
V051 | MINOR | *REMOVED*
78+
V052 | PATCH | Trait public method implementation changed
79+
V053 | PATCH | Trait protected method implementation changed
80+
V054 | PATCH | Trait private method implementation changed
8181
V055 | PATCH | *Trait private property added*
8282
V056 | PATCH | *Trait private property removed*
83-
V057 | PATCH | *Trait private method added*
84-
V058 | PATCH | *Trait private method removed*
85-
V059 | PATCH | *Trait private method parameter changed*
83+
V057 | PATCH | Trait private method added
84+
V058 | PATCH | Trait private method removed
85+
V059 | PATCH | Trait private method parameter changed
8686
V064 | PATCH | Trait public method parameter name changed
8787
V065 | PATCH | Trait protected method parameter name changed
8888
V066 | PATCH | Trait private method parameter name changed
8989

90-
Method visibility changed
90+
# To classify
91+
92+
* Method visibility changed

tests/fixtures/after/ClassMethodAdded.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@
44

55
class ClassMethodAdded
66
{
7-
public function newMethod()
7+
public function publicMethod()
88
{
99

1010
}
11-
}
11+
12+
protected function protectedMethod()
13+
{
14+
15+
}
16+
17+
private function privateMethod()
18+
{
19+
20+
}
21+
}

tests/fixtures/after/ClassMethodImplementationChanged.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@
44

55
class ClassMethodImplementationChanged
66
{
7-
public function newMethod()
7+
public function publicMethod()
88
{
99
$x = 3;
1010
}
11-
}
11+
12+
protected function protectedMethod()
13+
{
14+
$x = 3;
15+
}
16+
17+
private function privateMethod()
18+
{
19+
$x = 3;
20+
}
21+
}

tests/fixtures/after/ClassMethodParameterChanged.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44

55
class ClassMethodParameterChanged
66
{
7-
public function newMethod($someParameter)
7+
public function publicMethod($someParameter)
8+
{
9+
10+
}
11+
12+
protected function protectedMethod($someParameter)
13+
{
14+
15+
}
16+
17+
private function privateMethod($someParameter)
818
{
919

1020
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace fixtures;
4+
5+
class ClassMethodParameterNameChanged
6+
{
7+
public function publicMethod($someOtherParameterName)
8+
{
9+
10+
}
11+
12+
protected function protectedMethod($someOtherParameterName)
13+
{
14+
15+
}
16+
17+
private function privateMethod($someOtherParameterName)
18+
{
19+
20+
}
21+
}
File renamed without changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace fixtures;
4+
5+
function functionParameterChanged($someOtherParameterName)
6+
{
7+
8+
}
File renamed without changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace fixtures;
4+
5+
interface InterfaceMethodParameterNameChanged
6+
{
7+
public function publicMethod($someOtherParameterName);
8+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace fixtures;
4+
5+
trait TraitMethodAdded
6+
{
7+
public function publicMethod()
8+
{
9+
10+
}
11+
12+
protected function protectedMethod()
13+
{
14+
15+
}
16+
17+
private function privateMethod()
18+
{
19+
20+
}
21+
}

0 commit comments

Comments
 (0)