11<?php
2+
23/**
3- * Copyright 2007-2017 Horde LLC (http://www.horde.org/)
4+ * Copyright 2007-2026 Horde LLC (http://www.horde.org/)
45 *
56 * See the enclosed file LICENSE for license information (BSD). If you
67 * did not receive this file, see http://www.horde.org/licenses/bsd.
@@ -99,7 +100,7 @@ class Horde_Http_Client
99100 * constructor. See the class properties for available
100101 * settings.
101102 */
102- public function __construct ($ args = array () )
103+ public function __construct ($ args = [] )
103104 {
104105 // Set or create request object
105106 if (isset ($ args ['request ' ])) {
@@ -124,7 +125,7 @@ public function __construct($args = array())
124125 * @throws Horde_Http_Exception
125126 * @return Horde_Http_Response_Base
126127 */
127- public function get ($ uri = null , $ headers = array () )
128+ public function get ($ uri = null , $ headers = [] )
128129 {
129130 return $ this ->request ('GET ' , $ uri , null , $ headers );
130131 }
@@ -139,7 +140,7 @@ public function get($uri = null, $headers = array())
139140 * @throws Horde_Http_Exception
140141 * @return Horde_Http_Response_Base
141142 */
142- public function post ($ uri = null , $ data = null , $ headers = array () )
143+ public function post ($ uri = null , $ data = null , $ headers = [] )
143144 {
144145 return $ this ->request ('POST ' , $ uri , $ data , $ headers );
145146 }
@@ -154,11 +155,11 @@ public function post($uri = null, $data = null, $headers = array())
154155 * @throws Horde_Http_Exception
155156 * @return Horde_Http_Response_Base
156157 */
157- public function put ($ uri = null , $ data = null , $ headers = array () )
158+ public function put ($ uri = null , $ data = null , $ headers = [] )
158159 {
159160 if ($ this ->_httpMethodOverride ) {
160161 $ headers = array_merge (
161- array ( 'X-HTTP-Method-Override ' => 'PUT ' ) ,
162+ [ 'X-HTTP-Method-Override ' => 'PUT ' ] ,
162163 $ headers
163164 );
164165 return $ this ->post ($ uri , $ data , $ headers );
@@ -176,11 +177,11 @@ public function put($uri = null, $data = null, $headers = array())
176177 * @throws Horde_Http_Exception
177178 * @return Horde_Http_Response_Base
178179 */
179- public function delete ($ uri = null , $ headers = array () )
180+ public function delete ($ uri = null , $ headers = [] )
180181 {
181182 if ($ this ->_httpMethodOverride ) {
182183 $ headers = array_merge (
183- array ( 'X-HTTP-Method-Override ' => 'DELETE ' ) ,
184+ [ 'X-HTTP-Method-Override ' => 'DELETE ' ] ,
184185 $ headers
185186 );
186187 return $ this ->post ($ uri , null , $ headers );
@@ -198,7 +199,7 @@ public function delete($uri = null, $headers = array())
198199 * @throws Horde_Http_Exception
199200 * @return Horde_Http_Response_Base
200201 */
201- public function head ($ uri = null , $ headers = array () )
202+ public function head ($ uri = null , $ headers = [] )
202203 {
203204 return $ this ->request ('HEAD ' , $ uri , null , $ headers );
204205 }
@@ -220,9 +221,11 @@ public function head($uri = null, $headers = array())
220221 * @return Horde_Http_Response_Base
221222 */
222223 public function request (
223- $ method , $ uri = null , $ data = null , $ headers = array ()
224- )
225- {
224+ $ method ,
225+ $ uri = null ,
226+ $ data = null ,
227+ $ headers = []
228+ ) {
226229 if ($ method !== null ) {
227230 $ this ->request ->method = $ method ;
228231 }
@@ -251,7 +254,7 @@ public function request(
251254 */
252255 public function __get ($ name )
253256 {
254- return isset ( $ this ->{'_ ' . $ name }) ? $ this ->{ ' _ ' . $ name } : null ;
257+ return $ this ->{'_ ' . $ name } ?? null ;
255258 }
256259
257260 /**
@@ -271,7 +274,7 @@ public function __set($name, $value)
271274 }
272275 }
273276
274- list ( $ object , $ objectkey) = explode ('. ' , $ name , 2 );
277+ [ $ object , $ objectkey] = explode ('. ' , $ name , 2 );
275278 if ($ object == 'request ' ) {
276279 $ this ->$ object ->$ objectkey = $ value ;
277280 return true ;
0 commit comments