Merge pull request #14077 from pradpnayak/AutoComplete
[civicrm-core.git] / CRM / Cxn / CiviCxnHttp.php
index 0d6024812cc0c40441ab0acd4a49dd157eedf06c..f8acdb9704322a09d78b7654508c1ce11f93732e 100644 (file)
@@ -22,11 +22,11 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp {
    */
   public static function singleton($fresh = FALSE) {
     if (self::$singleton === NULL || $fresh) {
-      $cache = CRM_Utils_Cache::create(array(
+      $cache = CRM_Utils_Cache::create([
         'name' => 'CiviCxnHttp',
-        'type' => Civi::settings()->get('debug_enabled') ? 'ArrayCache' : array('SqlGroup', 'ArrayCache'),
+        'type' => Civi::settings()->get('debug_enabled') ? 'ArrayCache' : ['SqlGroup', 'ArrayCache'],
         'prefetch' => FALSE,
-      ));
+      ]);
 
       self::$singleton = new CRM_Cxn_CiviCxnHttp($cache);
     }
@@ -50,7 +50,7 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp {
    * @return array
    *   array($headers, $blob, $code)
    */
-  public function send($verb, $url, $blob, $headers = array()) {
+  public function send($verb, $url, $blob, $headers = []) {
     $lowVerb = strtolower($verb);
 
     if ($lowVerb === 'get' && $this->cache) {
@@ -67,11 +67,11 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp {
       $expires = CRM_Utils_Http::parseExpiration($result[0]);
       if ($expires !== NULL) {
         $cachePath = 'get_' . md5($url);
-        $cacheLine = array(
+        $cacheLine = [
           'url' => $url,
           'expires' => $expires,
           'data' => $result,
-        );
+        ];
         $this->cache->set($cachePath, $cacheLine);
       }
     }
@@ -93,9 +93,9 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp {
   protected function createStreamOpts($verb, $url, $blob, $headers) {
     $result = parent::createStreamOpts($verb, $url, $blob, $headers);
 
-    $caConfig = CA_Config_Stream::probe(array(
+    $caConfig = CA_Config_Stream::probe([
       'verify_peer' => (bool) Civi::settings()->get('verifySSL'),
-    ));
+    ]);
     if ($caConfig->isEnableSSL()) {
       $result['ssl'] = $caConfig->toStreamOptions();
     }