File tree Expand file tree Collapse file tree
tests/system/Session/Handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414namespace CodeIgniter \Session \Handlers ;
1515
16+ use Closure ;
1617use CodeIgniter \Session \Exceptions \SessionException ;
1718use CodeIgniter \Test \CIUnitTestCase ;
1819use CodeIgniter \Test \TestLogger ;
1920use Config \Logger as LoggerConfig ;
2021use Config \Session as SessionConfig ;
22+ use PHPUnit \Framework \Attributes \Group ;
2123use Tests \Support \Session \FaultyStream ;
2224use Tests \Support \Session \FileHandlerCloseFail ;
2325
2426/**
2527 * @internal
2628 */
29+ #[Group('Others ' )]
2730final class FileHandlerTest extends CIUnitTestCase
2831{
2932 private string $ sessionDriver = FileHandler::class;
@@ -92,8 +95,10 @@ protected function getInstance($options = []): FileHandler
9295
9396 /**
9497 * Runs a callback while suppressing any PHP warnings it raises.
98+ *
99+ * @param Closure(): mixed $callback
95100 */
96- private function withSuppressedErrors (callable $ callback ): mixed
101+ private function withSuppressedErrors (Closure $ callback ): mixed
97102 {
98103 set_error_handler (static fn (int $ severity , string $ message ): bool => true );
99104
@@ -110,7 +115,9 @@ private function removeDirectory(string $path): void
110115 return ;
111116 }
112117
113- foreach (scandir ($ path ) ?: [] as $ item ) {
118+ $ items = scandir ($ path );
119+
120+ foreach ($ items === false ? [] : $ items as $ item ) {
114121 if ($ item === '. ' || $ item === '.. ' ) {
115122 continue ;
116123 }
You can’t perform that action at this time.
0 commit comments