@@ -71,7 +71,7 @@ protected function tearDown(): void
7171 *
7272 * @return void
7373 */
74- public function testClassIsFinal ()
74+ public function testClassIsFinal (): void
7575 {
7676 $ reflection = new \ReflectionClass (Linter::class);
7777 $ this ->assertTrue ($ reflection ->isFinal (), 'Linter class should be final ' );
@@ -84,7 +84,7 @@ public function testClassIsFinal()
8484 *
8585 * @return void
8686 */
87- public function testClassHasCorrectNamespace ()
87+ public function testClassHasCorrectNamespace (): void
8888 {
8989 $ this ->assertStringStartsWith (
9090 'Yousha\PhpSecurityLinter ' ,
@@ -100,7 +100,7 @@ public function testClassHasCorrectNamespace()
100100 *
101101 * @return void
102102 */
103- public function testLinterInitializesWithRules ()
103+ public function testLinterInitializesWithRules (): void
104104 {
105105 $ reflection = new \ReflectionClass (Linter::class);
106106 $ property = $ reflection ->getProperty ('rules ' );
@@ -121,7 +121,7 @@ public function testLinterInitializesWithRules()
121121 *
122122 * @return void
123123 */
124- public function testScanMethodExists ()
124+ public function testScanMethodExists (): void
125125 {
126126 $ this ->assertTrue (
127127 method_exists (Linter::class, 'scan ' )
@@ -135,7 +135,7 @@ public function testScanMethodExists()
135135 *
136136 * @return void
137137 */
138- public function testScanMethodSignature ()
138+ public function testScanMethodSignature (): void
139139 {
140140 $ method = new \ReflectionMethod (Linter::class, 'scan ' );
141141
@@ -163,7 +163,7 @@ public function testScanMethodSignature()
163163 *
164164 * @return void
165165 */
166- public function testScanDirectoryWithNonPhpFiles ()
166+ public function testScanDirectoryWithNonPhpFiles (): void
167167 {
168168 $ tempDir = sys_get_temp_dir () . '/test_dir_ ' . uniqid ();
169169 mkdir ($ tempDir );
@@ -185,7 +185,7 @@ public function testScanDirectoryWithNonPhpFiles()
185185 *
186186 * @return void
187187 */
188- public function testScanReturnsMetadataWithFiles ()
188+ public function testScanReturnsMetadataWithFiles (): void
189189 {
190190 // Create temp dir with sample PHP file
191191 $ tempDir = sys_get_temp_dir () . '/test_dir_ ' . uniqid ();
@@ -209,7 +209,7 @@ public function testScanReturnsMetadataWithFiles()
209209 *
210210 * @return void
211211 */
212- public function testScanThrowsExceptionForInvalidPath ()
212+ public function testScanThrowsExceptionForInvalidPath (): void
213213 {
214214 $ this ->expectException (LinterException::class);
215215 $ this ->expectExceptionMessage ('Path does not exist: /nonexistent/path ' );
@@ -224,7 +224,7 @@ public function testScanThrowsExceptionForInvalidPath()
224224 *
225225 * @return void
226226 */
227- public function testCanScanEmptyDirectory ()
227+ public function testCanScanEmptyDirectory (): void
228228 {
229229 $ tempDir = sys_get_temp_dir () . '/empty_test_dir_ ' . uniqid ();
230230 mkdir ($ tempDir );
@@ -253,7 +253,7 @@ public function testCanScanEmptyDirectory()
253253 *
254254 * @return void
255255 */
256- public function testShouldExcludeMethodIsPrivate ()
256+ public function testShouldExcludeMethodIsPrivate (): void
257257 {
258258 $ method = new \ReflectionMethod (Linter::class, 'shouldExclude ' );
259259 $ this ->assertTrue ($ method ->isPrivate ());
@@ -266,7 +266,7 @@ public function testShouldExcludeMethodIsPrivate()
266266 *
267267 * @return void
268268 */
269- public function testScanFileMethodIsPrivate ()
269+ public function testScanFileMethodIsPrivate (): void
270270 {
271271 $ method = new \ReflectionMethod (Linter::class, 'scanFile ' );
272272 $ this ->assertTrue ($ method ->isPrivate ());
@@ -279,7 +279,7 @@ public function testScanFileMethodIsPrivate()
279279 *
280280 * @return void
281281 */
282- public function testInvalidDirectory ()
282+ public function testInvalidDirectory (): void
283283 {
284284 $ this ->expectException (LinterException::class);
285285 $ linter = new Linter ();
0 commit comments