From ce7d790abecb96b3703e28fd238b30a97638f67f Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Tue, 9 Apr 2024 14:02:35 +0530 Subject: [PATCH] Fixed array push for single element --- src/Http.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http.php b/src/Http.php index 566af24..2d35c60 100644 --- a/src/Http.php +++ b/src/Http.php @@ -134,10 +134,10 @@ public function request( $method, $url, $headers = [], $params = [] ) { $this->curl->setOpt( $ch, CURLOPT_POSTFIELDS, $params ); if ($this->postDataFormat == 'json') { - array_push( $headers, 'Content-Type: application/json' ); + $headers[] = 'Content-Type: application/json'; } elseif ($this->postDataFormat == 'msgpack') { - array_push( $headers, 'Content-Type: application/x-msgpack' ); + $headers[] = 'Content-Type: application/x-msgpack'; } } else { throw new AblyRequestException( 'Unknown $params format', -1, -1 );