@@ -55,10 +55,7 @@ public function testAliasWithWrongType($argument): void
5555 (new CustomRule (
5656 $ argument ,
5757 function (string $ received ): bool {
58- if ($ received === 'test ' ) {
59- return true ;
60- }
61- return false ;
58+ return $ received === 'test ' ;
6259 }
6360 ));
6461 }
@@ -74,10 +71,7 @@ public function testVoidAlias(): void
7471 (new CustomRule (
7572 [],
7673 function (string $ received ): bool {
77- if ($ received === 'test ' ) {
78- return true ;
79- }
80- return false ;
74+ return $ received === 'test ' ;
8175 }
8276 ));
8377 }
@@ -93,10 +87,7 @@ public function testClosureWithNoReturnType(): void
9387 (new CustomRule (
9488 ['test ' ],
9589 function (string $ received ) {
96- if ($ received === 'test ' ) {
97- return true ;
98- }
99- return false ;
90+ return $ received === 'test ' ;
10091 }
10192 ));
10293 }
@@ -112,10 +103,7 @@ public function testClosureWithWrongReturnType(): void
112103 (new CustomRule (
113104 ['test ' ],
114105 function (string $ received ): int {
115- if ($ received === 'test ' ) {
116- return 1 ;
117- }
118- return 0 ;
106+ return $ received === 'test ' ? 1 : 0 ;
119107 }
120108 ));
121109 }
@@ -146,28 +134,16 @@ public function argumentsTypeProvider(): array
146134 {
147135 return [
148136 [function (string $ received ): bool {
149- if ($ received === 'test ' ) {
150- return true ;
151- }
152- return false ;
137+ return $ received === 'test ' ;
153138 }, 0 , []],
154139 [function (string $ received , $ value ): bool {
155- if ($ received === $ value ) {
156- return true ;
157- }
158- return false ;
140+ return $ received === $ value ;
159141 }, 1 , ['string ' ]],
160142 [function (string $ received , int $ min ): bool {
161- if ($ received >= $ min ) {
162- return true ;
163- }
164- return false ;
143+ return $ received >= $ min ;
165144 }, 1 , ['number ' ]],
166145 [function (string $ received , float $ min , float $ max ): bool {
167- if ($ received >= $ min && $ received <= $ max ) {
168- return true ;
169- }
170- return false ;
146+ return $ received >= $ min && $ received <= $ max ;
171147 }, 2 , ['number ' , 'number ' ]]
172148 ];
173149 }
@@ -199,10 +175,7 @@ public function testCustomValidate(): void
199175 $ instance = new CustomRule (
200176 ['test ' ],
201177 function (string $ received ): bool {
202- if ($ received === 'test ' ) {
203- return true ;
204- }
205- return false ;
178+ return $ received === 'test ' ;
206179 }
207180 );
208181
0 commit comments