2121
2222class CmfHierarchyTest extends BaseTestCase
2323{
24- /**
25- * @var AuthorizationCheckerInterface|MockObject
26- */
27- private $ publishWorkflowChecker ;
28-
29- /**
30- * @var Cmf
31- */
32- private $ helper ;
24+ private MockObject &AuthorizationCheckerInterface $ publishWorkflowChecker ;
25+ private Cmf $ helper ;
3326
3427 public function setUp (): void
3528 {
@@ -39,14 +32,14 @@ public function setUp(): void
3932 $ this ->publishWorkflowChecker = $ this ->createMock (AuthorizationCheckerInterface::class);
4033 $ this ->publishWorkflowChecker
4134 ->method ('isGranted ' )
42- ->will ( $ this -> returnValue ( true ) )
35+ ->willReturn ( true )
4336 ;
4437
4538 $ this ->helper = new Cmf ($ this ->publishWorkflowChecker );
4639 $ this ->helper ->setDoctrineRegistry ($ dbManager ->getRegistry (), 'default ' );
4740 }
4841
49- public function testGetDescendants ()
42+ public function testGetDescendants (): void
5043 {
5144 $ this ->assertEquals ([], $ this ->helper ->getDescendants (null ));
5245
@@ -60,7 +53,7 @@ public function testGetDescendants()
6053 /**
6154 * @dataProvider getPrevData
6255 */
63- public function testGetPrev ($ expected , $ path , $ anchor = null , $ depth = null , $ class = ' Doctrine\ODM\PHPCR\Document\ Generic' )
56+ public function testGetPrev (? string $ expected , ? string $ path , ? string $ anchor = null , ? int $ depth = null , string $ class = Generic::class): void
6457 {
6558 $ prev = $ this ->helper ->getPrev ($ path , $ anchor , $ depth );
6659 if (null === $ expected ) {
@@ -71,7 +64,7 @@ public function testGetPrev($expected, $path, $anchor = null, $depth = null, $cl
7164 }
7265 }
7366
74- public static function getPrevData ()
67+ public static function getPrevData (): array
7568 {
7669 return [
7770 [null , null ],
@@ -99,7 +92,7 @@ public static function getPrevData()
9992 /**
10093 * @dataProvider getNextData
10194 */
102- public function testGetNext ($ expected , $ path , $ anchor = null , $ depth = null , $ class = Generic::class)
95+ public function testGetNext (? string $ expected , ? string $ path , ? string $ anchor = null , ? int $ depth = null , string $ class = Generic::class): void
10396 {
10497 $ next = $ this ->helper ->getNext ($ path , $ anchor , $ depth );
10598 if (null === $ expected ) {
@@ -110,7 +103,7 @@ public function testGetNext($expected, $path, $anchor = null, $depth = null, $cl
110103 }
111104 }
112105
113- public static function getNextData ()
106+ public static function getNextData (): array
114107 {
115108 return [
116109 [null , null ],
@@ -139,7 +132,7 @@ public static function getNextData()
139132 /**
140133 * @dataProvider getPrevLinkableData
141134 */
142- public function testGetPrevLinkable ($ expected , $ path , $ anchor = null , $ depth = null )
135+ public function testGetPrevLinkable (? string $ expected , ? string $ path , ? string $ anchor = null , ? int $ depth = null ): void
143136 {
144137 $ prev = $ this ->helper ->getPrevLinkable ($ path , $ anchor , $ depth );
145138 if (null === $ expected ) {
@@ -150,7 +143,7 @@ public function testGetPrevLinkable($expected, $path, $anchor = null, $depth = n
150143 }
151144 }
152145
153- public static function getPrevLinkableData ()
146+ public static function getPrevLinkableData (): array
154147 {
155148 // TODO: expand test case
156149 return [
@@ -164,7 +157,7 @@ public static function getPrevLinkableData()
164157 /**
165158 * @dataProvider getNextLinkableData
166159 */
167- public function testGetNextLinkable ($ expected , $ path , $ anchor = null , $ depth = null )
160+ public function testGetNextLinkable (? string $ expected , ? string $ path , ? string $ anchor = null , ? int $ depth = null ): void
168161 {
169162 $ next = $ this ->helper ->getNextLinkable ($ path , $ anchor , $ depth );
170163 if (null === $ expected ) {
@@ -175,7 +168,7 @@ public function testGetNextLinkable($expected, $path, $anchor = null, $depth = n
175168 }
176169 }
177170
178- public static function getNextLinkableData ()
171+ public static function getNextLinkableData (): array
179172 {
180173 // TODO: expand test case
181174 return [
0 commit comments