@@ -603,8 +603,8 @@ private function createTempLogFile()
603603 }
604604
605605 private function verifyLogFileCreated ($ logFile )
606- {
607- $ this ->assertTrue (file_exists ($ logFile ), "Log file should be created: $ logFile " );
606+ {
607+ $ this ->assertTrue (file_exists ($ logFile ), "Log file should be created: $ logFile " );
608608 $ this ->assertTrue (is_readable ($ logFile ), "Log file should be readable: $ logFile " );
609609 $ this ->assertGT (0 , filesize ($ logFile ), "Log file should contain data: $ logFile " );
610610 }
@@ -613,7 +613,7 @@ private function verifyLogContains($logFile, $expectedMessage, $shouldContain =
613613 {
614614 $ this ->assertTrue (file_exists ($ logFile ), "Log file must exist to verify content: $ logFile " );
615615 $ content = file_get_contents ($ logFile );
616-
616+
617617 if ($ shouldContain ) {
618618 $ this ->assertStringContains ($ expectedMessage , $ content );
619619 } else {
@@ -629,7 +629,8 @@ private function cleanupLogFile($logFile)
629629 }
630630 }
631631
632- private function findLogSuffix (string $ baseFilePath ): ?string {
632+ private function findLogSuffix (string $ baseFilePath ): ?string
633+ {
633634 $ dir = dirname ($ baseFilePath );
634635 $ baseName = basename ($ baseFilePath );
635636
@@ -646,17 +647,17 @@ public function testLoggerBasicFunctionality()
646647 {
647648 return ; // Skip this test for now, as it requires logger functionality to be implemented in ValkeyGlide.
648649 // Test comprehensive logger functionality with file output and verification
649- $ logFile = $ this ->createTempLogFile ();
650-
650+ $ logFile = $ this ->createTempLogFile ();
651+
651652 try {
652653 // Initialize logger with info level and file output
653654 $ this ->assertTrue (valkey_glide_logger_set_config ("info " , $ logFile ));
654655 $ this ->assertTrue (valkey_glide_logger_is_initialized ());
655- $ this ->assertEquals (2 , valkey_glide_logger_get_level ()); // Info = 2
656+ $ this ->assertEquals (2 , valkey_glide_logger_get_level ()); // Info = 2
656657
657658 // Test convenience functions at different levels
658659 $ errorMsg = "Test error message - " . uniqid ();
659- $ warnMsg = "Test warning message - " . uniqid ();
660+ $ warnMsg = "Test warning message - " . uniqid ();
660661 $ infoMsg = "Test info message - " . uniqid ();
661662 $ debugMsg = "Test debug message - " . uniqid ();
662663
@@ -696,7 +697,7 @@ public function testLoggerBasicFunctionality()
696697 $ log_file_with_date = $ logFile . $ this ->findLogSuffix ($ logFile );
697698 // Verify log file was created and contains data
698699 $ this ->verifyLogFileCreated ($ log_file_with_date );
699-
700+
700701
701702 // Verify expected messages appear (info level and above)
702703 $ this ->verifyLogContains ($ log_file_with_date , $ errorMsg , true );
@@ -712,7 +713,6 @@ public function testLoggerBasicFunctionality()
712713 // Verify debug messages are filtered out (should NOT appear)
713714 $ this ->verifyLogContains ($ log_file_with_date , $ debugMsg , false );
714715 $ this ->verifyLogContains ($ log_file_with_date , $ genericDebugMsg , false );
715-
716716 } finally {
717717 $ this ->cleanupLogFile ($ log_file_with_date );
718718 }
@@ -723,7 +723,7 @@ public function testLoggerLevelFiltering()
723723 return ; // Skip this test for now, as it requires logger functionality to be implemented in ValkeyGlide.
724724 // Test that log level filtering works correctly at info level
725725 $ logFile = $ this ->createTempLogFile ();
726-
726+
727727 try {
728728 // Initialize with info level
729729 $ this ->assertTrue (valkey_glide_logger_set_config ("info " , $ logFile ));
@@ -746,7 +746,7 @@ public function testLoggerLevelFiltering()
746746 // Test edge cases
747747 $ emptyIdentifierMsg = "Empty identifier test " ;
748748 $ debugEmptyMsg = "Debug with empty identifier (should be filtered) " ;
749-
749+
750750 valkey_glide_logger_log ("info " , "" , $ emptyIdentifierMsg );
751751 valkey_glide_logger_log ("debug " , "" , $ debugEmptyMsg );
752752
@@ -767,7 +767,6 @@ public function testLoggerLevelFiltering()
767767 $ this ->verifyLogContains ($ log_file_with_date , $ debugMsg , false );
768768 $ this ->verifyLogContains ($ log_file_with_date , $ traceMsg , false );
769769 $ this ->verifyLogContains ($ log_file_with_date , $ debugEmptyMsg , false );
770-
771770 } finally {
772771 $ this ->cleanupLogFile ($ log_file_with_date );
773772 }
@@ -778,7 +777,7 @@ public function testLoggerWithValkeyGlideIntegration()
778777 return ; // Skip this test for now, as it requires logger functionality to be implemented in ValkeyGlide.
779778 // Test that ValkeyGlide client integration works with logger system
780779 $ logFile = $ this ->createTempLogFile ();
781-
780+
782781 try {
783782 // Initialize logger with info level to capture client logs
784783 $ this ->assertTrue (valkey_glide_logger_set_config ("info " , $ logFile ));
@@ -813,10 +812,10 @@ public function testLoggerWithValkeyGlideIntegration()
813812 // Perform some operations that might trigger logging
814813 $ testKey = 'logger_integration_test_ ' . uniqid ();
815814 $ testValue = 'test_value_ ' . time ();
816-
815+
817816 $ this ->assertTrue ($ valkey_glide ->set ($ testKey , $ testValue ));
818817 $ this ->assertEquals ($ testValue , $ valkey_glide ->get ($ testKey ));
819-
818+
820819 // Log after operations
821820 $ postOpsMsg = "Operations completed successfully - " . uniqid ();
822821 valkey_glide_logger_info ("integration-test " , $ postOpsMsg );
@@ -835,16 +834,15 @@ public function testLoggerWithValkeyGlideIntegration()
835834 // Verify file creation and content
836835 $ log_file_with_date = $ logFile . $ this ->findLogSuffix ($ logFile );
837836 $ this ->verifyLogFileCreated ($ log_file_with_date );
838-
837+
839838 // Verify our PHP-level log messages appear
840839 $ this ->verifyLogContains ($ log_file_with_date , $ preClientMsg , true );
841840 $ this ->verifyLogContains ($ log_file_with_date , $ postConnectionMsg , true );
842841 $ this ->verifyLogContains ($ log_file_with_date , $ postOpsMsg , true );
843842 $ this ->verifyLogContains ($ log_file_with_date , $ finalMsg , true );
844-
843+
845844 // Verify integration-test identifier appears
846845 $ this ->verifyLogContains ($ log_file_with_date , "integration-test " , true );
847-
848846 } finally {
849847 $ this ->cleanupLogFile ($ log_file_with_date );
850848 }
0 commit comments