@@ -77,13 +77,13 @@ public function __construct(array $options)
7777 $ rawEndpoint = ($ options ['endpoint ' ] ?? '' ) ?: self ::DEFAULT_ENDPOINT ;
7878 $ this ->endpoint = SSRF ::validateEndpoint ($ rawEndpoint );
7979
80- $ this ->flushInterval = (float )($ options ['flush_interval ' ] ?? self ::DEFAULT_FLUSH_INTERVAL );
81- $ this ->batchSize = (int )($ options ['batch_size ' ] ?? self ::DEFAULT_BATCH_SIZE );
82- $ this ->maxBufferSize = (int )($ options ['max_buffer_size ' ] ?? self ::DEFAULT_MAX_BUFFER_SIZE );
83- $ this ->maxStorageBytes = (int )($ options ['max_storage_bytes ' ] ?? self ::DEFAULT_MAX_STORAGE_BYTES );
84- $ this ->maxEventBytes = (int )($ options ['max_event_bytes ' ] ?? self ::DEFAULT_MAX_EVENT_BYTES );
85- $ this ->debug = (bool )($ options ['debug ' ] ?? false );
86- $ this ->collectQueryString = (bool )($ options ['collect_query_string ' ] ?? false );
80+ $ this ->flushInterval = (float ) ($ options ['flush_interval ' ] ?? self ::DEFAULT_FLUSH_INTERVAL );
81+ $ this ->batchSize = (int ) ($ options ['batch_size ' ] ?? self ::DEFAULT_BATCH_SIZE );
82+ $ this ->maxBufferSize = (int ) ($ options ['max_buffer_size ' ] ?? self ::DEFAULT_MAX_BUFFER_SIZE );
83+ $ this ->maxStorageBytes = (int ) ($ options ['max_storage_bytes ' ] ?? self ::DEFAULT_MAX_STORAGE_BYTES );
84+ $ this ->maxEventBytes = (int ) ($ options ['max_event_bytes ' ] ?? self ::DEFAULT_MAX_EVENT_BYTES );
85+ $ this ->debug = (bool ) ($ options ['debug ' ] ?? false );
86+ $ this ->collectQueryString = (bool ) ($ options ['collect_query_string ' ] ?? false );
8787 $ this ->onError = $ options ['on_error ' ] ?? null ;
8888 $ this ->identifyConsumer = $ options ['identify_consumer ' ] ?? null ;
8989
@@ -199,10 +199,10 @@ private function trackInner(array $event): void
199199 }
200200
201201 // Sanitize
202- $ event ['method ' ] = strtoupper (substr ((string )($ event ['method ' ] ?? '' ), 0 , self ::MAX_METHOD_LENGTH ));
203- $ event ['path ' ] = substr ((string )($ event ['path ' ] ?? '' ), 0 , self ::MAX_PATH_LENGTH );
202+ $ event ['method ' ] = strtoupper (substr ((string ) ($ event ['method ' ] ?? '' ), 0 , self ::MAX_METHOD_LENGTH ));
203+ $ event ['path ' ] = substr ((string ) ($ event ['path ' ] ?? '' ), 0 , self ::MAX_PATH_LENGTH );
204204 if (isset ($ event ['consumer_id ' ])) {
205- $ event ['consumer_id ' ] = substr ((string )$ event ['consumer_id ' ], 0 , self ::MAX_CONSUMER_ID_LENGTH );
205+ $ event ['consumer_id ' ] = substr ((string ) $ event ['consumer_id ' ], 0 , self ::MAX_CONSUMER_ID_LENGTH );
206206 }
207207
208208 // Timestamp
@@ -357,7 +357,7 @@ private function persistToDisk(array $events): void
357357 $ size = file_exists ($ path ) ? filesize ($ path ) : 0 ;
358358
359359 if ($ size !== false && $ size >= $ this ->maxStorageBytes ) {
360- $ this ->debugLog ("[peekapi] storage file full, dropping " . count ($ events ) . " events \n" );
360+ $ this ->debugLog ("[peekapi] storage file full, dropping " . count ($ events ) . " events \n" );
361361 return ;
362362 }
363363
@@ -409,7 +409,7 @@ private function loadFromDisk(): void
409409 if ($ events !== []) {
410410 $ this ->buffer = array_merge (
411411 $ this ->buffer ,
412- array_slice ($ events , 0 , $ this ->maxBufferSize )
412+ array_slice ($ events , 0 , $ this ->maxBufferSize ),
413413 );
414414 $ this ->debugLog ("[peekapi] loaded " . count ($ events ) . " events from disk \n" );
415415 }
0 commit comments