File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -78,12 +78,14 @@ public static function multipleFromJsonStreamWithSeal(string $str): array
7878 continue ;
7979 }
8080 $ data = static ::decode ($ line );
81- if (! empty ($ data ['seal ' ])) {
82- $ seal = true ;
83- }
84- if (isset ($ data ['data ' ]['timestamp ' ], $ data ['data ' ]['message ' ])) {
85- $ id = isset ($ data ['_id ' ]) ? (string ) $ data ['_id ' ] : '' ;
86- $ items [] = new static ($ data ['data ' ]['timestamp ' ], $ data ['data ' ]['message ' ], $ id );
81+ if (is_array ($ data )) {
82+ if (! empty ($ data ['seal ' ])) {
83+ $ seal = true ;
84+ }
85+ if (isset ($ data ['data ' ]['timestamp ' ], $ data ['data ' ]['message ' ])) {
86+ $ id = isset ($ data ['_id ' ]) ? (string ) $ data ['_id ' ] : '' ;
87+ $ items [] = new static ($ data ['data ' ]['timestamp ' ], $ data ['data ' ]['message ' ], $ id );
88+ }
8789 }
8890 }
8991
@@ -111,7 +113,7 @@ public function getId(): string
111113 return $ this ->id ;
112114 }
113115
114- private static function decode (string $ str ): ? array
116+ private static function decode (string $ str ): mixed
115117 {
116118 $ data = json_decode ($ str , true );
117119 if ($ data === null ) {
You can’t perform that action at this time.
0 commit comments