File tree Expand file tree Collapse file tree 4 files changed +40
-11
lines changed
Expand file tree Collapse file tree 4 files changed +40
-11
lines changed Original file line number Diff line number Diff line change @@ -63,19 +63,25 @@ public function __destruct()
6363 if (is_resource ($ res )) $ metadata = @stream_get_meta_data ($ res );
6464 }
6565 } catch (\Throwable $ ignored ) {}
66- Log:: error
67- (
68- sprintf
66+ // Check if Laravel app is still available before logging
67+ if ( app ()-> bound ( ' config ' )) {
68+ Log:: error
6969 (
70- "RedisCacheService::__destruct %s %s %s " ,
71- $ ex ->getCode (),
72- $ ex ->getMessage (),
73- var_export ($ metadata , true )
74- )
75- );
70+ sprintf
71+ (
72+ "RedisCacheService::__destruct %s %s %s " ,
73+ $ ex ->getCode (),
74+ $ ex ->getMessage (),
75+ var_export ($ metadata , true )
76+ )
77+ );
78+ }
7679 }
7780 catch (\Exception $ ex ){
78- Log::warning ($ ex );
81+ // Check if Laravel app is still available before logging
82+ if (app ()->bound ('config ' )) {
83+ Log::warning ($ ex );
84+ }
7985 }
8086 }
8187
@@ -324,4 +330,4 @@ public function ttl($key)
324330 return (int )$ conn ->ttl ($ key );
325331 }, 0 );
326332 }
327- }
333+ }
Original file line number Diff line number Diff line change 33 <testsuites >
44 <testsuite name =" Application Test Suite" >
55 <directory >./tests/</directory >
6+ <exclude >./tests/OpenTelemetry/</exclude >
7+ <exclude >./tests/TestCase.php</exclude >
8+ </testsuite >
9+ <testsuite name =" OTEL" >
10+ <directory >./tests/OpenTelemetry/</directory >
11+ <exclude >./tests/OpenTelemetry/ExampleTest.php</exclude >
612 </testsuite >
713 </testsuites >
814 <php >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \OpenTelemetry ;
4+
5+ use Tests \TestCase ;
6+ class ExampleTest extends TestCase
7+ {
8+ /**
9+ * A basic test example.
10+ *
11+ * @return void
12+ */
13+ public function testBasicTest ()
14+ {
15+ $ this ->assertTrue (true );
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments