From: Kevin Day Date: Wed, 27 Sep 2017 02:38:08 +0000 (-0500) Subject: Cleanup: use [] syntax for creating arrays instead of array() syntax X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=5bbe541e5fb6217478cfee088056064aecefe151;p=koopa Cleanup: use [] syntax for creating arrays instead of array() syntax This is now well supported by PHP and simplifies code, slightly. I tested the code with PHP lint, so there should be no regressions. --- diff --git a/common/base/classes/base_address.php b/common/base/classes/base_address.php index b856419..41b0215 100644 --- a/common/base/classes/base_address.php +++ b/common/base/classes/base_address.php @@ -59,7 +59,7 @@ class c_base_address_email extends c_base_return { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -74,7 +74,7 @@ class c_base_address_email extends c_base_return { */ public function set_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -94,7 +94,7 @@ class c_base_address_email extends c_base_return { */ public function set_domain($domain) { if (!is_string($domain)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'domain', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'domain', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -168,7 +168,7 @@ class c_base_address_email extends c_base_return { */ public function is_private($is_private = NULL) { if (!is_null($is_private) && !is_bool($is_private)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_private', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_private', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_array.php b/common/base/classes/base_array.php index 645cc27..b3be57a 100644 --- a/common/base/classes/base_array.php +++ b/common/base/classes/base_array.php @@ -33,7 +33,7 @@ class c_base_array extends c_base_rfc_string { public function __construct() { parent::__construct(); - $this->items = array(); + $this->items = []; } /** @@ -78,7 +78,7 @@ class c_base_array extends c_base_rfc_string { */ public function set_items($array) { if (!is_array($array)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'array', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'array', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -100,12 +100,12 @@ class c_base_array extends c_base_rfc_string { */ public function set_item_at($item, $key) { if (!is_int($key) && !is_string($key)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'key', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'key', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->items)) { - $this->items = array(); + $this->items = []; } $this->items[$key] = $item; @@ -125,7 +125,7 @@ class c_base_array extends c_base_rfc_string { */ public function set_item_append($item) { if (!is_array($this->items)) { - $this->items = array(); + $this->items = []; } $this->items[] = $item; @@ -147,7 +147,7 @@ class c_base_array extends c_base_rfc_string { */ public function set_items_serialized($serialized) { if (!is_string($serialized)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'serialized', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'serialized', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -160,7 +160,7 @@ class c_base_array extends c_base_rfc_string { } unset($unserialized); - $this->items = array(); + $this->items = []; return new c_base_return_false(); } @@ -184,22 +184,22 @@ class c_base_array extends c_base_rfc_string { */ public function set_items_jsonized($jsonized, $associative = TRUE, $options = 0, $depth = 512) { if (!is_string($jsonized)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'jsonized', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'jsonized', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($associative)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'associative', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'associative', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($depth) || $depth < 1) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -212,7 +212,7 @@ class c_base_array extends c_base_rfc_string { } unset($decoded); - $this->items = array(); + $this->items = []; return new c_base_return_false(); } @@ -225,7 +225,7 @@ class c_base_array extends c_base_rfc_string { */ public function get_items() { if (!is_null($this->items) && !is_array($this->items)) { - return c_base_return_array::s_new(array()); + return c_base_return_array::s_new([]); } return c_base_return_array::s_new($this->items); @@ -340,7 +340,7 @@ class c_base_array extends c_base_rfc_string { */ public function get_item_at($key) { if (!is_string($key) || empty($key)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'key', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'key', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -375,7 +375,7 @@ class c_base_array extends c_base_rfc_string { */ public function get_items_keys() { if (empty($this->items)) { - return array(); + return []; } return array_keys($this->items); @@ -393,7 +393,7 @@ class c_base_array extends c_base_rfc_string { */ public function get_items_serialized() { if (!is_array($this->items)) { - return c_base_return_string::s_new(serialize(array())); + return c_base_return_string::s_new(serialize([])); } return c_base_return_string::s_new(serialize($this->items)); @@ -416,12 +416,12 @@ class c_base_array extends c_base_rfc_string { */ public function get_items_jsonized($options = 0, $depth = 512) { if (!is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($depth)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -437,7 +437,7 @@ class c_base_array extends c_base_rfc_string { if ($encoded === FALSE) { unset($encoded); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_charset.php b/common/base/classes/base_charset.php index 767752c..c8f15b0 100644 --- a/common/base/classes/base_charset.php +++ b/common/base/classes/base_charset.php @@ -43,7 +43,7 @@ class c_base_charset { */ public static function s_is_valid($charset) { if (!is_int($charset)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -66,7 +66,7 @@ class c_base_charset { */ public static function s_to_string($charset) { if (!is_int($charset)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -113,7 +113,7 @@ class c_base_charset { return c_base_return_string::s_new('ISO-8859-16'); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '::' . __FUNCTION__), i_base_error_messages::FUNCTION_FAILURE)); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '::' . __FUNCTION__], i_base_error_messages::FUNCTION_FAILURE]); return c_base_return_error::s_false($error); } } diff --git a/common/base/classes/base_cookie.php b/common/base/classes/base_cookie.php index bf00194..08d0f71 100644 --- a/common/base/classes/base_cookie.php +++ b/common/base/classes/base_cookie.php @@ -106,7 +106,7 @@ class c_base_cookie extends c_base_return_array { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -120,12 +120,12 @@ class c_base_cookie extends c_base_return_array { */ public function set_name($name) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (mb_strlen($name) == 0 || preg_match('/^(\w|-)+$/iu', $name) != 1) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'name', ':{expected_format}' => '. Alphanumeric and dash characters only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'name', ':{expected_format}' => '. Alphanumeric and dash characters only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } @@ -157,7 +157,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_secure($secure) { if (!is_bool($secure)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'secure', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'secure', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -204,12 +204,12 @@ class c_base_cookie extends c_base_return_array { $expires = (int) $expires; if ($expires < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -265,12 +265,12 @@ class c_base_cookie extends c_base_return_array { $max_age = (int) $max_age; if ($max_age < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'max_age', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'max_age', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'max_age', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'max_age', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -312,7 +312,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_path($path) { if (!is_string($path) || empty($path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -320,7 +320,7 @@ class c_base_cookie extends c_base_return_array { $parsed = parse_url($path, PHP_URL_PATH); if ($parsed === FALSE) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'parse_url'), i_base_error_messages::OPERATION_FAILURE)); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'parse_url'], i_base_error_messages::OPERATION_FAILURE]); return c_base_return_error::s_false($error); } @@ -356,7 +356,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_domain($domain) { if (!is_string($domain) || empty($domain)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'domain', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'domain', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -364,7 +364,7 @@ class c_base_cookie extends c_base_return_array { $parsed = parse_url('stub://' . $domain, PHP_URL_HOST); if ($parsed === FALSE) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'parse_url', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'parse_url', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -398,7 +398,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_http_only($http_only) { if (!is_bool($http_only)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'http_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'http_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -435,7 +435,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_first_only($first_only) { if (!is_bool($first_only)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'first_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'first_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -473,7 +473,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_host_only($host_only) { if (!is_bool($host_only)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'host_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -511,7 +511,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_same_site($same_site) { if (!is_int($same_site)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'same_site', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'same_site', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -522,7 +522,7 @@ class c_base_cookie extends c_base_return_array { $this->same_site = $same_site; break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'same_site', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'same_site', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -560,12 +560,12 @@ class c_base_cookie extends c_base_return_array { */ public function get_cookie($checksum = TRUE) { if (!is_bool($checksum)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_null($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -593,7 +593,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_json_encode_depth($json_encode_depth) { if (!is_int($json_encode_depth) || $json_encode_depth < 1) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'json_encode_depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'json_encode_depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -636,22 +636,22 @@ class c_base_cookie extends c_base_return_array { */ public function do_push($checksum = TRUE, $force = FALSE) { if (!is_bool($checksum)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($force)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_null($this->name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -693,7 +693,7 @@ class c_base_cookie extends c_base_return_array { unset($json); if ($data === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -718,7 +718,7 @@ class c_base_cookie extends c_base_return_array { */ public function validate() { if (!is_array($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->data')), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->data']], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -782,7 +782,7 @@ class c_base_cookie extends c_base_return_array { } unset($checksum); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_build_checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_build_checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -811,7 +811,7 @@ class c_base_cookie extends c_base_return_array { */ private function p_build_checksum() { if (!is_array($this->value)) { - $this->value = array(); + $this->value = []; } $has_checksum = array_key_exists('checksum', $this->value); @@ -880,7 +880,7 @@ class c_base_cookie extends c_base_return_array { if (is_null($this->value['checksum'])) { unset($this->value['checksum']); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_build_checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_build_checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } } @@ -888,7 +888,7 @@ class c_base_cookie extends c_base_return_array { $json = json_encode($this->value, 0, $this->json_encode_depth); if ($json === FALSE) { unset($json); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_database.php b/common/base/classes/base_database.php index b7c83ca..93a93aa 100644 --- a/common/base/classes/base_database.php +++ b/common/base/classes/base_database.php @@ -125,7 +125,7 @@ class c_base_database_connection_string extends c_base_return_string { */ public function set_host($host) { if (!is_string($host)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -160,7 +160,7 @@ class c_base_database_connection_string extends c_base_return_string { */ public function set_host_addr($host_addr) { if (!is_string($host_addr)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host_addr', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'host_addr', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -198,12 +198,12 @@ class c_base_database_connection_string extends c_base_return_string { if (is_string($port) && is_numeric($port)) { $port = (int) $port; if ($port < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'port', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'port', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'port', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'port', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -239,7 +239,7 @@ class c_base_database_connection_string extends c_base_return_string { */ public function set_database($database) { if (!is_string($database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -274,7 +274,7 @@ class c_base_database_connection_string extends c_base_return_string { */ public function set_user($user) { if (!is_string($user)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -309,7 +309,7 @@ class c_base_database_connection_string extends c_base_return_string { */ public function set_password($password) { if (!is_null($password) && !is_string($password)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -352,12 +352,12 @@ class c_base_database_connection_string extends c_base_return_string { if (is_string($connect_timeout) && is_numeric($connect_timeout)) { $connect_timeout = (int) $connect_timeout; if ($connect_timeout < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connect_timeout', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'connect_timeout', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connect_timeout', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'connect_timeout', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -393,7 +393,7 @@ class c_base_database_connection_string extends c_base_return_string { */ public function set_options($options) { if (!is_string($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -433,7 +433,7 @@ class c_base_database_connection_string extends c_base_return_string { */ public function set_ssl_mode($ssl_mode) { if (!is_string($ssl_mode)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ssl_mode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'ssl_mode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -468,7 +468,7 @@ class c_base_database_connection_string extends c_base_return_string { */ public function set_service($service) { if (!is_string($service)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'service', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'service', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -646,7 +646,7 @@ class c_base_database extends c_base_return { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -661,12 +661,12 @@ class c_base_database extends c_base_return { */ public static function s_explode_array($array_string) { if (!is_string($array_string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'array_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'array_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (mb_strlen($array_string) < 2) { - return c_base_return_array::s_new(array()); + return c_base_return_array::s_new([]); } $processed_string = mb_substr($array_string, 1); @@ -689,7 +689,7 @@ class c_base_database extends c_base_return { */ public function set_session($session) { if (!is_object($session) || !($session instanceof c_base_session)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -725,7 +725,7 @@ class c_base_database extends c_base_return { */ public function set_connection_string($connection_string) { if (!is_object($connection_string) || !($connection_string instanceof c_base_database_connection_string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connection_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'connection_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -772,7 +772,7 @@ class c_base_database extends c_base_return { */ public function set_persistent($persistent) { if (!is_bool($persistent)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'persistent', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'persistent', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -812,7 +812,7 @@ class c_base_database extends c_base_return { */ public function set_asynchronous($asynchronous) { if (!is_bool($asynchronous)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'asynchronous', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'asynchronous', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -857,17 +857,17 @@ class c_base_database extends c_base_return { */ public function do_connect($force = FALSE) { if (!is_bool($force)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_null($this->connection_string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connection_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'connection_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_resource($this->database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_UNECESSARY); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_UNECESSARY); return c_base_return_error::s_true($error); } @@ -908,13 +908,13 @@ class c_base_database extends c_base_return { $warnings = $handle_warnings->get_warnings(); unset($handle_warnings); - $failure_reasons = array(); + $failure_reasons = []; if ($warnings instanceof c_base_return_array) { $failure_reasons = $warnings->get_value_exact(); } unset($warnings); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $this->connection_string->get_database()->get_value_exact(), ':{failure_reasons}' => $failure_reasons, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_CONNECTION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $this->connection_string->get_database()->get_value_exact(), ':{failure_reasons}' => $failure_reasons, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_CONNECTION_FAILURE); unset($failure_reasons); return c_base_return_error::s_false($error); @@ -947,7 +947,7 @@ class c_base_database extends c_base_return { public function do_disconnect() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -957,7 +957,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_close', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_close', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -973,7 +973,7 @@ class c_base_database extends c_base_return { public function do_flush() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -984,7 +984,7 @@ class c_base_database extends c_base_return { } if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_flush', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_flush', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1019,7 +1019,7 @@ class c_base_database extends c_base_return { */ public function is_busy() { if (!$this->asynchronous) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->asynchronous', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->asynchronous', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1044,14 +1044,14 @@ class c_base_database extends c_base_return { */ public function get_parameter_status($name) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_parameter_status($this->database, $name); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_parameter_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_parameter_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1072,7 +1072,7 @@ class c_base_database extends c_base_return { */ public function do_poll() { if (!$this->asynchronous) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1091,7 +1091,7 @@ class c_base_database extends c_base_return { public function do_reset() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1100,7 +1100,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_connection_reset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_connection_reset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1133,7 +1133,7 @@ class c_base_database extends c_base_return { public function do_ping() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1146,7 +1146,7 @@ class c_base_database extends c_base_return { return new c_base_return_false(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::FUNCTION_FAILURE); return c_base_return_error::s_false($error); } @@ -1167,13 +1167,13 @@ class c_base_database extends c_base_return { */ public function escape_literal($literal) { if (!is_string($literal)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'literal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'literal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1198,13 +1198,13 @@ class c_base_database extends c_base_return { */ public function escape_bytea($bytea) { if (!is_string($bytea)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'bytea', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'bytea', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1229,13 +1229,13 @@ class c_base_database extends c_base_return { */ public function escape_identifier($identifier) { if (!is_string($identifier)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'identifier', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'identifier', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1260,13 +1260,13 @@ class c_base_database extends c_base_return { */ public function unescape_bytea($bytea) { if (!is_string($bytea)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'bytea', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'bytea', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1288,13 +1288,13 @@ class c_base_database extends c_base_return { */ public function set_client_encoding($encoding) { if (!is_string($encoding)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1305,7 +1305,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_set_client_encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_set_client_encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1321,7 +1321,7 @@ class c_base_database extends c_base_return { public function get_client_encoding() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1330,7 +1330,7 @@ class c_base_database extends c_base_return { if ($encoding === FALSE) { unset($encoding); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_client_encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_client_encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1354,7 +1354,7 @@ class c_base_database extends c_base_return { public function consume_input() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1363,7 +1363,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_consume_input', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_consume_input', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1387,23 +1387,23 @@ class c_base_database extends c_base_return { */ public function do_convert($table, $array, $options = 0) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($array)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'array', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'array', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1411,7 +1411,7 @@ class c_base_database extends c_base_return { $converted = pg_connect_status($this->database, $table, $array, $options); if ($converted === FALSE) { unset($converted); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_connect_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_connect_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1443,20 +1443,20 @@ class c_base_database extends c_base_return { * @see: pg_prepare() * @see: pg_send_prepare() */ - public function do_execute($name, $parameters = array()) { + public function do_execute($name, $parameters = []) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1473,7 +1473,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => ($this->asynchronous ? 'pg_send_execute' : 'pg_execute'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => ($this->asynchronous ? 'pg_send_execute' : 'pg_execute'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1506,9 +1506,9 @@ class c_base_database extends c_base_return { * @see: pg_prepare() * @see: pg_send_prepare() */ - public function do_query($query, $parameters = array()) { + public function do_query($query, $parameters = []) { if (!is_string($query) || empty($query)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); $result = new c_base_database_result(); $result->set_error($error); @@ -1518,7 +1518,7 @@ class c_base_database extends c_base_return { } if (!is_array($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); $result = new c_base_database_result(); $result->set_error($error); @@ -1529,7 +1529,7 @@ class c_base_database extends c_base_return { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); $result = new c_base_database_result(); $result->set_error($error); @@ -1561,18 +1561,18 @@ class c_base_database extends c_base_return { if ($this->asynchronous) { if (empty($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_send_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_send_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_send_query_params', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_send_query_params', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); } } else { if (empty($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_query_params', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_query_params', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); } } @@ -1606,7 +1606,7 @@ class c_base_database extends c_base_return { */ public function do_prepare($name, $query) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); $result = new c_base_database_result(); $result->set_error($error); @@ -1616,7 +1616,7 @@ class c_base_database extends c_base_return { } if (!is_string($query) || empty($query)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); $result = new c_base_database_result(); $result->set_error($error); @@ -1627,7 +1627,7 @@ class c_base_database extends c_base_return { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); $result = new c_base_database_result(); @@ -1649,7 +1649,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => ($this->asynchronous ? 'pg_send_prepare' :'pg_prepare'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => ($this->asynchronous ? 'pg_send_prepare' :'pg_prepare'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); $result = new c_base_database_result(); $result->set_error($error); @@ -1670,7 +1670,7 @@ class c_base_database extends c_base_return { public function get_result() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); $result = new c_base_database_result(); @@ -1690,7 +1690,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_get_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_get_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); $result = new c_base_database_result(); $result->set_error($error); @@ -1733,7 +1733,7 @@ class c_base_database extends c_base_return { public function do_cancel() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1746,7 +1746,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_cancel_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_cancel_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1793,23 +1793,23 @@ class c_base_database extends c_base_return { */ public function do_insert($table, $values, $options = NULL) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($values)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'values', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'values', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($options) && !is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1834,7 +1834,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_insert', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_insert', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1877,28 +1877,28 @@ class c_base_database extends c_base_return { */ function do_update($table, $values, $conditions, $options = NULL) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($values)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'values', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'values', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($conditions)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($options) && !is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1923,7 +1923,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_update', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_update', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1967,23 +1967,23 @@ class c_base_database extends c_base_return { */ function do_select($table, $conditions, $options = NULL) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($conditions)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($options) && !is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2011,7 +2011,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_select', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_select', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2051,23 +2051,23 @@ class c_base_database extends c_base_return { */ function do_delete($table, $conditions, $options = NULL) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($conditions)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($options) && !is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2092,7 +2092,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_select', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_select', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2114,18 +2114,18 @@ class c_base_database extends c_base_return { */ public function get_meta_data($table, $extended = FALSE) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($extended)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'extended', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'extended', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2134,7 +2134,7 @@ class c_base_database extends c_base_return { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_meta_data', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_meta_data', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2158,13 +2158,13 @@ class c_base_database extends c_base_return { public function set_error_verbosity($verbosity) { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } if (!is_int($verbosity)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'verbosity', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'verbosity', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2183,7 +2183,7 @@ class c_base_database extends c_base_return { public function get_last_error() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2192,7 +2192,7 @@ class c_base_database extends c_base_return { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_last_error', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_last_error', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2211,7 +2211,7 @@ class c_base_database extends c_base_return { public function get_last_notice() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2220,7 +2220,7 @@ class c_base_database extends c_base_return { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_last_notice', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_last_notice', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2246,7 +2246,7 @@ class c_base_database extends c_base_return { public function get_transaction_status() { if (!is_resource($this->database)) { $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2255,7 +2255,7 @@ class c_base_database extends c_base_return { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_transaction_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_transaction_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2364,18 +2364,18 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_all_columns($column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_fetch_all_columns($this->value, $column); if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_all_columns', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_fetch_all_columns', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2392,13 +2392,13 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_all() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } $result = pg_fetch_all($this->value); if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_all', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_fetch_all', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2424,23 +2424,23 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_array($row = NULL, $type = PGSQL_ASSOC) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_fetch_array($this->value, $row, $type); if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_array', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_fetch_array', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2469,22 +2469,22 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_object($row = NULL, $class = NULL, $parameters = NULL) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($class) && !is_string($class)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'class', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'class', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameters) && !is_array($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2496,7 +2496,7 @@ class c_base_database_result extends c_base_return_resource { } if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_object', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_fetch_object', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2519,17 +2519,17 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_result($row, $column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($column) && !is_string($column) || is_int($column) && $column < 0 || is_string($column) && empty($column)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2542,7 +2542,7 @@ class c_base_database_result extends c_base_return_resource { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_fetch_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2564,12 +2564,12 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_row($row = NULL) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2581,7 +2581,7 @@ class c_base_database_result extends c_base_return_resource { } if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_fetch_row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2615,12 +2615,12 @@ class c_base_database_result extends c_base_return_resource { */ public function error($code = NULL) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($code) && !is_int($code)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2650,7 +2650,7 @@ class c_base_database_result extends c_base_return_resource { */ public function affected_rows() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } @@ -2668,13 +2668,13 @@ class c_base_database_result extends c_base_return_resource { */ public function number_of_rows() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } $result = pg_num_rows($this->value); if ($result < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_num_rows', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_num_rows', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2692,13 +2692,13 @@ class c_base_database_result extends c_base_return_resource { */ public function number_of_columns() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } $result = pg_num_fields($this->value); if ($result < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_num_fields', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_num_fields', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2719,19 +2719,19 @@ class c_base_database_result extends c_base_return_resource { */ public function field_name($number) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($number) || $number < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_field_name($this->value, $number); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2752,12 +2752,12 @@ class c_base_database_result extends c_base_return_resource { */ public function field_number($name) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_string($name) || mb_strlen($name) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2765,7 +2765,7 @@ class c_base_database_result extends c_base_return_resource { $result = pg_field_number($this->value, $name); if ($result < 0) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_field_number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2794,17 +2794,17 @@ class c_base_database_result extends c_base_return_resource { */ public function field_length($row, $name_or_number) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($name_or_number) && !(is_string($name_or_number) && mb_strlen($name) > 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name_or_number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name_or_number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2817,7 +2817,7 @@ class c_base_database_result extends c_base_return_resource { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_prtlen', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_field_prtlen', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2840,19 +2840,19 @@ class c_base_database_result extends c_base_return_resource { */ public function field_bytes($column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_size($this->value, $column); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_size', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_size', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2881,24 +2881,24 @@ class c_base_database_result extends c_base_return_resource { */ public function field_table($column, $oid = FALSE) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($oid)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_field_table($this->value, $column, $oid); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_field_table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2924,19 +2924,19 @@ class c_base_database_result extends c_base_return_resource { */ public function field_type_oid($column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_field_type_oid($this->value, $column); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_type_oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_field_type_oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2959,14 +2959,14 @@ class c_base_database_result extends c_base_return_resource { */ public function last_oid() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } $result = pg_last_oid($this->database); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_last_oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_last_oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2987,19 +2987,19 @@ class c_base_database_result extends c_base_return_resource { */ public function field_type($column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_field_type($this->value, $column); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'pg_field_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3024,7 +3024,7 @@ class c_base_database_result extends c_base_return_resource { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::FUNCTION_FAILURE); return c_base_return_error::s_false($error); } } @@ -3076,7 +3076,7 @@ class c_base_database_query extends c_base_return_array { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -3094,13 +3094,13 @@ class c_base_database_query extends c_base_return_array { */ public function import($import) { if (!is_string($import) || empty($import)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'import', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'import', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $decoded = json_decode($import, TRUE); if (!is_array($decoded) || empty($decoded)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3128,7 +3128,7 @@ class c_base_database_query extends c_base_return_array { // everything else has to be re-created on import for security reasons. $encoded = json_encode($this->value); if (!is_string($encoded)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3140,6 +3140,6 @@ class c_base_database_query extends c_base_return_array { */ private function p_initialize() { unset($this->value); - $this->value = array(); + $this->value = []; } } diff --git a/common/base/classes/base_debug.php b/common/base/classes/base_debug.php index 692ae32..1121f65 100644 --- a/common/base/classes/base_debug.php +++ b/common/base/classes/base_debug.php @@ -91,7 +91,7 @@ class c_base_debug extends c_base_return { */ public static function s_set_debugging($debug) { if (!is_bool($debug)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'debug', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'debug', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -188,12 +188,12 @@ class c_base_debug extends c_base_return { } if (!is_bool($milliseconds)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'milliseconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'milliseconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_null($this->time_start) || is_null($this->time_stop)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -228,18 +228,18 @@ class c_base_debug extends c_base_return { } if (!is_int($option) || $option < 1 || $option > 3) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($megabytes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'megabytes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'megabytes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($option == 1) { if (is_null($this->memory_usage_peak)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->memory_usage_peak', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->memory_usage_peak', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -251,7 +251,7 @@ class c_base_debug extends c_base_return { } elseif ($option == 2) { if (is_null($this->time_stop)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -263,12 +263,12 @@ class c_base_debug extends c_base_return { } else { if (is_null($this->time_start)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->time_start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->time_start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->time_stop)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_defaults_global.php b/common/base/classes/base_defaults_global.php index a4c693f..8837e89 100644 --- a/common/base/classes/base_defaults_global.php +++ b/common/base/classes/base_defaults_global.php @@ -37,8 +37,8 @@ class c_base_defaults_global { // provide a language to fallback to if none is set. const LANGUAGE_CLASS_DEFAULT = 'c_base_languages_us_only'; - // reserved path groups: array(97, 99, 100, 102, 109, 115, 116, 120, 121). - const RESERVED_PATH_GROUP = array(c_base_ascii::LOWER_A, c_base_ascii::LOWER_C, c_base_ascii::LOWER_D, c_base_ascii::LOWER_F, c_base_ascii::LOWER_M, c_base_ascii::LOWER_S, c_base_ascii::LOWER_T, c_base_ascii::LOWER_U, c_base_ascii::LOWER_X); + // reserved path groups: [97, 99, 100, 102, 109, 115, 116, 120, 121]. + const RESERVED_PATH_GROUP = [c_base_ascii::LOWER_A, c_base_ascii::LOWER_C, c_base_ascii::LOWER_D, c_base_ascii::LOWER_F, c_base_ascii::LOWER_M, c_base_ascii::LOWER_S, c_base_ascii::LOWER_T, c_base_ascii::LOWER_U, c_base_ascii::LOWER_X]; // default log facility (17 = c_base_error::FACILITY_LOCAL_0). const LOG_FACILITY = 17; @@ -103,7 +103,7 @@ class c_base_defaults_global { */ public static function s_set_timezone($timezone) { if (!($timezone instanceof i_base_languages)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timezone', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'timezone', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -125,7 +125,7 @@ class c_base_defaults_global { */ public static function s_set_languages($languages) { if (!($languages instanceof i_base_languages)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'languages', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'languages', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -156,12 +156,12 @@ class c_base_defaults_global { */ public static function s_get_date($string, $timestamp = NULL) { if (!is_string($string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_null($timestamp) && !is_float($timestamp) && !is_int($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -190,7 +190,7 @@ class c_base_defaults_global { unset($microseconds); if (!($date instanceof \DateTime)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -201,7 +201,7 @@ class c_base_defaults_global { $formatted = $date->format($string); if (!is_string($formatted)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date->format', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'date->format', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -227,7 +227,7 @@ class c_base_defaults_global { */ public static function s_get_timestamp($string, $format = 'Y/m/d h:i:s.u P') { if (!is_string($string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -239,13 +239,13 @@ class c_base_defaults_global { $date = \DateTime::createFromFormat($format, $string); if (!($date instanceof \DateTime)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } $resulting_timestamp = $date->getTimestamp(); if (!is_int($resulting_timestamp) && !is_float($resulting_timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date->get_timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'date->get_timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } diff --git a/common/base/classes/base_email.php b/common/base/classes/base_email.php index 27b3cd6..a706967 100644 --- a/common/base/classes/base_email.php +++ b/common/base/classes/base_email.php @@ -135,12 +135,12 @@ class c_base_email extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-5.5.1 */ private static function p_parse_email_full($email) { - $result = array( - 'emails' => array(), + $result = [ + 'emails' => [], 'invalid' => FALSE, - ); + ]; - $processed = array(); + $processed = []; $group = NULL; $group_id = NULL; $process_machine_part = FALSE; @@ -181,11 +181,11 @@ class c_base_email extends c_base_rfc_string { // if the proper stop point was reached, then the '<' is a valid opening. if ($parsed['stopped_at'] && !$parsed['invalid'] && !empty($parsed['name_machine'])) { $name_machine = $parsed['name_machine'] . '@' . $parsed['name_address']; - $result['emails'][$name_machine] = array( + $result['emails'][$name_machine] = [ 'name_human' => $name_human, 'name_machine' => $name_machine, 'name_address' => $parsed['name_address'], - ); + ]; $current_chunk_start = $current + 1; $is_named_machine = TRUE; @@ -325,11 +325,11 @@ class c_base_email extends c_base_rfc_string { // if the proper stop point was reached, then a valid machine name was found. if ($parsed['stopped_at'] && !$parsed['invalid'] && !empty($parsed['name_machine'])) { $name_machine = $parsed['name_machine'] . '@' . $parsed['name_address']; - $result['emails'][$name_machine] = array( + $result['emails'][$name_machine] = [ 'name_human' => $name_human, 'name_machine' => $name_machine, 'name_address' => $parsed['name_address'], - ); + ]; $current_chunk_start = $current + 1; @@ -403,13 +403,13 @@ class c_base_email extends c_base_rfc_string { * - For example, if execution was stopped on an unexpected brace, the location would be the position of that specific brace. */ private static function p_parse_email_machine($email_codes, $email_characters, $start = NULL, $stop = NULL, $stop_at = FALSE) { - $result = array( + $result = [ 'name_machine' => '', 'name_address' => '', 'invalid' => FALSE, 'current' => 0, 'stopped_at' => FALSE, - ); + ]; if (!is_null($start)) { $result['current'] = $start; diff --git a/common/base/classes/base_error.php b/common/base/classes/base_error.php index e756ff1..f2ea8af 100644 --- a/common/base/classes/base_error.php +++ b/common/base/classes/base_error.php @@ -76,7 +76,7 @@ class c_base_error { $this->limit = self::DEFAULT_BACKTRACE_LIMIT; $this->recovered = FALSE; - $this->backtrace = array(); + $this->backtrace = []; $this->backtrace_perform = FALSE; $this->ignore_arguments = TRUE; @@ -142,7 +142,7 @@ class c_base_error { $entry->set_details($details); } elseif (is_null($details)) { - $entry->set_details(array()); + $entry->set_details([]); } if (is_int($code)) { @@ -271,7 +271,7 @@ class c_base_error { $this->p_backtrace($count + 1); } elseif ($count === FALSE) { - $this->backtrace = array(); + $this->backtrace = []; } else { return FALSE; @@ -518,7 +518,7 @@ class c_base_error { return; } - $this->backtrace = array(); + $this->backtrace = []; // when limit is set to FALSE, backtrace is disabled. if ($this->limit === FALSE) { diff --git a/common/base/classes/base_file.php b/common/base/classes/base_file.php index 72e46da..d79a807 100644 --- a/common/base/classes/base_file.php +++ b/common/base/classes/base_file.php @@ -125,7 +125,7 @@ class c_base_file extends c_base_return_value { */ public function set_id($id) { if (!is_int($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -145,7 +145,7 @@ class c_base_file extends c_base_return_value { */ public function set_id_creator($id_creator) { if (!is_int($id_creator)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_creator', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_creator', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -165,7 +165,7 @@ class c_base_file extends c_base_return_value { */ public function set_id_creator_session($id_creator_session) { if (!is_int($id_creator_session)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_creator_session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_creator_session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -185,7 +185,7 @@ class c_base_file extends c_base_return_value { */ public function set_id_type($id_type) { if (!is_int($id_type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -205,7 +205,7 @@ class c_base_file extends c_base_return_value { */ public function set_id_group($id_group) { if (!is_null($id_group) && !is_int($id_group)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_group', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_group', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -225,7 +225,7 @@ class c_base_file extends c_base_return_value { */ public function set_name_machine($name_machine) { if (!is_string($name_machine)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name_machine', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name_machine', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -245,7 +245,7 @@ class c_base_file extends c_base_return_value { */ public function set_name_human($name_human) { if (!is_string($name_human)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name_human', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name_human', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -265,7 +265,7 @@ class c_base_file extends c_base_return_value { */ public function set_name_extension($name_extension) { if (!is_string($name_extension)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name_extension', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name_extension', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -285,7 +285,7 @@ class c_base_file extends c_base_return_value { */ public function set_field_size($field_size) { if (!is_int($field_size)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_size', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'field_size', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -305,7 +305,7 @@ class c_base_file extends c_base_return_value { */ public function set_field_width($field_width) { if (!is_null($field_width) && !is_int($field_width)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_width', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'field_width', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -325,7 +325,7 @@ class c_base_file extends c_base_return_value { */ public function set_field_height($field_height) { if (!is_null($field_height) && !is_int($field_height)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_height', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'field_height', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -345,7 +345,7 @@ class c_base_file extends c_base_return_value { */ public function set_date_created($date_created) { if (!is_int($date_created) && !is_float($date_created)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_created', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_created', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -365,7 +365,7 @@ class c_base_file extends c_base_return_value { */ public function set_date_changed($date_changed) { if (!is_int($date_changed) && !is_float($date_changed)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_changed', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_changed', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -385,7 +385,7 @@ class c_base_file extends c_base_return_value { */ public function set_date_locked($date_locked) { if (!is_int($date_locked) && !is_float($date_locked)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -405,7 +405,7 @@ class c_base_file extends c_base_return_value { */ public function set_date_deleted($date_deleted) { if (!is_int($date_deleted) && !is_float($date_deleted)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_deleted', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_deleted', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_form.php b/common/base/classes/base_form.php index 95ed2f4..5399e09 100644 --- a/common/base/classes/base_form.php +++ b/common/base/classes/base_form.php @@ -59,7 +59,7 @@ class c_base_form_problem extends c_base_return_string { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -115,17 +115,17 @@ class c_base_form_problem extends c_base_return_string { */ public function set_field($field_name) { if (is_null($field_name)) { - $this->fields = array(); + $this->fields = []; return new c_base_return_true(); } if (!is_string($field_name) || empty($field_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->fields)) { - $this->fields = array(); + $this->fields = []; } $this->fields[$field_name] = $field_name; @@ -147,7 +147,7 @@ class c_base_form_problem extends c_base_return_string { */ public function unset_field($field_name) { if (!is_string($field_name) && !empty($field_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -168,7 +168,7 @@ class c_base_form_problem extends c_base_return_string { */ public function get_fields() { if (!is_array($this->fields)) { - $this->fields = array(); + $this->fields = []; } return c_base_return_array::s_new($this->fields); @@ -190,17 +190,17 @@ class c_base_form_problem extends c_base_return_string { */ public function set_argument($index, $value) { if (!is_string($index) && !empty($index)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->arguments)) { - $this->arguments = array(); + $this->arguments = []; } $this->arguments[$index] = $value; @@ -217,12 +217,12 @@ class c_base_form_problem extends c_base_return_string { */ public function get_argument($index) { if (!is_string($index) && !empty($index)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->arguments)) { - $this->arguments = array(); + $this->arguments = []; } if (!array_key_exists($index, $this->arguments)) { @@ -241,7 +241,7 @@ class c_base_form_problem extends c_base_return_string { */ public function get_arguments() { if (!is_array($this->arguments)) { - $this->arguments = array(); + $this->arguments = []; } return c_base_return_array::s_new($this->arguments); diff --git a/common/base/classes/base_html.php b/common/base/classes/base_html.php index 95fe604..8bbe081 100644 --- a/common/base/classes/base_html.php +++ b/common/base/classes/base_html.php @@ -35,11 +35,11 @@ class c_base_html extends c_base_return { $this->id = NULL; - $this->attributes = array(); - $this->attributes_body = array(); + $this->attributes = []; + $this->attributes_body = []; - $this->headers = array(); - $this->body = array(); + $this->headers = []; + $this->body = []; } /** @@ -97,12 +97,12 @@ class c_base_html extends c_base_return { */ public static function sanitize_css($text, $partial = FALSE) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_bool($partial)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'partial', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'partial', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -120,7 +120,7 @@ class c_base_html extends c_base_return { } unset($sanitized); - $error = c_base_error::s_log(' ' . $response['error']['message'], array('arguments' => array(':{operation_name}' => 'preg_replace', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(' ' . $response['error']['message'], ['arguments' => [':{operation_name}' => 'preg_replace', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -136,7 +136,7 @@ class c_base_html extends c_base_return { */ public function set_id($id) { if (!is_int($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -159,7 +159,7 @@ class c_base_html extends c_base_return { */ public function set_attribute($attribute, $value) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -181,7 +181,7 @@ class c_base_html extends c_base_return { */ public function set_attribute_body($attribute, $value) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -203,17 +203,17 @@ class c_base_html extends c_base_return { */ public function set_tag($tag, $delta = NULL) { if (!($tag instanceof c_base_markup_tag)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($delta) && !is_int($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->body)) { - $this->body = array(); + $this->body = []; } if (is_null($delta)) { @@ -240,12 +240,12 @@ class c_base_html extends c_base_return { */ public function set_header($header, $delta = NULL) { if (!($header instanceof c_base_markup_tag)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'header', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($delta) && !is_int($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -265,7 +265,7 @@ class c_base_html extends c_base_return { } if (!is_array($this->headers)) { - $this->headers = array(); + $this->headers = []; } if (is_null($delta)) { @@ -305,7 +305,7 @@ class c_base_html extends c_base_return { */ public function get_attributes() { if (!isset($this->attributes) && !is_array($this->attributes)) { - $this->attributes = array(); + $this->attributes = []; } return c_base_return_array::s_new($this->attributes); @@ -324,7 +324,7 @@ class c_base_html extends c_base_return { */ public function get_attribute($attribute) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -346,7 +346,7 @@ class c_base_html extends c_base_return { */ public function get_attribute_body($attribute) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -366,7 +366,7 @@ class c_base_html extends c_base_return { */ public function get_tag($delta) { if (!is_int($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -386,7 +386,7 @@ class c_base_html extends c_base_return { */ public function get_body() { if (!is_array($this->body)) { - return c_base_return_array::s_new(array()); + return c_base_return_array::s_new([]); } return c_base_return_array::s_new($this->body); @@ -405,7 +405,7 @@ class c_base_html extends c_base_return { */ public function get_header($delta) { if (!is_int($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -425,7 +425,7 @@ class c_base_html extends c_base_return { */ public function get_headers() { if (!is_array($this->headers)) { - return c_base_return_array::s_new(array()); + return c_base_return_array::s_new([]); } return c_base_return_array::s_new($this->headers); @@ -945,14 +945,14 @@ class c_base_html extends c_base_return { if (is_string($value)) { if ($body) { if (!isset($this->attributes_body[$attribute])) { - $this->attributes_body[$attribute] = array(); + $this->attributes_body[$attribute] = []; } $this->attributes_body[$attribute][] = $value; } else { if (!isset($this->attributes[$attribute])) { - $this->attributes[$attribute] = array(); + $this->attributes[$attribute] = []; } $this->attributes[$attribute][] = $value; @@ -1002,12 +1002,12 @@ class c_base_html extends c_base_return { private function p_get_attribute($attribute, $body = FALSE) { if ($body) { if (!isset($this->attributes_body) && !is_array($this->attributes_body)) { - $this->attributes_body = array(); + $this->attributes_body = []; } } else { if (!isset($this->attributes) && !is_array($this->attributes)) { - $this->attributes = array(); + $this->attributes = []; } } diff --git a/common/base/classes/base_http.php b/common/base/classes/base_http.php index 381a052..827ba35 100644 --- a/common/base/classes/base_http.php +++ b/common/base/classes/base_http.php @@ -260,9 +260,9 @@ class c_base_http extends c_base_rfc_string { $this->headers = NULL; $this->headers_sent = FALSE; - $this->request = array(); + $this->request = []; $this->request_time = NULL; - $this->response = array(); + $this->response = []; $this->request_uri_relative = NULL; $this->request_uri_query = NULL; @@ -363,12 +363,12 @@ class c_base_http extends c_base_rfc_string { */ public function get_request($header_name = NULL, $delta = NULL) { if (!is_null($header_name) && !is_int($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($delta) && !is_int($delta) && !is_string($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -377,7 +377,7 @@ class c_base_http extends c_base_rfc_string { } if (!array_key_exists($header_name, $this->request)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => $header_name, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => $header_name, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -390,7 +390,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_value::s_new($this->request[$header_name]['data'][$delta]); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -407,8 +407,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_request_headers() { if (!is_array($this->headers)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{data_name}' => 'request headers', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_DEFINED); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{data_name}' => 'request headers', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_DEFINED); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->headers); @@ -429,12 +429,12 @@ class c_base_http extends c_base_rfc_string { */ public function get_request_uri_relative($base_path, $with_query = FALSE) { if (!is_string($base_path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'base_path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'base_path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_bool($with_query)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'with_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'with_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -491,7 +491,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_request_uri_query($base_path) { if (!is_string($base_path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'base_path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'base_path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -540,12 +540,12 @@ class c_base_http extends c_base_rfc_string { */ public function get_response($header_name = NULL, $delta = NULL) { if (!is_null($header_name) && !is_int($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($delta) && !is_int($delta) && !is_string($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -554,7 +554,7 @@ class c_base_http extends c_base_rfc_string { } if (!array_key_exists($header_name, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => $header_name, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => $header_name, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -571,7 +571,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_value::s_new($this->response[$header_name][$delta]); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -593,7 +593,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_languages($class_name) { if (!(is_string($class_name) && is_subclass_of('i_base_languages', $class_name)) || !(is_object($class_name) && $class_name instanceof i_base_languages)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'class_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'class_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -659,9 +659,9 @@ class c_base_http extends c_base_rfc_string { } // force the request array to be defined. - $this->request = array(); + $this->request = []; - $initialize_keys = array( + $initialize_keys = [ static::REQUEST_ACCEPT, static::REQUEST_ACCEPT_CHARSET, static::REQUEST_ACCEPT_ENCODING, @@ -705,15 +705,15 @@ class c_base_http extends c_base_rfc_string { static::REQUEST_CHECKSUM_HEADER, static::REQUEST_CHECKSUM_HEADERS, static::REQUEST_CHECKSUM_CONTENT, - ); + ]; foreach ($initialize_keys as $initialize_key) { - $this->request[$initialize_key] = array( + $this->request[$initialize_key] = [ 'defined' => FALSE, 'invalid' => FALSE, - 'data' => array( - ), - ); + 'data' => [ + ], + ]; } unset($initialize_key); unset($initialize_keys); @@ -722,7 +722,7 @@ class c_base_http extends c_base_rfc_string { $headers = array_flip(array_keys($this->headers)); // additional keys for specific cases. - $this->request[static::REQUEST_ACCEPT]['types'] = array(); + $this->request[static::REQUEST_ACCEPT]['types'] = []; if (array_key_exists('accept', $this->headers)) { @@ -979,7 +979,7 @@ class c_base_http extends c_base_rfc_string { */ public function select_language($supported_languages) { if (!is_array($supported_languages) || empty($supported_languages)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'supported_languages', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'supported_languages', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -988,7 +988,7 @@ class c_base_http extends c_base_rfc_string { if (isset($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']) && is_array($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data'])) { if (isset($this->request[static::REQUEST_ACCEPT_LANGUAGE]['invalid']) && $this->request[static::REQUEST_ACCEPT_LANGUAGE]['invalid']) {; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'supported_languages', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'supported_languages', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value($language_chosen, 'c_base_return_int', $error); } @@ -1033,20 +1033,20 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_allow_origin($uri) { if (!is_string($uri)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($uri == c_base_ascii::ASTERISK) { - $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = array('wildcard' => TRUE); + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = ['wildcard' => TRUE]; } else { $text = $this->pr_rfc_string_prepare($uri); if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1055,7 +1055,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed['invalid']) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'uri', ':{expected_format}' => NULL, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'uri', ':{expected_format}' => NULL, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed['invalid']); @@ -1085,7 +1085,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_allow_credentials($allow_credentials) { if (!is_bool($allow_credentials)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allowed_credentials', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'allowed_credentials', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1112,12 +1112,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_expose_headers($header_name, $append = TRUE) { if (!is_string($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1126,19 +1126,19 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } if ($append) { if (!isset($this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS]) || !is_array($this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS])) { - $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = array(); + $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = []; } $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS][$prepared_token] = $prepared_token; } else { - $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = [$prepared_token => $prepared_token]; } unset($prepared_token); @@ -1161,7 +1161,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_max_age($seconds) { if (!is_int($seconds) && !is_float($seconds)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1188,12 +1188,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_allow_methods($method, $append = TRUE) { if (!is_int($method)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1221,20 +1221,20 @@ class c_base_http extends c_base_rfc_string { break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($append) { if (!isset($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS]) || !is_array($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS])) { - $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = array(); + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = []; } $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS][$method] = $method; } else { - $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = array($method => $method); + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = [$method => $method]; } return new c_base_return_true(); @@ -1255,12 +1255,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_allow_headers($header_name, $append = TRUE) { if (!is_string($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1269,19 +1269,19 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } if ($append) { if (!isset($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS]) || !is_array($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS])) { - $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = array(); + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = []; } $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS][$prepared_token] = $prepared_token; } else { - $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = [$prepared_token => $prepared_token]; } unset($prepared_token); @@ -1308,12 +1308,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_accept_patch($media_type, $append = TRUE) { if (!is_string($media_type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'media_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'media_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1322,7 +1322,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1332,7 +1332,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed['invalid']) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'media type', ':{expected_format}' => '1*(tchar) "/" 1*(tchar) *(*(wsp) ";" *(wsp) 1*(1*(tchar) *(wsp) "=" *(wsp) 1*(tchar) / (quoted-string)))', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'media type', ':{expected_format}' => '1*(tchar) "/" 1*(tchar) *(*(wsp) ";" *(wsp) 1*(1*(tchar) *(wsp) "=" *(wsp) 1*(tchar) / (quoted-string)))', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed['invalid']); @@ -1340,13 +1340,13 @@ class c_base_http extends c_base_rfc_string { if ($append) { if (!isset($this->response[static::RESPONSE_ACCEPT_PATCH]) || !is_array($this->response[static::RESPONSE_ACCEPT_PATCH])) { - $this->response[static::RESPONSE_ACCEPT_PATCH] = array(); + $this->response[static::RESPONSE_ACCEPT_PATCH] = []; } $this->response[static::RESPONSE_ACCEPT_PATCH][] = $parsed; } else { - $this->response[static::RESPONSE_ACCEPT_PATCH] = array($parsed); + $this->response[static::RESPONSE_ACCEPT_PATCH] = [$parsed]; } unset($parsed); @@ -1373,7 +1373,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_accept_ranges($ranges) { if (!is_string($ranges)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ranges', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'ranges', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1382,7 +1382,7 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1406,7 +1406,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_age($seconds) { if (!is_int($seconds)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1436,12 +1436,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_allow($allow, $append = TRUE) { if (!is_int($allow)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allow', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'allow', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1461,24 +1461,24 @@ class c_base_http extends c_base_rfc_string { case static::HTTP_METHOD_DEBUG: break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allow', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'allow', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($allow == static::HTTP_METHOD_NONE) { - $this->response[static::RESPONSE_ALLOW] = array($allow => $allow); + $this->response[static::RESPONSE_ALLOW] = [$allow => $allow]; return new c_base_return_true(); } if ($append) { if (!isset($this->response[static::RESPONSE_ALLOW]) || !is_array($this->response[static::RESPONSE_ALLOW])) { - $this->response[static::RESPONSE_ALLOW] = array(); + $this->response[static::RESPONSE_ALLOW] = []; } $this->response[static::RESPONSE_ALLOW][$allow] = $allow; } else { - $this->response[static::RESPONSE_ALLOW] = array($allow => $allow); + $this->response[static::RESPONSE_ALLOW] = [$allow => $allow]; } return new c_base_return_true(); @@ -1514,17 +1514,17 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_cache_control($directive_name, $directive_value = NULL, $append = TRUE) { if (!is_int($directive_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directive_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'directive_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($directive_value) && !is_string($directive_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directive_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'directive_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1545,7 +1545,7 @@ class c_base_http extends c_base_rfc_string { break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directive_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'directive_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1555,7 +1555,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1565,7 +1565,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed['invalid']) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'directive value', ':{expected_format}' => '1*(tchar) *("=" 1*(1*(tchar) / quoted-string) *(*(wsp) "," *(wsp) 1*(tchar) *("=" 1*(1*(tchar) / quoted-string))', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'directive value', ':{expected_format}' => '1*(tchar) *("=" 1*(1*(tchar) / quoted-string) *(*(wsp) "," *(wsp) 1*(tchar) *("=" 1*(1*(tchar) / quoted-string))', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed); @@ -1573,13 +1573,13 @@ class c_base_http extends c_base_rfc_string { if ($append) { if (!isset($this->response[static::RESPONSE_CACHE_CONTROL]) || !is_array($this->response[static::RESPONSE_CACHE_CONTROL])) { - $this->response[static::RESPONSE_CACHE_CONTROL] = array(); + $this->response[static::RESPONSE_CACHE_CONTROL] = []; } $this->response[static::RESPONSE_CACHE_CONTROL][$directive_name] = $directive_value; } else { - $this->response[static::RESPONSE_CACHE_CONTROL] = array($directive_name => $directive_value); + $this->response[static::RESPONSE_CACHE_CONTROL] = [$directive_name => $directive_value]; } unset($parsed_directive_value); @@ -1607,12 +1607,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_connection($connection_option, $append = TRUE) { if (!is_string($connection_option)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connection_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'connection_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1621,19 +1621,19 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } if ($append) { if (!isset($this->response[static::RESPONSE_CONNECTION]) || !is_array($this->response[static::RESPONSE_CONNECTION])) { - $this->response[static::RESPONSE_CONNECTION] = array(); + $this->response[static::RESPONSE_CONNECTION] = []; } $this->response[static::RESPONSE_CONNECTION][$prepared_token] = $prepared_token; } else { - $this->response[static::RESPONSE_CONNECTION] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_CONNECTION] = [$prepared_token => $prepared_token]; } unset($prepared_token); @@ -1667,17 +1667,17 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content($content, $append = TRUE, $is_file = FALSE) { if (!is_string($content)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($is_file)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_file', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_file', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1688,7 +1688,7 @@ class c_base_http extends c_base_rfc_string { $this->content[] = $content; } else { - $this->content = array($content); + $this->content = [$content]; } @@ -1707,7 +1707,7 @@ class c_base_http extends c_base_rfc_string { if ($is_file) { $this->content_is_file = TRUE; - $this->content = array($content); + $this->content = [$content]; } else { $this->content_is_file = FALSE; @@ -1752,22 +1752,22 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_disposition($type, $parameter_name = NULL, $parameter_value = NULL, $append = TRUE) { if (!is_null($type) && !is_string($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_name) && !is_string($parameter_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_value) && !is_string($parameter_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1788,14 +1788,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'content disposition type', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'content disposition type', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_token)) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -1806,14 +1806,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_parameter_name === FALSE) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'content disposition parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'content disposition parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_parameter_name)) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -1823,7 +1823,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1834,7 +1834,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_parameter_value); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'disposition parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'disposition parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_parameter_value['invalid']); @@ -1849,14 +1849,14 @@ class c_base_http extends c_base_rfc_string { if (is_null($type)) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_CONTENT_DISPOSITION] = array( + $this->response[static::RESPONSE_CONTENT_DISPOSITION] = [ 'type' => NULL, - 'parameters' => array(), - ); + 'parameters' => [], + ]; } if (is_string($type)) { @@ -1869,7 +1869,7 @@ class c_base_http extends c_base_rfc_string { $this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters'][$prepared_parameter_name] = $parsed_parameter_value['text']; } else { - $this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters'] = array($prepared_parameter_name => $parsed_parameter_value['text']); + $this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters'] = [$prepared_parameter_name => $parsed_parameter_value['text']]; } } unset($prepared_parameter_name); @@ -1950,12 +1950,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_encoding($encoding, $append = TRUE) { if (!is_int($encoding)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1974,7 +1974,7 @@ class c_base_http extends c_base_rfc_string { case static::ENCODING_PG: break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1982,7 +1982,7 @@ class c_base_http extends c_base_rfc_string { $this->response[static::RESPONSE_CONTENT_ENCODING][] = $encoding; } else { - $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = [$encoding]; } return new c_base_return_true(); @@ -2008,12 +2008,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_language($language = NULL, $append = TRUE) { if (!is_null($language) && !is_int($language)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'language', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'language', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2026,21 +2026,21 @@ class c_base_http extends c_base_rfc_string { if ($default instanceof c_base_return_false) { unset($default); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->languages->s_get_default_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->languages->s_get_default_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_CONTENT_LANGUAGE] = array($default->get_value_exact()); + $this->response[static::RESPONSE_CONTENT_LANGUAGE] = [$default->get_value_exact()]; unset($default); } else { if ($this->languages->s_get_names_by_id($language) instanceof c_base_return_false) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->languages->s_get_names_by_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->languages->s_get_names_by_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } if (!isset($this->response[static::RESPONSE_CONTENT_LANGUAGE])) { - $this->response[static::RESPONSE_CONTENT_LANGUAGE] = array(); + $this->response[static::RESPONSE_CONTENT_LANGUAGE] = []; } $this->response[static::RESPONSE_CONTENT_LANGUAGE][] = $language; @@ -2074,12 +2074,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_length($length = NULL, $force = FALSE) { if (!is_null($length) && !is_int($length) || $length < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($force)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2101,7 +2101,7 @@ class c_base_http extends c_base_rfc_string { if (!file_exists($filename)) { unset($filename); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -2145,34 +2145,34 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_range($start, $stop, $total) { if (!is_int($start) && $start !== FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($stop) && $stop !== FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($total) && $total !== FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'total', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'total', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } // unsatisfiable requires a total to be specified. if (($start === FALSE || $stop === FALSE) && $total === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'total', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'total', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_CONTENT_RANGE] = array( + $this->response[static::RESPONSE_CONTENT_RANGE] = [ 'total' => $total, 'type' => 'bytes', - 'range' => array( + 'range' => [ 'start' => $start, 'stop' => $stop, - ) - ); + ], + ]; if ($start === FALSE || $stop === FALSE) { $this->response[static::RESPONSE_CONTENT_RANGE]['range'] = FALSE; @@ -2204,7 +2204,7 @@ class c_base_http extends c_base_rfc_string { $result = c_base_mime::s_get_names_by_id($content_type); if ($result instanceof c_base_return_false) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2212,14 +2212,14 @@ class c_base_http extends c_base_rfc_string { unset($result); } elseif (!is_string($content_type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } else { $result = c_base_mime::s_identify($content_type, TRUE); if ($result instanceof c_base_return_false) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2230,15 +2230,15 @@ class c_base_http extends c_base_rfc_string { if (!c_base_charset::s_is_valid($charset)) { unset($content_type_string); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_CONTENT_TYPE] = array( + $this->response[static::RESPONSE_CONTENT_TYPE] = [ 'type' => $content_type_string, 'charset' => $charset, - ); + ]; unset($content_type_string); return new c_base_return_true(); @@ -2275,7 +2275,7 @@ class c_base_http extends c_base_rfc_string { } if (!is_int($timestamp) && !is_float($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2312,7 +2312,7 @@ class c_base_http extends c_base_rfc_string { } if (!is_int($timestamp) && !is_float($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2345,15 +2345,15 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_etag($entity_tag = NULL, $weak = FALSE) { if (!is_null($entity_tag) && !is_string($entity_tag) && $entity_tag !== FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'entity_tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'entity_tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $response = array( + $response = [ 'tag' => '', 'weak' => FALSE, - ); + ]; if (is_null($entity_tag)) { @@ -2382,7 +2382,7 @@ class c_base_http extends c_base_rfc_string { unset($hash); unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -2393,7 +2393,7 @@ class c_base_http extends c_base_rfc_string { unset($hash); unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } } @@ -2447,7 +2447,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_expires($timestamp) { if (!is_int($timestamp) && !is_float($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2469,7 +2469,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_last_modified($timestamp) { if (!is_int($timestamp) && !is_float($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2510,22 +2510,22 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_link($uri, $parameter_name = NULL, $parameter_value = NULL, $append = TRUE) { if (!is_string($uri)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_name) && !is_string($parameter_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_value) && !is_string($parameter_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2544,7 +2544,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2554,7 +2554,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed_uri['invalid']) { unset($parsed_uri); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'link uri', ':{expected_format}' => '(uri)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'link uri', ':{expected_format}' => '(uri)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_uri['invalid']); @@ -2563,13 +2563,13 @@ class c_base_http extends c_base_rfc_string { // when append is FALSE and there is no parameter name, then assign url instead of appending url. if (!$append && is_null($parameter_name)) { if (!isset($this->response[static::RESPONSE_LINK])) { - $this->response[static::RESPONSE_LINK] = array(); + $this->response[static::RESPONSE_LINK] = []; } - $this->response[static::RESPONSE_LINK][$uri] = array( + $this->response[static::RESPONSE_LINK][$uri] = [ 'uri' => $parsed_uri, - 'parameters' => array(), - ); + 'parameters' => [], + ]; unset($parsed_uri); return new c_base_return_true(); @@ -2582,14 +2582,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_parameter_name === FALSE) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'link parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'link parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_parameter_name)) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -2601,7 +2601,7 @@ class c_base_http extends c_base_rfc_string { unset($text); unset($parsed_uri); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2612,7 +2612,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_parameter_value); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'content disposition parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'content disposition parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_parameter_value['invalid']); @@ -2624,14 +2624,14 @@ class c_base_http extends c_base_rfc_string { if (!isset($this->response[static::RESPONSE_LINK])) { - $this->response[static::RESPONSE_LINK] = array(); + $this->response[static::RESPONSE_LINK] = []; } if (!array_key_exists($uri, $this->response[static::RESPONSE_LINK])) { - $this->response[static::RESPONSE_LINK][$uri] = array( + $this->response[static::RESPONSE_LINK][$uri] = [ 'uri' => $parsed_uri, - 'parameters' => array() - ); + 'parameters' => [] + ]; } unset($parsed_uri); @@ -2640,7 +2640,7 @@ class c_base_http extends c_base_rfc_string { $this->response[static::RESPONSE_LINK][$uri]['parameters'][$prepared_parameter_name] = $parsed_parameter_value['text']; } else { - $this->response[static::RESPONSE_LINK][$uri]['parameters'] = array($prepared_parameter_name => $parsed_parameter_value['text']); + $this->response[static::RESPONSE_LINK][$uri]['parameters'] = [$prepared_parameter_name => $parsed_parameter_value['text']]; } } unset($prepared_parameter_name); @@ -2666,7 +2666,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_location($uri) { if (!is_string($uri) && !is_array($uri)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2676,7 +2676,7 @@ class c_base_http extends c_base_rfc_string { unset($parts); unset($combined); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'URI or URL', ':{expected_format}' => 'URI or URL', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'URI or URL', ':{expected_format}' => 'URI or URL', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($combined); @@ -2689,7 +2689,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2698,7 +2698,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed['invalid']) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'uri', ':{expected_format}' => NULL, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'uri', ':{expected_format}' => NULL, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed['invalid']); @@ -2736,17 +2736,17 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_pragma($parameter_name, $parameter_value = NULL, $append = TRUE) { if (!is_string($parameter_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_value) && !is_string($parameter_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2757,14 +2757,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_parameter_name === FALSE) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'pragma parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'pragma parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_parameter_name)) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -2774,7 +2774,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2785,7 +2785,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_parameter_value); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'pragma parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'pragma parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_parameter_value['invalid']); @@ -2797,13 +2797,13 @@ class c_base_http extends c_base_rfc_string { if ($append) { if (!isset($this->response[static::RESPONSE_PRAGMA])) { - $this->response[static::RESPONSE_PRAGMA] = array(); + $this->response[static::RESPONSE_PRAGMA] = []; } $this->response[static::RESPONSE_PRAGMA][$prepared_parameter_name] = $parsed_parameter_value['text']; } else { - $this->response[static::RESPONSE_PRAGMA] = array($prepared_parameter_name => $parsed_parameter_value['text']); + $this->response[static::RESPONSE_PRAGMA] = [$prepared_parameter_name => $parsed_parameter_value['text']]; } unset($prepared_parameter_name); unset($parsed_parameter_value); @@ -2826,7 +2826,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_proxy_authenticate($value) { // @todo: self::RESPONSE_PROXY_AUTHENTICATE - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response proxy authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response proxy authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2845,7 +2845,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_public_key_pins($value) { // @todo: self::RESPONSE_PUBLIC_KEY_PINS - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response public key pins', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response public key pins', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2870,7 +2870,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_refresh($value) { // @todo: self::RESPONSE_REFRESH - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response refresh', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response refresh', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2892,20 +2892,20 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_retry_after($date, $seconds = FALSE) { if (!is_int($date)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($seconds)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_RETRY_AFTER] = array( + $this->response[static::RESPONSE_RETRY_AFTER] = [ 'value' => $date, 'is_seconds' => $seconds, - ); + ]; return new c_base_return_true(); } @@ -2925,7 +2925,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_server($value) { // @todo: self::RESPONSE_SERVER - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response server', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response server', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2950,12 +2950,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_set_cookie($cookie, $append = TRUE) { if (!($cookie instanceof c_base_cookie)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2963,13 +2963,13 @@ class c_base_http extends c_base_rfc_string { $cookie_name = $cookie->get_name()->get_value_exact(); if ($append) { if (!isset($this->response[static::RESPONSE_SET_COOKIE]) || !is_array($this->response[static::RESPONSE_SET_COOKIE])) { - $this->response[static::RESPONSE_SET_COOKIE] = array(); + $this->response[static::RESPONSE_SET_COOKIE] = []; } $this->response[static::RESPONSE_SET_COOKIE][$cookie_name] = clone($cookie); } else { - $this->response[static::RESPONSE_SET_COOKIE] = array($cookie_name => clone($cookie)); + $this->response[static::RESPONSE_SET_COOKIE] = [$cookie_name => clone($cookie)]; } unset($cookie_name); @@ -2991,7 +2991,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_status($code) { if (!is_int($code)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3012,7 +3012,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_strict_transport_security($value) { // @todo: self::RESPONSE_STRICT_SECURITY_TRANSPORT - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response strict transport security', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response strict transport security', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3029,7 +3029,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_trailer($value) { // @todo: self::RESPONSE_TRAILER - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response trailer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response trailer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3060,7 +3060,7 @@ class c_base_http extends c_base_rfc_string { // @todo: self::RESPONSE_TRANSFER_ENCODING - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response transfer encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response transfer encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3077,7 +3077,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_upgrade($value) { // @todo: self::RESPONSE_UPGRADE - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response upgrade', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response upgrade', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3098,12 +3098,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_vary($header_name, $append = TRUE) { if (!is_string($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3111,19 +3111,19 @@ class c_base_http extends c_base_rfc_string { $prepared_token = $this->p_prepare_token($header_name, FALSE); if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } if ($append) { if (!isset($this->response[static::RESPONSE_VARY]) || !is_array($this->response[static::RESPONSE_VARY])) { - $this->response[static::RESPONSE_VARY] = array(); + $this->response[static::RESPONSE_VARY] = []; } $this->response[static::RESPONSE_VARY][$prepared_token] = $prepared_token; } else { - $this->response[static::RESPONSE_VARY] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_VARY] = [$prepared_token => $prepared_token]; } unset($prepared_token); @@ -3145,7 +3145,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_warning($value) { // @todo: self::RESPONSE_WARNING - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response warning', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response warning', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3164,7 +3164,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_www_authenticate($value) { // @todo: self::RESPONSE_WWW_AUTHENTICATE - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response www authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response www authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3180,7 +3180,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_protocol($protocol) { if (!is_string($protocol)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'protocol', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'protocol', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3218,17 +3218,17 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_security_policy($policy_name, $policy_value, $append = TRUE) { if (!is_string($policy_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'policy_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'policy_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($policy_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'policy_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'policy_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3237,7 +3237,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3248,7 +3248,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_policy_name); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'policy name', ':{expected_format}' => '1*((alpha) | (digit) | '-')', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'policy name', ':{expected_format}' => '1*((alpha) | (digit) | '-')', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_policy_name['invalid']); @@ -3259,7 +3259,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3270,7 +3270,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_policy_value); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'policy value', ':{expected_format}' => '1*(vchar, except \';\' and \',\')', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'policy value', ':{expected_format}' => '1*(vchar, except \';\' and \',\')', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_policy_value['invalid']); @@ -3279,15 +3279,15 @@ class c_base_http extends c_base_rfc_string { if ($append) { if (!isset($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY]) || !is_array($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY])) { - $this->response[static::RESPONSE_CONTENT_SECURITY_POLICY] = array( - $parsed_policy_name['text'] => array(), - ); + $this->response[static::RESPONSE_CONTENT_SECURITY_POLICY] = [ + $parsed_policy_name['text'] => [], + ]; } $this->response[static::RESPONSE_CONTENT_SECURITY_POLICY][$parsed_policy_name['text']][] = $parsed_policy_value['text']; } else { - $this->response[static::RESPONSE_CONTENT_SECURITY_POLICY] = array($parsed_policy_name['text'] => array($parsed_policy_value['text'])); + $this->response[static::RESPONSE_CONTENT_SECURITY_POLICY] = [$parsed_policy_name['text'] => [$parsed_policy_value['text']]]; } unset($parsed_policy_name); unset($parsed_policy_value); @@ -3305,7 +3305,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_x_content_type_options($no_sniff) { if (!is_bool($no_sniff)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'no_sniff', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'no_sniff', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3331,12 +3331,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_x_ua_compatible($browser_name, $compatible_version) { if (!is_string($parameter_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($compatible_version) && !is_string($compatible_version)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'compatible_version', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'compatible_version', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3345,14 +3345,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_browser_name === FALSE) { unset($prepared_browser_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'browser name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'browser name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_browser_name)) { unset($prepared_browser_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'browser_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'browser_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3372,26 +3372,26 @@ class c_base_http extends c_base_rfc_string { if ($prepared_compatible_version === FALSE) { unset($prepared_compatible_version); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'browser name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'browser name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_compatible_version)) { unset($prepared_compatible_version); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'compatible_version', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'compatible_version', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($append) { if (!isset($this->response[static::RESPONSE_X_UA_COMPATIBLE])) { - $this->response[static::RESPONSE_X_UA_COMPATIBLE] = array(); + $this->response[static::RESPONSE_X_UA_COMPATIBLE] = []; } $this->response[static::RESPONSE_X_UA_COMPATIBLE][$prepared_browser_name] = $parsed_compatible_version['text']; } else { - $this->response[static::RESPONSE_X_UA_COMPATIBLE] = array($prepared_browser_name => $parsed_compatible_version['text']); + $this->response[static::RESPONSE_X_UA_COMPATIBLE] = [$prepared_browser_name => $parsed_compatible_version['text']]; } unset($prepared_browser_name); unset($parsed_compatible_version); @@ -3434,33 +3434,33 @@ class c_base_http extends c_base_rfc_string { $action = static::CHECKSUM_ACTION_AUTO; } elseif (!is_int($action)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($action != static::CHECKSUM_ACTION_NONE && $action != static::CHECKSUM_ACTION_AUTO && $action != static::CHECKSUM_ACTION_MANUAL) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($action == static::CHECKSUM_ACTION_MANUAL) { if (!is_int($what)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($checksum)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($what != static::CHECKSUM_WHAT_PARTIAL && $what != static::CHECKSUM_WHAT_FULL) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3478,40 +3478,40 @@ class c_base_http extends c_base_rfc_string { case CHECKSUM_PG: break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_CHECKSUM_HEADER] = array( + $this->response[static::RESPONSE_CHECKSUM_HEADER] = [ 'checksum' => $checksum, 'action' => $action, 'what' => $what, 'type' => $type, - ); + ]; } else { if (!is_null($what) && !is_int($what)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($type) && !is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($action) && !is_int($action)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_CHECKSUM_HEADER] = array( + $this->response[static::RESPONSE_CHECKSUM_HEADER] = [ 'checksum' => NULL, 'action' => $action, 'what' => static::CHECKSUM_WHAT_FULL, 'type' => static::CHECKSUM_SHA256, - ); + ]; if (!is_null($what)) { $this->response[static::RESPONSE_CHECKSUM_HEADER]['what'] = $what; @@ -3543,12 +3543,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_checksum_headers($header_name, $append = TRUE) { if (!is_string($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3556,19 +3556,19 @@ class c_base_http extends c_base_rfc_string { $prepared_token = $this->p_prepare_token($header_name); if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } if ($append) { if (!isset($this->response[static::RESPONSE_CHECKSUM_HEADERS]) || !is_array($this->response[static::RESPONSE_CHECKSUM_HEADERS])) { - $this->response[static::RESPONSE_CHECKSUM_HEADERS] = array(); + $this->response[static::RESPONSE_CHECKSUM_HEADERS] = []; } $this->response[static::RESPONSE_CHECKSUM_HEADERS][$prepared_token] = $prepared_token; } else { - $this->response[static::RESPONSE_CHECKSUM_HEADERS] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_CHECKSUM_HEADERS] = [$prepared_token => $prepared_token]; } unset($prepared_token); @@ -3609,33 +3609,33 @@ class c_base_http extends c_base_rfc_string { $action = static::CHECKSUM_ACTION_AUTO; } else if (!is_int($action)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($action != static::CHECKSUM_ACTION_NONE && $action != static::CHECKSUM_ACTION_AUTO && $action != static::CHECKSUM_ACTION_MANUAL) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($action == static::CHECKSUM_ACTION_MANUAL) { if (!is_int($what)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($checksum)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($what != static::CHECKSUM_WHAT_PARTIAL && $what != static::CHECKSUM_WHAT_FULL) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3653,39 +3653,39 @@ class c_base_http extends c_base_rfc_string { case CHECKSUM_PG: break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_CHECKSUM_CONTENT] = array( + $this->response[static::RESPONSE_CHECKSUM_CONTENT] = [ 'checksum' => $checksum, 'action' => $action, 'what' => $what, 'type' => $type, - ); + ]; } else { if (!is_null($what) && !is_int($what)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($type) && !is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($action)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->response[static::RESPONSE_CHECKSUM_CONTENT] = array( + $this->response[static::RESPONSE_CHECKSUM_CONTENT] = [ 'checksum' => NULL, 'action' => $action, 'what' => static::CHECKSUM_WHAT_FULL, 'type' => static::CHECKSUM_SHA256, - ); + ]; if (!is_null($what)) { $this->response[static::RESPONSE_CHECKSUM_HEADER]['what'] = $what; @@ -3713,7 +3713,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_revision($revision) { if (!is_int($revision)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'revision', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'revision', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3734,7 +3734,7 @@ class c_base_http extends c_base_rfc_string { */ public function unset_response_value($response_id) { if (!is_int($response_id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'response_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'response_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3759,8 +3759,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_access_control_allow_origin() { if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN]); @@ -3780,7 +3780,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_access_control_allow_credentials() { if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(FALSE, 'c_base_return_bool', $error); } @@ -3800,8 +3800,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_access_control_expose_headers() { if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS]); @@ -3820,7 +3820,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_access_control_max_age() { if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_MAX_AGE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_MAX_AGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ACCESS_CONTROL_MAX_AGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -3839,8 +3839,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_access_control_allow_methods() { if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS]); @@ -3859,8 +3859,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_access_control_allow_headers() { if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS]); @@ -3879,8 +3879,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_accept_patch() { if (!array_key_exists(static::RESPONSE_ACCEPT_PATCH, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCEPT_PATCH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ACCEPT_PATCH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_ACCEPT_PATCH]); @@ -3903,7 +3903,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_accept_ranges() { if (!array_key_exists(static::RESPONSE_ACCEPT_RANGES, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCEPT_RANGES, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ACCEPT_RANGES, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -3921,7 +3921,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_age() { if (!array_key_exists(static::RESPONSE_AGE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_AGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_AGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -3939,8 +3939,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_allow() { if (!array_key_exists(static::RESPONSE_ALLOW, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ALLOW, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ALLOW, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_ALLOW]); @@ -3962,9 +3962,9 @@ class c_base_http extends c_base_rfc_string { * An array containing the cache-control directives. * Each array key is a name and if that directive has no value, then the related directive name will have a NULL value. * For example, a directive of "no-cache" will have the following array structure: - * - array("no-cache" => NULL) + * - ["no-cache" => NULL] * For example, a directive of "private, max-age=32" will have the following array structure: - * - array("private" => NULL, "max-age" => 32) + * - ["private" => NULL, "max-age" => 32] * * An empty array with error bit set is returned on error, including when the key is not defined. * @@ -3973,8 +3973,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_cache_control() { if (!array_key_exists(static::RESPONSE_CACHE_CONTROL, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CACHE_CONTROL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CACHE_CONTROL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CACHE_CONTROL]); @@ -3994,8 +3994,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_connection() { if (!array_key_exists(static::RESPONSE_CONNECTION, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONNECTION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONNECTION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CONNECTION]); @@ -4012,8 +4012,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_content_disposition() { if (!array_key_exists(static::RESPONSE_CONTENT_DISPOSITION, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_DISPOSITION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONTENT_DISPOSITION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_DISPOSITION]); @@ -4028,8 +4028,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_content_encoding() { if (!array_key_exists(static::RESPONSE_CONTENT_ENCODING, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_ENCODING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONTENT_ENCODING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_ENCODING]); @@ -4046,8 +4046,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_content_language() { if (!array_key_exists(static::RESPONSE_CONTENT_LANGUAGE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_LANGUAGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONTENT_LANGUAGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_LANGUAGE]); @@ -4064,7 +4064,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_content_length() { if (!array_key_exists(static::RESPONSE_CONTENT_LENGTH, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_LENGTH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONTENT_LENGTH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -4090,8 +4090,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_content_range() { if (!array_key_exists(static::RESPONSE_CONTENT_RANGE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_RANGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONTENT_RANGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_RANGE]); @@ -4110,8 +4110,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_content_type() { if (!array_key_exists(static::RESPONSE_CONTENT_TYPE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_TYPE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONTENT_TYPE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_TYPE]); @@ -4128,7 +4128,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_date() { if (!array_key_exists(static::RESPONSE_DATE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_DATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_DATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -4154,7 +4154,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_date_actual() { if (!array_key_exists(static::RESPONSE_DATE_ACTUAL, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_DATE_ACTUAL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_DATE_ACTUAL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -4178,8 +4178,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_etag() { if (!array_key_exists(static::RESPONSE_ETAG, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ETAG, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_ETAG, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_ETAG]); @@ -4196,7 +4196,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_expires() { if (!array_key_exists(static::RESPONSE_EXPIRES, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_EXPIRES, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_EXPIRES, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -4218,7 +4218,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_last_modified() { if (!array_key_exists(static::RESPONSE_LAST_MODIFIED, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_LAST_MODIFIED, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_LAST_MODIFIED, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -4243,8 +4243,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_link() { if (!array_key_exists(static::RESPONSE_LINK, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_LINK, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_LINK, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_LINK]); @@ -4263,8 +4263,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_location() { if (!array_key_exists(static::RESPONSE_LOCATION, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_LOCATION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_LOCATION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_LOCATION]); @@ -4282,8 +4282,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_pragma() { if (!array_key_exists(static::RESPONSE_PRAGMA, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_PRAGMA, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_PRAGMA, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_PRAGMA]); @@ -4302,13 +4302,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_proxy_authenticate() { if (!array_key_exists(static::RESPONSE_PROXY_AUTHENTICATE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_PROXY_AUTHENTICATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_PROXY_AUTHENTICATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response proxy authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response proxy authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4325,13 +4325,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_public_key_pins() { if (!array_key_exists(static::RESPONSE_PUBLIC_KEY_PINS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_PUBLIC_KEY_PINS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_PUBLIC_KEY_PINS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response public key pins', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response public key pins', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4351,13 +4351,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_refresh() { if (!array_key_exists(static::RESPONSE_REFRESH, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_REFRESH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_REFRESH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response refresh', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response refresh', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4375,8 +4375,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_retry_after() { if (!array_key_exists(static::RESPONSE_RETRY_AFTER, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_RETRY_AFTER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_RETRY_AFTER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_RETRY_AFTER]); @@ -4393,8 +4393,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_set_cookie() { if (!array_key_exists(static::RESPONSE_SET_COOKIE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_SET_COOKIE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_cookie', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_SET_COOKIE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_cookie', $error); } return $this->response[static::RESPONSE_SET_COOKIE]; @@ -4410,13 +4410,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_server() { if (!array_key_exists(static::RESPONSE_SERVER, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_SERVER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_SERVER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response server', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response server', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4431,7 +4431,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_status() { if (!array_key_exists(static::RESPONSE_STATUS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_STATUS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_STATUS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -4449,13 +4449,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_strict_transport_security() { if (!array_key_exists(static::RESPONSE_STRICT_TRANSPORT_SECURITY, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_STRICT_TRANSPORT_SECURITY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_STRICT_TRANSPORT_SECURITY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value('', 'c_base_return_string', $error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response strict transport security', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response strict transport security', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4475,13 +4475,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_trailer() { if (!array_key_exists(static::RESPONSE_TRAILER, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_TRAILER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_TRAILER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response trailer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response trailer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4496,13 +4496,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_transfer_encoding() { if (!array_key_exists(static::RESPONSE_TRANSFER_ENCODING, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_TRANSFER_ENCODING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_TRANSFER_ENCODING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response transfer encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response transfer encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4516,13 +4516,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_upgrade() { if (!array_key_exists(static::RESPONSE_UPGRADE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_UPGRADE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_UPGRADE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response upgrade', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response upgrade', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4537,8 +4537,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_vary() { if (!array_key_exists(static::RESPONSE_VARY, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_VARY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_VARY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_VARY]); @@ -4555,13 +4555,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_warning() { if (!array_key_exists(static::RESPONSE_WARNING, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_WARNING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_WARNING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response warning', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response warning', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4576,13 +4576,13 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_www_authenticate() { if (!array_key_exists(static::RESPONSE_WWW_AUTHENTICATE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_WWW_AUTHENTICATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_WWW_AUTHENTICATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response www authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{functionality_name}' => 'http response www authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4595,7 +4595,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_protocol() { if (!array_key_exists(static::RESPONSE_PROTOCOL, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_PROTOCOL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_PROTOCOL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -4615,8 +4615,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_content_security_policy() { if (!array_key_exists(static::RESPONSE_CONTENT_SECURITY_POLICY, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_SECURITY_POLICY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONTENT_SECURITY_POLICY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY]); @@ -4631,7 +4631,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_x_content_type_options() { if (!array_key_exists(static::RESPONSE_X_CONTENT_TYPE_OPTIONS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_X_CONTENT_TYPE_OPTIONS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_X_CONTENT_TYPE_OPTIONS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(FALSE, 'c_base_return_bool', $error); } @@ -4647,8 +4647,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_x_ua_compatible() { if (!array_key_exists(static::RESPONSE_X_UA_COMPATIBLE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_X_UA_COMPATIBLE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_X_UA_COMPATIBLE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_X_UA_COMPATIBLE]); @@ -4669,8 +4669,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_checksum_header() { if (!array_key_exists(static::RESPONSE_CHECKSUM_HEADER, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CHECKSUM_HEADER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CHECKSUM_HEADER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CHECKSUM_HEADER]); @@ -4685,8 +4685,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_checksum_headers() { if (!array_key_exists(static::RESPONSE_CHECKSUM_HEADERS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CHECKSUM_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CHECKSUM_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CHECKSUM_HEADERS]); @@ -4705,8 +4705,8 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_checksum_content() { if (!array_key_exists(static::RESPONSE_CHECKSUM_CONTENT, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CHECKSUM_CONTENT, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CHECKSUM_CONTENT, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($this->response[static::RESPONSE_CHECKSUM_CONTENT]); @@ -4721,7 +4721,7 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_content_revision() { if (!array_key_exists(static::RESPONSE_CONTENT_REVISION, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_REVISION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => static::RESPONSE_CONTENT_REVISION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -4792,18 +4792,18 @@ class c_base_http extends c_base_rfc_string { */ public function send_response_headers($shuffle = TRUE) { if (!is_bool($shuffle)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'shuffle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'shuffle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($this->headers_sent || headers_sent()) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'headers_sent()', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_UNECESSARY); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'headers_sent()', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_UNECESSARY); return c_base_return_error::s_false($error); } if ($shuffle) { - $headers = array(); + $headers = []; // shuffle() alters the array keys, so some additional processing must be done to protect the array keys. $shuffled = array_flip($this->p_get_header_response_mapping()); @@ -4822,7 +4822,7 @@ class c_base_http extends c_base_rfc_string { } // this is used to create header and still perform checksums against. - $header_output = array(); + $header_output = []; $header_id_to_names = $this->p_get_header_response_mapping(TRUE); @@ -5024,12 +5024,12 @@ class c_base_http extends c_base_rfc_string { */ public function encode_response_content($compression = NULL, $max_filesize = NULL) { if (!is_null($compression) && !is_int($compression)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'compression', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'compression', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($max_filesize) && !(is_int($max_filesize) && $max_filesize > 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'max_filesize', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'max_filesize', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -5050,7 +5050,7 @@ class c_base_http extends c_base_rfc_string { unset($filename); unset($content); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -5077,7 +5077,7 @@ class c_base_http extends c_base_rfc_string { unset($filename); unset($content); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -5132,7 +5132,7 @@ class c_base_http extends c_base_rfc_string { if (!file_exists($filename)) { unset($filename); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -5140,7 +5140,7 @@ class c_base_http extends c_base_rfc_string { if ($opened_file === FALSE) { unset($filename); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -5174,7 +5174,7 @@ class c_base_http extends c_base_rfc_string { */ public function sanitize_path($path) { if (!is_string($path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -5244,9 +5244,9 @@ class c_base_http extends c_base_rfc_string { $this->request[static::REQUEST_ACCEPT]['defined'] = TRUE; $this->request[static::REQUEST_ACCEPT]['data']['accept'] = NULL; $this->request[static::REQUEST_ACCEPT]['data']['category'] = NULL; - $this->request[static::REQUEST_ACCEPT]['data']['weight'] = array(); - $this->request[static::REQUEST_ACCEPT]['data']['types'] = array(); - #$this->request[static::REQUEST_ACCEPT]['data']['categories'] = array(); + $this->request[static::REQUEST_ACCEPT]['data']['weight'] = []; + $this->request[static::REQUEST_ACCEPT]['data']['types'] = []; + #$this->request[static::REQUEST_ACCEPT]['data']['categories'] = []; // convert the known values into integers for improved processing. foreach ($this->request[static::REQUEST_ACCEPT]['data']['choices'] as $weight => &$choice) { @@ -5324,7 +5324,7 @@ class c_base_http extends c_base_rfc_string { } else { $this->request[static::REQUEST_ACCEPT_LANGUAGE]['defined'] = TRUE; - $this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight'] = array(); + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight'] = []; // convert the known values into integers for improved processing. foreach ($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['choices'] as $weight => &$choice) { @@ -5384,7 +5384,7 @@ class c_base_http extends c_base_rfc_string { } else { $this->request[static::REQUEST_ACCEPT_ENCODING]['defined'] = TRUE; - $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'] = array(); + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'] = []; // convert the known values into integers for improved processing. foreach ($this->request[static::REQUEST_ACCEPT_ENCODING]['data']['choices'] as $weight => &$choice) { @@ -5495,7 +5495,7 @@ class c_base_http extends c_base_rfc_string { } else { $this->request[static::REQUEST_ACCEPT_CHARSET]['defined'] = TRUE; - $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'] = array(); + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'] = []; // convert the known values into integers for improved processing. foreach ($this->request[static::REQUEST_ACCEPT_CHARSET]['data']['choices'] as $weight => &$choice) { @@ -5665,7 +5665,7 @@ class c_base_http extends c_base_rfc_string { return; } - $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'] = array(); + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'] = []; foreach ($methods as $method) { switch ($method) { @@ -5822,15 +5822,15 @@ class c_base_http extends c_base_rfc_string { return; } - $this->request[static::REQUEST_CACHE_CONTROL]['data'] = array( - 'methods' => array(), - ); + $this->request[static::REQUEST_CACHE_CONTROL]['data'] = [ + 'methods' => [], + ]; - $integer_types = array( + $integer_types = [ SELF::CACHE_CONTROL_MAX_AGE => 'max-age=', SELF::CACHE_CONTROL_MAX_STALE => 'max-stale=', SELF::CACHE_CONTROL_MIN_FRESH => 'min-fresh=', - ); + ]; $parts = mb_split(', ', $cache_control); foreach ($parts as $part) { @@ -5960,7 +5960,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6265 */ private function p_load_request_cookies() { - $this->request[static::REQUEST_COOKIE]['data'] = array(); + $this->request[static::REQUEST_COOKIE]['data'] = []; foreach ($_COOKIE as $cookie_name => $cookie_values) { $cookie = new c_base_cookie(); @@ -6276,18 +6276,18 @@ class c_base_http extends c_base_rfc_string { $timestamp = strtotime($this->headers['if-range']); if ($timestamp === FALSE) { $this->request[static::REQUEST_IF_RANGE]['invalid'] = TRUE; - $this->request[static::REQUEST_IF_RANGE]['data'] = array( + $this->request[static::REQUEST_IF_RANGE]['data'] = [ 'is_date' => TRUE, - ); + ]; unset($timestamp); return; } $this->request[static::REQUEST_IF_RANGE]['defined'] = TRUE; - $this->request[static::REQUEST_IF_RANGE]['data'] = array( + $this->request[static::REQUEST_IF_RANGE]['data'] = [ 'range' => $timestamp, 'is_date' => TRUE, - ); + ]; unset($timestamp); return; @@ -7234,11 +7234,11 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7232 */ private function p_parse_if_entity_tag($match) { - $result = array( - 'matches' => array(), + $result = [ + 'matches' => [], 'any' => FALSE, 'invalid' => FALSE, - ); + ]; $stop = self::p_length_string($match) + 1; if ($stop == 0) { @@ -7327,12 +7327,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7232 */ private function p_parse_if_entity_tag_and_weak($match) { - $result = array( - 'matches' => array(), - 'weak' => array(), + $result = [ + 'matches' => [], + 'weak' => [], 'any' => FALSE, 'invalid' => FALSE, - ); + ]; $stop = self::p_length_string($match); if ($stop == 0) { @@ -7471,7 +7471,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7232 */ private function p_parse_user_agent($agent) { - $result = array( + $result = [ 'full' => $agent, 'name_machine' => NULL, 'name_human' => NULL, @@ -7482,9 +7482,9 @@ class c_base_http extends c_base_rfc_string { 'is_ie_edge' => FALSE, 'is_ie_compatibility' => FALSE, 'invalid' => FALSE, - ); + ]; - $agent_matches = array(); + $agent_matches = []; $agent_matched = preg_match('/^[^(]*\(([^)]*)\)(.*)$/iu', $agent, $agent_matches); if (!$agent_matched) { @@ -7847,7 +7847,7 @@ class c_base_http extends c_base_rfc_string { // if the agent wasn't identified, check to see if this is a bot or a known command line tool. if (is_null($result['engine_name_machine'])) { - $agent_matches = array(); + $agent_matches = []; preg_match('/^([^(]+)/iu', $agent, $agent_matches); if (isset($agent_matches[0])) { @@ -7965,12 +7965,12 @@ class c_base_http extends c_base_rfc_string { * - 'invalid': a boolean representing whether or not this string is valid or if an error occurred. */ private function p_parse_checksum($checksum) { - $result = array( + $result = [ 'what' => NULL, 'type' => NULL, 'checksum' => NULL, 'invalid' => FALSE, - ); + ]; $fixed_checksum = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', $checksum))->get_value_exact(); if (empty($fixed_checksum)) { @@ -8123,13 +8123,13 @@ class c_base_http extends c_base_rfc_string { * - 'invalid': a boolean representing whether or not this string is valid or if an error occurred. */ private function p_parse_checksum_headers($checksum_headers) { - $result = array( - 'headers' => array( - 'known' => array(), - 'unknown' => array(), - ), + $result = [ + 'headers' => [ + 'known' => [], + 'unknown' => [], + ], 'invalid' => FALSE, - ); + ]; $fixed_checksum = c_base_utf8::s_lowercase(preg_replace("/(^( |\t)+)|(( |\t)+$)/us", '', $checksum_headers))->get_value_exact(); if (empty($fixed_checksum)) { @@ -8227,7 +8227,7 @@ class c_base_http extends c_base_rfc_string { * - This will then appear in $_SERVER. */ private function p_get_all_headers() { - $this->headers = array(); + $this->headers = []; // this works with apache. if (function_exists('getallheaders')) { @@ -8291,7 +8291,7 @@ class c_base_http extends c_base_rfc_string { * An array for mapping HTTP request header strings to header ids. */ private function p_get_header_request_mapping() { - return array( + return [ 'accept' => static::REQUEST_ACCEPT, 'accept-charset' => static::REQUEST_ACCEPT_CHARSET, 'accept-encoding' => static::REQUEST_ACCEPT_ENCODING, @@ -8332,7 +8332,7 @@ class c_base_http extends c_base_rfc_string { 'checksum_header' => static::REQUEST_CHECKSUM_HEADER, 'checksum_headers' => static::REQUEST_CHECKSUM_HEADERS, 'checksum_content' => static::REQUEST_CHECKSUM_CONTENT, - ); + ]; } /** @@ -8350,7 +8350,7 @@ class c_base_http extends c_base_rfc_string { */ private function p_get_header_response_mapping($case_first = FALSE) { if ($case_first) { - return array( + return [ static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN => 'Access-Control-Allow-Origin', static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS => 'Access-Control-Allow-Credentials', static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS => 'Access-Control-Expose-Headers', @@ -8399,10 +8399,10 @@ class c_base_http extends c_base_rfc_string { static::RESPONSE_WWW_AUTHENTICATE => 'Www-Authenticate', static::RESPONSE_X_CONTENT_TYPE_OPTIONS => 'X-Content-Type-Options', static::RESPONSE_X_UA_COMPATIBLE => 'X-UA-Compatible', - ); + ]; } - return array( + return [ static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN => 'access-control-allow-origin', static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS => 'access-control-allow-credentials', static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS => 'access-control-expose-headers', @@ -8451,7 +8451,7 @@ class c_base_http extends c_base_rfc_string { static::RESPONSE_WWW_AUTHENTICATE => 'www-authenticate', static::RESPONSE_X_CONTENT_TYPE_OPTIONS => 'x-content-type-options', static::RESPONSE_X_UA_COMPATIBLE => 'x-ua-compatible', - ); + ]; } /** @@ -8461,7 +8461,7 @@ class c_base_http extends c_base_rfc_string { * An array for mapping HTTP response header strings to header ids. */ private function p_get_http_method_mapping() { - return array( + return [ 'get' => static::HTTP_METHOD_GET, 'head' => static::HTTP_METHOD_HEAD, 'post' => static::HTTP_METHOD_POST, @@ -8472,7 +8472,7 @@ class c_base_http extends c_base_rfc_string { 'connect' => static::HTTP_METHOD_CONNECT, 'patch' => static::HTTP_METHOD_PATCH, 'track' => static::HTTP_METHOD_TRACK, - ); + ]; } /** @@ -9385,7 +9385,7 @@ class c_base_http extends c_base_rfc_string { return; } - $header_output[static::RESPONSE_SET_COOKIE] = array(); + $header_output[static::RESPONSE_SET_COOKIE] = []; foreach ($this->response[static::RESPONSE_SET_COOKIE] as $cookie) { if (!($cookie instanceof c_base_cookie)) { continue; @@ -9656,7 +9656,7 @@ class c_base_http extends c_base_rfc_string { } // in this case, a new header is created for every single entry. - $header_output[static::RESPONSE_X_UA_COMPATIBLE] = array(); + $header_output[static::RESPONSE_X_UA_COMPATIBLE] = []; foreach($this->response[static::RESPONSE_X_UA_COMPATIBLE] as $browser_name => $compatible_version) { $header_output[static::RESPONSE_X_UA_COMPATIBLE][] = $browser_name . '=' . $compatible_version; } @@ -9685,12 +9685,12 @@ class c_base_http extends c_base_rfc_string { private function p_prepare_header_response_checksum_content($header_name, &$header_output) { // this field is generally auto-populated, so enforce a default. if (!isset($this->response[static::RESPONSE_CHECKSUM_CONTENT])) { - $this->response[static::RESPONSE_CHECKSUM_CONTENT] = array( + $this->response[static::RESPONSE_CHECKSUM_CONTENT] = [ 'checksum' => NULL, 'action' => static::CHECKSUM_ACTION_AUTO, 'what' => static::CHECKSUM_WHAT_FULL, 'type' => static::CHECKSUM_SHA256, - ); + ]; } // setting this to none manually disables checksum generation. @@ -9778,7 +9778,7 @@ class c_base_http extends c_base_rfc_string { unset($algorithm); unset($use_hash); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -9852,12 +9852,12 @@ class c_base_http extends c_base_rfc_string { private function p_prepare_header_response_checksum_header($headers_name, $header_name, &$header_output, $status_string) { // this field is generally auto-populated, so enforce a default. if (!isset($this->response[static::RESPONSE_CHECKSUM_HEADER])) { - $this->response[static::RESPONSE_CHECKSUM_HEADER] = array( + $this->response[static::RESPONSE_CHECKSUM_HEADER] = [ 'checksum' => NULL, 'action' => static::CHECKSUM_ACTION_AUTO, 'what' => static::CHECKSUM_WHAT_FULL, 'type' => static::CHECKSUM_SHA256, - ); + ]; } // setting this to none manually disables checksum generation. @@ -9867,8 +9867,8 @@ class c_base_http extends c_base_rfc_string { // allow for the list of headers to be customized, but if it is not defined, use all available (allowed) headers. if (array_key_exists(static::RESPONSE_CHECKSUM_HEADERS, $this->response)) { - $header_output_copy = array(); - $header_output[static::RESPONSE_CHECKSUM_HEADERS] = array(); + $header_output_copy = []; + $header_output[static::RESPONSE_CHECKSUM_HEADERS] = []; foreach ($this->response[static::RESPONSE_CHECKSUM_HEADERS] as $header_response_id => $header_response_value) { $header_output_copy[$header_response_id] = $header_response_id; $header_output[static::RESPONSE_CHECKSUM_HEADERS][$header_response_id] = $header_response_id; @@ -10201,7 +10201,7 @@ class c_base_http extends c_base_rfc_string { $this->content = gzencode($this->content, $compression, FORCE_GZIP); $this->content_is_file = FALSE; - $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = [$encoding]; if ($calculate_content_length) { $this->response[static::RESPONSE_CONTENT_LENGTH] = strlen($this->content); @@ -10219,7 +10219,7 @@ class c_base_http extends c_base_rfc_string { $this->content = gzencode($content, $compression, FORCE_DEFLATE); $this->content_is_file = FALSE; - $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = [$encoding]; if ($calculate_content_length) { $this->response[static::RESPONSE_CONTENT_LENGTH] = strlen($this->content); @@ -10237,7 +10237,7 @@ class c_base_http extends c_base_rfc_string { $this->content = bzcompress($content, $compression); $this->content_is_file = FALSE; - $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = [$encoding]; if ($calculate_content_length) { $this->response[static::RESPONSE_CONTENT_LENGTH] = strlen($this->content); @@ -10292,7 +10292,7 @@ class c_base_http extends c_base_rfc_string { $this->content = lzo_compress($content, $compression); $this->content_is_file = FALSE; - $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = [$encoding]; if ($calculate_content_length) { $this->response[static::RESPONSE_CONTENT_LENGTH] = strlen($this->content); diff --git a/common/base/classes/base_http_status.php b/common/base/classes/base_http_status.php index 6dbafcc..eb08840 100644 --- a/common/base/classes/base_http_status.php +++ b/common/base/classes/base_http_status.php @@ -99,7 +99,7 @@ class c_base_http_status { */ public static function to_text($status) { if (!is_int($status)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_languages.php b/common/base/classes/base_languages.php index d0b8ace..b66b9b6 100644 --- a/common/base/classes/base_languages.php +++ b/common/base/classes/base_languages.php @@ -645,30 +645,30 @@ interface i_base_languages { */ final class c_base_languages_us_only implements i_base_languages { - private static $s_aliases = array( - self::ENGLISH_US => array('en-us'), - self::ENGLISH => array('eng', 'en'), - self::UNDETERMINED => array('und'), - self::NOT_APPLICABLE => array('zxx'), - ); - - private static $s_names = array( - self::ENGLISH_US => array('US English'), - self::ENGLISH => array('English'), - self::UNDETERMINED => array('Undetermined'), - self::NOT_APPLICABLE => array('No Linguistic Content', 'Not Applicable'), - ); - - private static $s_ids = array( + private static $s_aliases = [ + self::ENGLISH_US => ['en-us'], + self::ENGLISH => ['eng', 'en'], + self::UNDETERMINED => ['und'], + self::NOT_APPLICABLE => ['zxx'], + ]; + + private static $s_names = [ + self::ENGLISH_US => ['US English'], + self::ENGLISH => ['English'], + self::UNDETERMINED => ['Undetermined'], + self::NOT_APPLICABLE => ['No Linguistic Content', 'Not Applicable'], + ]; + + private static $s_ids = [ 'en-us' => self::ENGLISH_US, 'eng' => self::ENGLISH, 'en' => self::ENGLISH, 'und' => self::UNDETERMINED, 'zxx' => self::NOT_APPLICABLE, - ); + ]; - private static $s_rtl_ids = array( - ); + private static $s_rtl_ids = [ + ]; /** @@ -676,8 +676,8 @@ final class c_base_languages_us_only implements i_base_languages { */ public static function s_get_names_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($id, self::$s_names)) { @@ -692,8 +692,8 @@ final class c_base_languages_us_only implements i_base_languages { */ public static function s_get_names_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($alias, self::$s_ids) && array_key_exists(self::$s_ids[$alias], self::$s_names)) { @@ -708,7 +708,7 @@ final class c_base_languages_us_only implements i_base_languages { */ public static function s_get_id_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -724,7 +724,7 @@ final class c_base_languages_us_only implements i_base_languages { */ public static function s_get_id_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -740,8 +740,8 @@ final class c_base_languages_us_only implements i_base_languages { */ public static function s_get_aliases_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($id, self::$s_aliases)) { @@ -756,8 +756,8 @@ final class c_base_languages_us_only implements i_base_languages { */ public static function s_get_aliases_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($name, self::$s_aliases)) { @@ -785,7 +785,7 @@ final class c_base_languages_us_only implements i_base_languages { * Implementation of s_get_ids(). */ public static function s_get_ids() { - $ids = array(); + $ids = []; foreach (self::$s_aliases as $key => $value) { $ids[$key] = $key; } @@ -828,37 +828,37 @@ final class c_base_languages_us_only implements i_base_languages { */ final class c_base_languages_limited implements i_base_languages { - private static $s_aliases = array( - self::ENGLISH_US => array('en-us'), - self::ENGLISH => array('eng', 'en'), - self::FRENCH => array('fre', 'fra', 'fr'), - self::GAELIC => array('gla', 'gd'), - self::IRISH => array('gle', 'ga'), - self::SPANISH => array('spa', 'es'), - self::INDONESIAN => array('ind', 'id'), - self::JAPANESE => array('jpn', 'ja'), - self::RUSSIAN => array('rus', 'ru'), - self::CHINESE => array('chi', 'zho', 'zh'), - self::UNDETERMINED => array('und'), - self::NOT_APPLICABLE => array('zxx'), - ); - - private static $s_names = array( - self::ENGLISH_US => array('US English'), - self::ENGLISH => array('English'), - self::FRENCH => array('French'), - self::GAELIC => array('Gaelic', 'Scottish Gaelic'), - self::IRISH => array('Irish'), - self::SPANISH => array('Spanish', 'Castilian'), - self::INDONESIAN => array('Indonesian'), - self::JAPANESE => array('Japanese'), - self::RUSSIAN => array('Russian'), - self::CHINESE => array('Chinese'), - self::UNDETERMINED => array('Undetermined'), - self::NOT_APPLICABLE => array('No Linguistic Content', 'Not Applicable'), - ); - - private static $s_ids = array( + private static $s_aliases = [ + self::ENGLISH_US => ['en-us'], + self::ENGLISH => ['eng', 'en'], + self::FRENCH => ['fre', 'fra', 'fr'], + self::GAELIC => ['gla', 'gd'], + self::IRISH => ['gle', 'ga'], + self::SPANISH => ['spa', 'es'], + self::INDONESIAN => ['ind', 'id'], + self::JAPANESE => ['jpn', 'ja'], + self::RUSSIAN => ['rus', 'ru'], + self::CHINESE => ['chi', 'zho', 'zh'], + self::UNDETERMINED => ['und'], + self::NOT_APPLICABLE => ['zxx'], + ]; + + private static $s_names = [ + self::ENGLISH_US => ['US English'], + self::ENGLISH => ['English'], + self::FRENCH => ['French'], + self::GAELIC => ['Gaelic', 'Scottish Gaelic'], + self::IRISH => ['Irish'], + self::SPANISH => ['Spanish', 'Castilian'], + self::INDONESIAN => ['Indonesian'], + self::JAPANESE => ['Japanese'], + self::RUSSIAN => ['Russian'], + self::CHINESE => ['Chinese'], + self::UNDETERMINED => ['Undetermined'], + self::NOT_APPLICABLE => ['No Linguistic Content', 'Not Applicable'], + ]; + + private static $s_ids = [ 'en-us' => self::ENGLISH_US, 'eng' => self::ENGLISH, 'en' => self::ENGLISH, @@ -882,11 +882,11 @@ final class c_base_languages_limited implements i_base_languages { 'zh' => self::CHINESE, 'und' => self::UNDETERMINED, 'zxx' => self::NOT_APPLICABLE, - ); + ]; - private static $s_rtl_ids = array( + private static $s_rtl_ids = [ // @todo: populate this with $id => $id. - ); + ]; /** @@ -894,8 +894,8 @@ final class c_base_languages_limited implements i_base_languages { */ public static function s_get_names_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($id, self::$s_names)) { @@ -910,8 +910,8 @@ final class c_base_languages_limited implements i_base_languages { */ public static function s_get_names_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($alias, self::$s_ids) && array_key_exists(self::$s_ids[$alias], self::$s_names)) { @@ -926,7 +926,7 @@ final class c_base_languages_limited implements i_base_languages { */ public static function s_get_id_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -942,7 +942,7 @@ final class c_base_languages_limited implements i_base_languages { */ public static function s_get_id_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -958,8 +958,8 @@ final class c_base_languages_limited implements i_base_languages { */ public static function s_get_aliases_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($id, self::$s_aliases)) { @@ -974,8 +974,8 @@ final class c_base_languages_limited implements i_base_languages { */ public static function s_get_aliases_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($name, self::$s_aliases)) { @@ -1003,7 +1003,7 @@ final class c_base_languages_limited implements i_base_languages { * Implementation of s_get_ids(). */ public static function s_get_ids() { - $ids = array(); + $ids = []; foreach (self::$s_aliases as $key => $value) { $ids[$key] = $key; } @@ -1046,989 +1046,989 @@ final class c_base_languages_limited implements i_base_languages { */ final class c_base_languages_all implements i_base_languages { - private static $s_aliases = array( - self::ENGLISH_US => array('en-us'), - self::ENGLISH => array('eng', 'en'), - self::ENGLISH_CA => array('en-ca'), - self::ENGLISH_GB => array('en-gb'), - self::AFAR => array('aar', 'aa'), - self::ABKHAZIAN => array('abk', 'ab'), - self::ACHINESE => array('ace'), - self::ACOLI => array('ach'), - self::ADANGME => array('ada'), - self::ADYGHE => array('ady'), - self::AFRO_ASIATIC => array('afa'), - self::AFRIHILI => array('afh'), - self::AFRIKAANS => array('afr', 'af'), - self::AINU => array('ain'), - self::AKAN => array('aka', 'ak'), - self::AKKADIAN => array('akk'), - self::ALBANIAN => array('alb', 'sqi', 'sq'), - self::ALEUT => array('ale'), - self::ALGONQUIAN => array('alg'), - self::SOUTHERN_ALTAI => array('alt'), - self::AMHARIC => array('amh', 'am'), - self::ENGLISH_OLD => array('ang'), - self::ANGIKA => array('anp'), - self::APACHE => array('apa'), - self::ARABIC => array('ara', 'ar'), - self::ARAMAIC => array('arc'), - self::ARAGONESE => array('arg', 'an'), - self::ARMENIAN => array('arm', 'hye', 'hy'), - self::MAPUDUNGUN => array('am'), - self::ARAPAHO => array('arp'), - self::ARTIFICIAL => array('art'), - self::ARAWAK => array('arw'), - self::ASSAMESE => array('asm', 'as'), - self::ASTURIAN => array('ast'), - self::ATHAPASCAN => array('ath'), - self::AUSTRALIAN => array('aus'), - self::AVARIC => array('ava', 'av'), - self::AVESTAN => array('ave', 'ae'), - self::AWADHI => array('awa'), - self::AYMARA => array('aym', 'ay'), - self::AZERBAIJANI => array('aze', 'az'), - self::BANDA => array('bad'), - self::BAMILEKE => array('bai'), - self::BASHKIR => array('bak', 'ba'), - self::BALUCHI => array('bal'), - self::BAMBARA => array('bam', 'bm'), - self::BALINESE => array('ban'), - self::BASQUE => array('baq', 'eus', 'eu'), - self::BASA => array('bas'), - self::BALTIC => array('bat'), - self::BEJA => array('bej'), - self::BELARUSIAN => array('bel', 'be'), - self::BEMBA => array('bem'), - self::BENGALI => array('ben', 'bn'), - self::BERBER => array('ber'), - self::BHOJPURI => array('bho'), - self::BIHARI => array('bih', 'bh'), - self::BIKOL => array('bik'), - self::BINI => array('bin'), - self::BISLAMA => array('bis', 'bi'), - self::SIKSIKA => array('bla'), - self::BANTU => array('bnt'), - self::TIBETAN => array('tib', 'bod', 'bo'), - self::BOSNIAN => array('bos', 'bs'), - self::BRAJ => array('bra'), - self::BRETON => array('bre'), - self::BATAK => array('btk'), - self::BURIAT => array('bua'), - self::BUGINESE => array('bug'), - self::BULGARIAN => array('bul'), - self::BURMESE => array('bur', 'mya', 'my'), - self::BLIN => array('byn'), - self::CADDO => array('cad'), - self::AMERICAN_INDIAN_CENTRAL => array('cai'), - self::GALIBI_CARIB => array('car'), - self::CATALAN => array('cat', 'ca'), - self::CAUCASIAN => array('cau'), - self::CEBUANO => array('ceb'), - self::CELTIC => array('cel'), - self::CZECH => array('cze', 'ces', 'cs'), - self::CHAMORRO => array('cha', 'ch'), - self::CHIBCHA => array('chb'), - self::CHECHEN => array('che', 'ce'), - self::CHAGATAI => array('chg'), - self::CHINESE => array('chi', 'zho', 'zh'), - self::CHUUKESE => array('chk'), - self::MARI => array('chm'), - self::CHINOOK_JARGON => array('chn'), - self::CHOCTAW => array('cho'), - self::CHIPEWYAN => array('chp'), - self::CHEROKEE => array('chr'), - self::CHURCH_SLAVIC => array('chu', 'cu'), - self::CHUVASH => array('chv', 'cv'), - self::CHEYENNE => array('chy'), - self::CHAMIC => array('cmc'), - self::COPTIC => array('cop'), - self::CORNISH => array('cor'), - self::CORSICAN => array('cos', 'co'), - self::CREOLES_ENGLISH => array('cpe'), - self::CREOLES_FRENCH => array('cpf'), - self::CREOLES_PORTUGESE => array('cpp'), - self::CREE => array('cre', 'cr'), - self::CRIMEAN_TATAR => array('crh'), - self::CREOLES => array('crp'), - self::KASHUBIAN => array('csb'), - self::CUSHITIC => array('cus'), - self::WELSH => array('wel', 'cym', 'cy'), - self::DAKOTA => array('dak'), - self::DANISH => array('dan', 'da'), - self::DARGWA => array('dar'), - self::LAND_DAYAK => array('day'), - self::DELAWARE => array('del'), - self::SLAVE => array('den'), - self::GERMAN => array('ger', 'deu', 'de'), - self::DOGRIB => array('dgr'), - self::DINKA => array('din'), - self::DIVEHI => array('div', 'dv'), - self::DOGRI => array('doi'), - self::DRAVIDIAN => array('dra'), - self::LOWER_SORBIAN => array('dsb'), - self::DUALA => array('dua'), - self::DUTCH_MIDDLE => array('dum'), - self::DUTCH_FLEMISH => array('dut', 'nld', 'nl'), - self::DYULA => array('dyu'), - self::DZONGKHA => array('dzo', 'dz'), - self::EFIK => array('efi'), - self::EGYPTIAN => array('egy'), - self::EKAJUK => array('eka'), - self::GREEK_MODERN => array('gre', 'ell', 'el'), - self::ELAMITE => array('elx'), - self::ENGLISH_MIDDLE => array('enm'), - self::ESPERANTO => array('epo', 'eo'), - self::ESTONIAN => array('est', 'et'), - self::EWE => array('ewe', 'ee'), - self::EWONDO => array('ewo'), - self::FANG => array('fan'), - self::FAROESE => array('fao', 'fo'), - self::PERSIAN => array('per', 'fas', 'fa'), - self::FANTI => array('fat'), - self::FIJIAN => array('fij', 'fj'), - self::FILIPINO => array('fil'), - self::FINNISH => array('fin', 'fi'), - self::FINNO_UGRIAN => array('fiu'), - self::FON => array('fon'), - self::FRENCH => array('fre', 'fra', 'fr'), - self::FRENCH_MIDDLE => array('frm'), - self::FRENCH_OLD => array('fro'), - self::FRISIAN_NORTHERN => array('frr'), - self::FRISIAN_EASTERN => array('frs'), - self::FRISIAN_WESTERN => array('fry', 'fy'), - self::FULAH => array('ful', 'ff'), - self::FRIULIAN => array('fur'), - self::GA => array('gaa'), - self::GAYO => array('gay'), - self::GBAYA => array('gba'), - self::GERMANIC => array('gem'), - self::GEORGIAN => array('geo', 'kat', 'ka'), - self::GEEZ => array('gez'), - self::GILBERTESE => array('gil'), - self::GAELIC => array('gla', 'gd'), - self::IRISH => array('gle', 'ga'), - self::GALICIAN => array('glg', 'gl'), - self::MANX => array('glv', 'gv'), - self::GERMAN_MIDDLE_HIGH => array('gmh'), - self::GERMAN_OLD_HIGH => array('goh'), - self::GONDI => array('gon'), - self::GORONTALO => array('gor'), - self::GOTHIC => array('got'), - self::GREBO => array('grb'), - self::GREEK_ANCIENT => array('grc'), - self::GUARANI => array('grm', 'gn'), - self::GERMAN_SWISS => array('gsw'), - self::GUJARATI => array('guj', 'gu'), - self::GWICHIN => array('gwi'), - self::HAIDA => array('hai'), - self::HAITIAN => array('hat', 'ht'), - self::HAUSA => array('hau', 'ha'), - self::HAWAIIAN => array('haw'), - self::HEBREW => array('heb', 'he'), - self::HERERO => array('her', 'hz'), - self::HILIGAYNON => array('hil'), - self::HIMACHALI => array('him'), - self::HINDI => array('hin', 'hi'), - self::HITTITE => array('hit'), - self::HMONG => array('hmn'), - self::HIRI_MOTU => array('hmo', 'ho'), - self::CROATIAN => array('hrv'), - self::SORBIAN_UPPER => array('hsb'), - self::HUNGARIAN => array('hun', 'hu'), - self::HUPA => array('hup'), - self::IBAN => array('iba'), - self::IGBO => array('ibo', 'ig'), - self::ICELANDIC => array('ice', 'isl', 'is'), - self::IDO => array('ido', 'io'), - self::SICHUAN_YI => array('iii', 'ii'), - self::IJO => array('ijo'), - self::INUKTITUT => array('iku', 'iu'), - self::INTERLINGUE => array('ile', 'ie'), - self::ILOKO => array('ilo'), - self::INTERLINGUA => array('ina', 'ia'), - self::INDIC => array('inc'), - self::INDONESIAN => array('ind', 'id'), - self::INDO_EUROPEAN => array('ine'), - self::INGUSH => array('inh'), - self::INUPIAQ => array('ipk', 'ik'), - self::IRANIAN => array('ira'), - self::IROQUOIAN => array('iro'), - self::ITALIAN => array('ita', 'it'), - self::JAVANESE => array('jav', 'jv'), - self::LOJBAN => array('jbo'), - self::JAPANESE => array('jpn', 'ja'), - self::JUDEO_PERSIAN => array('jpr'), - self::JUDEO_ARABIC => array('jrb'), - self::KARA_KALPAK => array('kaa'), - self::KABYLE => array('kab'), - self::KACHIN => array('kac'), - self::KALAALLISUT => array('kal', 'kl'), - self::KAMBA => array('kam'), - self::KANNADA => array('kan', 'kn'), - self::KAREN => array('kar'), - self::KASHMIRI => array('kas', 'ks'), - self::KANURI => array('kau', 'kr'), - self::KAWI => array('kaw'), - self::KAZAKH => array('kaz'), - self::KABARDIAN => array('kbd'), - self::KHASI => array('kha'), - self::KHOISAN => array('khi'), - self::CENTRAL_KHMER => array('khm', 'km'), - self::KHOTANESE => array('kho'), - self::KIKUYU => array('kik', 'ki'), - self::KINYARWANDA => array('kin', 'rw'), - self::KIRGHIZ => array('kir', 'ky'), - self::KIMBUNDU => array('kmb'), - self::KONKANI => array('kok'), - self::KOMI => array('kom', 'kv'), - self::KONGO => array('kon', 'kg'), - self::KOREAN => array('kor', 'ko'), - self::KOSRAEAN => array('kos'), - self::KPELLE => array('kpe'), - self::KARACHAY_BALKAR => array('krc'), - self::KARELIAN => array('krl'), - self::KRU => array('kro'), - self::KURUKH => array('kru'), - self::KUANYAMA => array('kua', 'kj'), - self::KUMYK => array('kum'), - self::KURDISH => array('kur', 'ku'), - self::KUTENAI => array('kut'), - self::LADINO => array('lad'), - self::LAHNDA => array('lah'), - self::LAMBA => array('lam'), - self::LAO => array('lao', 'lo'), - self::LATIN => array('lat', 'la'), - self::LATVIAN => array('lav', 'lv'), - self::LEZGHIAN => array('lez'), - self::LIMBURGAN => array('lim', 'li'), - self::LINGALA => array('lin', 'ln'), - self::LITHUANIAN => array('lit', 'lt'), - self::MONGO => array('lol'), - self::LOZI => array('loz'), - self::LUXEMBOURGISH => array('ltz', 'lb'), - self::LUBA_LULUA => array('lua'), - self::LUBA_KATANGA => array('lub', 'lu'), - self::GANDA => array('lug', 'lg'), - self::LUISENO => array('lui'), - self::LUNDA => array('lun'), - self::LUO => array('luo'), - self::LUSHAI => array('lus'), - self::MACEDONIAN => array('mac', 'mkd', 'mk'), - self::MADURESE => array('mad'), - self::MAGAHI => array('mag'), - self::MARSHALLESE => array('mah'), - self::MAITHILI => array('mai'), - self::MAKASAR => array('mak'), - self::MALAYALAM => array('mal'), - self::MANDINGO => array('man'), - self::MAORI => array('mao', 'mri', 'mi'), - self::AUSTRONESIAN => array('map'), - self::MARATHI => array('mar', 'mr'), - self::MASAI => array('mas'), - self::MALAY => array('may', 'msa', 'ms'), - self::MOKSHA => array('mdf'), - self::MANDAR => array('mdr'), - self::MENDE => array('men'), - self::IRISH_MIDDLE => array('mga'), - self::MIKMAQ => array('mic'), - self::MINANGKABAU => array('min'), - self::UNCODED => array('mis'), - self::MON_KHMER => array('mkh'), - self::MALAGASY => array('mlg'), - self::MALTESE => array('mlt'), - self::MANCHU => array('mnc'), - self::MANIPURI => array('mni'), - self::MANOBO => array('mno'), - self::MOHAWK => array('moh'), - self::MONGOLIAN => array('mon', 'mn'), - self::MOSSI => array('mos'), - self::MULTIPLE => array('mul'), - self::MUNDA => array('mun'), - self::CREEK => array('mus'), - self::MIRANDESE => array('mwl'), - self::MARWARI => array('mwr'), - self::MAYAN => array('myn'), - self::ERZYA => array('myv'), - self::NAHUATL => array('nah'), - self::AMERICAN_INDIAN_NORTH => array('nai'), - self::NEAPOLITAN => array('nap'), - self::NAURU => array('nau', 'na'), - self::NAVAJO => array('nav', 'nv'), - self::NDEBELE_SOUTH => array('nbl', 'nr'), - self::NDEBELE_NORTH => array('nde', 'nd'), - self::NDONGA => array('ndo', 'ng'), - self::LOW_GERMAN => array('nds'), - self::NEPALI => array('nep', 'ne'), - self::NEPAL_BHASA => array('new'), - self::NIAS => array('nia'), - self::NIGER_KORDOFANIAN => array('nic'), - self::NIUEAN => array('niu'), - self::NORWEGIAN_NYNORSK => array('nno', 'nn'), - self::BOKMAL => array('nob', 'nb'), - self::NOGAI => array('nog'), - self::NORSE_OLD => array('non'), - self::NORWEGIAN => array('nor', 'no'), - self::NKO => array('nqo'), - self::PEDI => array('nso'), - self::NUBIAN => array('nub'), - self::CLASSICAL_NEWARI => array('nwc'), - self::CHICHEWA => array('nya', 'ny'), - self::NYAMWEZI => array('nym'), - self::NYANKOLE => array('nyn'), - self::NYORO => array('nyo'), - self::NZIMA => array('nzi'), - self::OCCITAN => array('oci', 'oc'), - self::OJIBWA => array('oji', 'oj'), - self::ORIYA => array('ori', 'or'), - self::OROMO => array('orm', 'om'), - self::OSAGE => array('osa'), - self::OSSETIAN => array('oss', 'os'), - self::OTTOMAN => array('ota'), - self::OTOMIAN => array('oto'), - self::PAPUAN => array('paa'), - self::PANGASINAN => array('pag'), - self::PAHLAVI => array('pal'), - self::PAMPANGA => array('pam'), - self::PANJABI => array('pan', 'pa'), - self::PAPIAMENTO => array('pap'), - self::PALAUAN => array('pau'), - self::PERSIAN_OLD => array('peo'), - self::PHILIPPINE => array('phi'), - self::PHOENICIAN => array('phn'), - self::PALI => array('pli', 'pi'), - self::POLISH => array('pol', 'pl'), - self::POHNPEIAN => array('pon'), - self::PORTUGUESE => array('por', 'pt'), - self::PRAKRIT => array('pra'), - self::PROVENCAL => array('pro'), - self::PUSHTO => array('pus', 'ps'), - self::QUECHUA => array('que', 'qu'), - self::RAJASTHANI => array('raj'), - self::RAPANUI => array('rap'), - self::RAROTONGAN => array('rar'), - self::ROMANCE => array('roa'), - self::ROMANSH => array('roh', 'rm'), - self::ROMANY => array('rom'), - self::ROMANIAN => array('rum', 'ron', 'ro'), - self::RUNDI => array('run', 'rn'), - self::AROMANIAN => array('rup'), - self::RUSSIAN => array('rus', 'ru'), - self::SANDAWE => array('sad'), - self::SANGO => array('sag', 'sg'), - self::YAKUT => array('sah'), - self::AMERICAN_INDIAN_SOUTH => array('sai'), - self::SALISHAN => array('sal'), - self::SAMARITAN => array('sam'), - self::SANSKRIT => array('san', 'sa'), - self::SASAK => array('sas'), - self::SANTALI => array('sat'), - self::SICILIAN => array('scn'), - self::SCOTS => array('sco'), - self::SELKUP => array('sel'), - self::SEMITIC => array('sem'), - self::IRISH_OLD => array('sga'), - self::SIGN => array('sgn'), - self::SHAN => array('shn'), - self::SIDAMO => array('sid'), - self::SINHALA => array('sin', 'si'), - self::SIOUAN => array('sio'), - self::SINO_TIBETAN => array('sit'), - self::SLAVIC => array('sla'), - self::SLOVAK => array('slo', 'slk', 'sk'), - self::SLOVENIAN => array('slv', 'sl'), - self::SAMI_SOUTHERN => array('sma'), - self::SAMI_NORTHERN => array('sme', 'se'), - self::SAMI => array('smi'), - self::SAMI_LULE => array('smj'), - self::SAMI_IRARI => array('smn'), - self::SAMOAN => array('smo', 'sm'), - self::SAMI_SKOLT => array('sms'), - self::SHONA => array('sna', 'sn'), - self::SINDHI => array('snd', 'sd'), - self::SONINKE => array('snk'), - self::SOGDIAN => array('sog'), - self::SOMALI => array('som', 'so'), - self::SONGHAI => array('son'), - self::SOTHO_SOUTHERN => array('sot', 'st'), - self::SPANISH => array('spa', 'es'), - self::SARDINIAN => array('srd', 'sc'), - self::SRANAN_TONGO => array('sm'), - self::SERBIAN => array('srp', 'sr'), - self::SERER => array('srr'), - self::NILO_SAHARAN => array('ssa'), - self::SWATI => array('ssw', 'ss'), - self::SUKUMA => array('suk'), - self::SUNDANESE => array('sun', 'su'), - self::SUSU => array('sus'), - self::SUMERIAN => array('sux'), - self::SWAHILI => array('swa', 'sw'), - self::SWEDISH => array('swe', 'sv'), - self::SYRIAC_CLASSICAL => array('syc'), - self::SYRIAC => array('syr'), - self::TAHITIAN => array('tah', 'ty'), - self::TAI => array('tai'), - self::TAMIL => array('tam', 'ta'), - self::TATAR => array('tat', 'tt'), - self::TELUGU => array('tel', 'te'), - self::TIMNE => array('tem'), - self::TERENO => array('ter'), - self::TETUM => array('tet'), - self::TAJIK => array('tgk', 'tg'), - self::TAGALOG => array('tgl', 'tl'), - self::THAI => array('tha', 'th'), - self::TIGRE => array('tig'), - self::TIGRINYA => array('tir', 'ti'), - self::TIV => array('tiv'), - self::TOKELAU => array('tkl'), - self::KLINGON => array('tlh'), - self::TLINGIT => array('tli'), - self::TAMASHEK => array('tmh'), - self::TONGA_NYASA => array('tog'), - self::TONGA_ISLANDS => array('ton', 'to'), - self::TOK_PISIN => array('tpi'), - self::TSIMSHIAN => array('tsi'), - self::TSWANA => array('tsn', 'tn'), - self::TSONGA => array('tso', 'ts'), - self::TURKMEN => array('tuk', 'tk'), - self::TUMBUKA => array('tum'), - self::TUPI => array('tup'), - self::TURKISH => array('tur', 'tr'), - self::ALTAIC => array('tut'), - self::TUVALU => array('tvl'), - self::TWI => array('twi', 'tw'), - self::TUVINIAN => array('tyv'), - self::UDMURT => array('udm'), - self::UGARITIC => array('uga'), - self::UIGHUR => array('uig', 'ug'), - self::UKRAINIAN => array('ukr', 'uk'), - self::UMBUNDU => array('umb'), - self::UNDETERMINED => array('und'), - self::URDU => array('urd', 'ur'), - self::UZBEK => array('uzb', 'uz'), - self::VAI => array('vai'), - self::VENDA => array('ven', 've'), - self::VIETNAMESE => array('vie', 'vi'), - self::VOLAPUK => array('vol', 'vo'), - self::VOTIC => array('vot'), - self::WAKASHAN => array('wak'), - self::WOLAITTA => array('wal'), - self::WARAY => array('war'), - self::WASHO => array('was'), - self::SORBIAN => array('wen'), - self::WALLOON => array('wln', 'wa'), - self::WOLOF => array('wol', 'wo'), - self::KALMYK => array('xal'), - self::XHOSA => array('xho', 'xh'), - self::YAO => array('yao'), - self::YAPESE => array('yap'), - self::YIDDISH => array('yid', 'yi'), - self::YORUBA => array('yor', 'yo'), - self::YUPIK => array('ypk'), - self::ZAPOTEC => array('zap'), - self::BLISSYMBOLS => array('zbl'), - self::ZENAGA => array('zen'), - self::MOROCCAN_TAMAZIGHT => array('zgh'), - self::ZHUANG => array('zha', 'za'), - self::ZANDE => array('znd'), - self::ZULU => array('zul', 'zu'), - self::ZUNI => array('zun'), - self::NOT_APPLICABLE => array('zxx'), - self::ZAZA => array('zza'), - ); - - private static $s_names = array( - self::ENGLISH_US => array('US English'), - self::ENGLISH => array('English'), - self::ENGLISH_CA => array('Canadian English'), - self::ENGLISH_GB => array('British English'), - self::AFAR => array('Afar'), - self::ABKHAZIAN => array('Abkhazian'), - self::ACHINESE => array('Achinese'), - self::ACOLI => array('Acoli'), - self::ADANGME => array('Adangme'), - self::ADYGHE => array('Adyghe'), - self::AFRO_ASIATIC => array('Afro-Asiatic', 'Adygei'), - self::AFRIHILI => array('Afrihili'), - self::AFRIKAANS => array('Afrikaans'), - self::AINU => array('Ainu'), - self::AKAN => array('Akan'), - self::AKKADIAN => array('Akkadian'), - self::ALBANIAN => array('Albanian'), - self::ALEUT => array('Aleut'), - self::ALGONQUIAN => array('Algonquian'), - self::SOUTHERN_ALTAI => array('Southern Altai'), - self::AMHARIC => array('Amharic'), - self::ENGLISH_OLD => array('Old English'), - self::ANGIKA => array('Angika'), - self::APACHE => array('Apache'), - self::ARABIC => array('Arabic'), - self::ARAMAIC => array('Official Aramaic', 'Imperial Aramaic'), - self::ARAGONESE => array('Aragonese'), - self::ARMENIAN => array('Armenian'), - self::MAPUDUNGUN => array('Mapudungun', 'Mapuche'), - self::ARAPAHO => array('Arapaho'), - self::ARTIFICIAL => array('Artificial'), - self::ARAWAK => array('Arawak'), - self::ASSAMESE => array('Assamese'), - self::ASTURIAN => array('Asturian', 'Bable', 'Leonese', 'Asturleonese'), - self::ATHAPASCAN => array('Athapascan'), - self::AUSTRALIAN => array('Australian'), - self::AVARIC => array('Avaric'), - self::AVESTAN => array('Avestan'), - self::AWADHI => array('Awadhi'), - self::AYMARA => array('Aymara'), - self::AZERBAIJANI => array('Azerbaijani'), - self::BANDA => array('Banda'), - self::BAMILEKE => array('Bamileke'), - self::BASHKIR => array('Bashkir'), - self::BALUCHI => array('Baluchi'), - self::BAMBARA => array('Bambara'), - self::BALINESE => array('Balinese'), - self::BASQUE => array('Basque'), - self::BASA => array('Basa'), - self::BALTIC => array('Baltic'), - self::BEJA => array('Beja'), - self::BELARUSIAN => array('Belarusian'), - self::BEMBA => array('Bemba'), - self::BENGALI => array('Bengali'), - self::BERBER => array('Berber'), - self::BHOJPURI => array('Bhojpuri'), - self::BIHARI => array('Bihari'), - self::BIKOL => array('Bikol'), - self::BINI => array('Bini', 'Edo'), - self::BISLAMA => array('Bislama'), - self::SIKSIKA => array('Siksika'), - self::BANTU => array('Bantu'), - self::TIBETAN => array('Tibetan'), - self::BOSNIAN => array('Bosnian'), - self::BRAJ => array('Braj'), - self::BRETON => array('Breton'), - self::BATAK => array('Batak'), - self::BURIAT => array('Buriat'), - self::BUGINESE => array('Buginese'), - self::BULGARIAN => array('Bulgarian'), - self::BURMESE => array('Burmese'), - self::BLIN => array('Blin', 'Bilin'), - self::CADDO => array('Caddo'), - self::AMERICAN_INDIAN_CENTRAL => array('Central American Indian'), - self::GALIBI_CARIB => array('Galibi Carib'), - self::CATALAN => array('Catalan', 'Valencian'), - self::CAUCASIAN => array('Caucasian'), - self::CEBUANO => array('Cebuano'), - self::CELTIC => array('Celtic'), - self::CZECH => array('Czech'), - self::CHAMORRO => array('Chamorro'), - self::CHIBCHA => array('Chibcha'), - self::CHECHEN => array('Chechen'), - self::CHAGATAI => array('Chagatai'), - self::CHINESE => array('Chinese'), - self::CHUUKESE => array('Chuukese'), - self::MARI => array('Mari'), - self::CHINOOK_JARGON => array('Chinook jargon'), - self::CHOCTAW => array('Choctaw'), - self::CHIPEWYAN => array('Chipewyan', 'Dene Suline'), - self::CHEROKEE => array('Cherokee'), - self::CHURCH_SLAVIC => array('Church Slavic', 'Old Slavonic', 'Church Slavonic', 'Old Bulgarian', 'Old Church Slavonic'), - self::CHUVASH => array('Chuvash'), - self::CHEYENNE => array('Cheyenne'), - self::CHAMIC => array('Chamic'), - self::COPTIC => array('Coptic'), - self::CORNISH => array('Cornish'), - self::CORSICAN => array('Corsican'), - self::CREOLES_ENGLISH => array('Creoles and Pidgins, English Based'), - self::CREOLES_FRENCH => array('Creoles and Pidgins, French Based'), - self::CREOLES_PORTUGESE => array('Creoles and Pidgins, Portugese Based'), - self::CREE => array('Cree'), - self::CRIMEAN_TATAR => array('Crimean Tatar', 'Crimean Turkish'), - self::CREOLES => array('Creoles and Pidgins'), - self::KASHUBIAN => array('Kashubian'), - self::CUSHITIC => array('Cushitic'), - self::WELSH => array('Welsh'), - self::DAKOTA => array('Dakota'), - self::DANISH => array('Danish'), - self::DARGWA => array('Dargwa'), - self::LAND_DAYAK => array('Land Dayak'), - self::DELAWARE => array('Delaware'), - self::SLAVE => array('Athapascan Slave'), - self::GERMAN => array('German'), - self::DOGRIB => array('Dogrib'), - self::DINKA => array('Dinka'), - self::DIVEHI => array('Divehi', 'Dhivehi', 'Maldivian'), - self::DOGRI => array('Dogri'), - self::DRAVIDIAN => array('Dravidian'), - self::LOWER_SORBIAN => array('Lower Sorbian'), - self::DUALA => array('Duala'), - self::DUTCH_MIDDLE => array('Middle Dutch'), - self::DUTCH_FLEMISH => array('Dutch', 'Flemish'), - self::DYULA => array('Dyula'), - self::DZONGKHA => array('Dzongkha'), - self::EFIK => array('Efik'), - self::EGYPTIAN => array('Ancient Egyptian'), - self::EKAJUK => array('Ekajuk'), - self::GREEK_MODERN => array('Modern Greek'), - self::ELAMITE => array('Elamite'), - self::ENGLISH_MIDDLE => array('Middle English'), - self::ESPERANTO => array('Esperanto'), - self::ESTONIAN => array('Estonian'), - self::EWE => array('Ewe'), - self::EWONDO => array('Ewondo'), - self::FANG => array('Fang'), - self::FAROESE => array('Faroese'), - self::PERSIAN => array('Persian'), - self::FANTI => array('Fanti'), - self::FIJIAN => array('Fijian'), - self::FILIPINO => array('Filipino', 'Pilipino'), - self::FINNISH => array('Finnish'), - self::FINNO_UGRIAN => array('Finno-Ugrian '), - self::FON => array('Fon'), - self::FRENCH => array('French'), - self::FRENCH_MIDDLE => array('Middle French'), - self::FRENCH_OLD => array('Old French'), - self::FRISIAN_NORTHERN => array('Northern Frisian'), - self::FRISIAN_EASTERN => array('Eastern Frisian'), - self::FRISIAN_WESTERN => array('Southern Frisian'), - self::FULAH => array('Fulah'), - self::FRIULIAN => array('Friulian'), - self::GA => array('Ga'), - self::GAYO => array('Gayo'), - self::GBAYA => array('Gbaya'), - self::GERMANIC => array('Germanic'), - self::GEORGIAN => array('Georgian'), - self::GEEZ => array('Geez'), - self::GILBERTESE => array('Gilbertese'), - self::GAELIC => array('Gaelic', 'Scottish Gaelic'), - self::IRISH => array('Irish'), - self::GALICIAN => array('Galician'), - self::MANX => array('Manx'), - self::GERMAN_MIDDLE_HIGH => array('Middle High German'), - self::GERMAN_OLD_HIGH => array('Old High German'), - self::GONDI => array('Gondi'), - self::GORONTALO => array('Gorontalo'), - self::GOTHIC => array('Gothic'), - self::GREBO => array('Grebo'), - self::GREEK_ANCIENT => array('Ancient Greek'), - self::GUARANI => array('Guarani'), - self::GERMAN_SWISS => array('Swiss German', 'Alemannic', 'Alsatian'), - self::GUJARATI => array('Gujarati'), - self::GWICHIN => array('Gwich\'in'), - self::HAIDA => array('Haida'), - self::HAITIAN => array('Haitian', 'Haitian Creole'), - self::HAUSA => array('Hausa'), - self::HAWAIIAN => array('Hawaiian'), - self::HEBREW => array('Hebrew'), - self::HERERO => array('Herero'), - self::HILIGAYNON => array('Hiligaynon'), - self::HIMACHALI => array('Himachali', 'Western Pahari'), - self::HINDI => array('Hindi'), - self::HITTITE => array('Hittite'), - self::HMONG => array('Hmong', 'Mong'), - self::HIRI_MOTU => array('Hiri Motu'), - self::CROATIAN => array('Croatian'), - self::SORBIAN_UPPER => array('Upper Sorbian'), - self::HUNGARIAN => array('Hungarian'), - self::HUPA => array('Hupa'), - self::IBAN => array('Iban'), - self::IGBO => array('Igbo'), - self::ICELANDIC => array('Icelandic'), - self::IDO => array('Ido'), - self::SICHUAN_YI => array('Sichuan Yi', 'Nuosu'), - self::IJO => array('Ijo'), - self::INUKTITUT => array('Inuktitut'), - self::INTERLINGUE => array('Interlingue'), - self::ILOKO => array('Iloko'), - self::INTERLINGUA => array('Interlingua'), - self::INDIC => array('Indic'), - self::INDONESIAN => array('Indonesian'), - self::INDO_EUROPEAN => array('Indo-European'), - self::INGUSH => array('Ingush'), - self::INUPIAQ => array('Inupiaq'), - self::IRANIAN => array('Iranian'), - self::IROQUOIAN => array('Iroquoian'), - self::ITALIAN => array('Italian'), - self::JAVANESE => array('Javanese'), - self::LOJBAN => array('Lojban'), - self::JAPANESE => array('Japanese'), - self::JUDEO_PERSIAN => array('Judeo-Persian'), - self::JUDEO_ARABIC => array('Judeo-Arabic'), - self::KARA_KALPAK => array('Kara-Kalpak'), - self::KABYLE => array('Kabyle'), - self::KACHIN => array('Kachin', 'Jingpho'), - self::KALAALLISUT => array('Kalaallisut', 'Greenlandic'), - self::KAMBA => array('Kamba'), - self::KANNADA => array('Kannada'), - self::KAREN => array('Karen'), - self::KASHMIRI => array('Kashmiri'), - self::KANURI => array('Kanuri'), - self::KAWI => array('Kawi'), - self::KAZAKH => array('Kazakh'), - self::KABARDIAN => array('Kabardian'), - self::KHASI => array('Khasi'), - self::KHOISAN => array('Khoisan'), - self::CENTRAL_KHMER => array('Central Khmer'), - self::KHOTANESE => array('Khotanese', 'Sakan'), - self::KIKUYU => array('Kikuyu', 'Gikuyu'), - self::KINYARWANDA => array('Kinyarwanda'), - self::KIRGHIZ => array('Kirghiz', 'Kyrgyz'), - self::KIMBUNDU => array('Kimbundu'), - self::KONKANI => array('Konkani'), - self::KOMI => array('Komi'), - self::KONGO => array('Kongo'), - self::KOREAN => array('Korean'), - self::KOSRAEAN => array('Kosraean'), - self::KPELLE => array('Kpelle'), - self::KARACHAY_BALKAR => array('Karachay-Balkar'), - self::KARELIAN => array('Karelian'), - self::KRU => array('Kru'), - self::KURUKH => array('Kurukh'), - self::KUANYAMA => array('Kuanyama', 'Kwanyama'), - self::KUMYK => array('Kumyk'), - self::KURDISH => array('Kurdish'), - self::KUTENAI => array('Kutenai'), - self::LADINO => array('Ladino'), - self::LAHNDA => array('Lahnda'), - self::LAMBA => array('Lamba'), - self::LAO => array('Lao'), - self::LATIN => array('Latin'), - self::LATVIAN => array('Latvian'), - self::LEZGHIAN => array('Lezghian'), - self::LIMBURGAN => array('Limburgan', 'Limburger', 'Limburgish'), - self::LINGALA => array('Lingala'), - self::LITHUANIAN => array('Lithuanian'), - self::MONGO => array('Mongo'), - self::LOZI => array('Lozi'), - self::LUXEMBOURGISH => array('Luxembourgish', 'Letzeburgesch'), - self::LUBA_LULUA => array('Luba-Lulua'), - self::LUBA_KATANGA => array('Luba-Katanga'), - self::GANDA => array('Ganda'), - self::LUISENO => array('Luiseno'), - self::LUNDA => array('Lunda'), - self::LUO => array('Luo'), - self::LUSHAI => array('Lushai'), - self::MACEDONIAN => array('Macedonian'), - self::MADURESE => array('Madurese'), - self::MAGAHI => array('Magahi'), - self::MARSHALLESE => array('Marshallese'), - self::MAITHILI => array('Maithili'), - self::MAKASAR => array('Makasar'), - self::MALAYALAM => array('Malayalam'), - self::MANDINGO => array('Mandingo'), - self::MAORI => array('Maori'), - self::AUSTRONESIAN => array('Austronesian'), - self::MARATHI => array('Marathi'), - self::MASAI => array('Masai'), - self::MALAY => array('Malay'), - self::MOKSHA => array('Moksha'), - self::MANDAR => array('Mandar'), - self::MENDE => array('Mende'), - self::IRISH_MIDDLE => array('Middle Irish'), - self::MIKMAQ => array('Mi\'kmaq', 'Micmac'), - self::MINANGKABAU => array('Minangkabau'), - self::UNCODED => array('Uncoded'), - self::MON_KHMER => array('Mon-Khmer'), - self::MALAGASY => array('Malagasy'), - self::MALTESE => array('Maltese'), - self::MANCHU => array('Manchu'), - self::MANIPURI => array('Manipuri'), - self::MANOBO => array('Manobo'), - self::MOHAWK => array('Mohawk'), - self::MONGOLIAN => array('Mongolian'), - self::MOSSI => array('Mossi'), - self::MULTIPLE => array('Multiple'), - self::MUNDA => array('Munda'), - self::CREEK => array('Creek'), - self::MIRANDESE => array('Mirandese'), - self::MARWARI => array('Marwari'), - self::MAYAN => array('Mayan'), - self::ERZYA => array('Erzya'), - self::NAHUATL => array('Nahuatl'), - self::AMERICAN_INDIAN_NORTH => array('North American Indian'), - self::NEAPOLITAN => array('Neapolitan'), - self::NAURU => array('Nauru'), - self::NAVAJO => array('Navajo', 'Navaho'), - self::NDEBELE_SOUTH => array('South Ndebele'), - self::NDEBELE_NORTH => array('North Ndebele'), - self::NDONGA => array('Ndonga'), - self::LOW_GERMAN => array('Low German', 'Low Saxon'), - self::NEPALI => array('Nepali'), - self::NEPAL_BHASA => array('Nepal Bhasa', 'Newari'), - self::NIAS => array('Nias'), - self::NIGER_KORDOFANIAN => array('Niger-Kordofanian'), - self::NIUEAN => array('Niuean'), - self::NORWEGIAN_NYNORSK => array('Norwegian Nynorsk'), - self::BOKMAL => array('Bokmål', 'Norwegian Bokmål'), - self::NOGAI => array('Nogai'), - self::NORSE_OLD => array('Old Norse'), - self::NORWEGIAN => array('Norwegian'), - self::NKO => array('N\'Ko'), - self::PEDI => array('Pedi', 'Sepedi', 'Northern Sotho'), - self::NUBIAN => array('Nubian'), - self::CLASSICAL_NEWARI => array('Classical Newari', 'Old Newari', 'Classical Nepal Bhasa'), - self::CHICHEWA => array('Chichewa', 'Chewa', 'Nyanja'), - self::NYAMWEZI => array('Nyamwezi'), - self::NYANKOLE => array('Nyankole'), - self::NYORO => array('Nyoro'), - self::NZIMA => array('Nzima'), - self::OCCITAN => array('Occitan'), - self::OJIBWA => array('Ojibwa'), - self::ORIYA => array('Oriya'), - self::OROMO => array('Oromo'), - self::OSAGE => array('Osage'), - self::OSSETIAN => array('Ossetian', 'Ossetic'), - self::OTTOMAN => array('Ottoman Turkish'), - self::OTOMIAN => array('Otomian'), - self::PAPUAN => array('Papuan'), - self::PANGASINAN => array('Pangasinan'), - self::PAHLAVI => array('Pahlavi'), - self::PAMPANGA => array('Pampanga', 'Kapampangan'), - self::PANJABI => array('Panjabi', 'Punjabi'), - self::PAPIAMENTO => array('Papiamento'), - self::PALAUAN => array('Palauan'), - self::PERSIAN_OLD => array('Old Persian'), - self::PHILIPPINE => array('Philippine'), - self::PHOENICIAN => array('Phoenician'), - self::PALI => array('Pali'), - self::POLISH => array('Polish'), - self::POHNPEIAN => array('Pohnpeian'), - self::PORTUGUESE => array('Portuguese'), - self::PRAKRIT => array('Prakrit'), - self::PROVENCAL => array('Old Provençal', 'Old Occitan'), - self::PUSHTO => array('Pushto', 'Pashto'), - self::QUECHUA => array('Quechua'), - self::RAJASTHANI => array('Rajasthani'), - self::RAPANUI => array('Rapanui'), - self::RAROTONGAN => array('Rarotongan', 'Cook Islands Maori'), - self::ROMANCE => array('Romance'), - self::ROMANSH => array('Romansh'), - self::ROMANY => array('Romany'), - self::ROMANIAN => array('Romanian', 'Moldavian', 'Moldovan'), - self::RUNDI => array('Rundi'), - self::AROMANIAN => array('Aromanian', 'Arumanian', 'Macedo-Romanian'), - self::RUSSIAN => array('Russian'), - self::SANDAWE => array('Sandawe'), - self::SANGO => array('Sango'), - self::YAKUT => array('Yakut'), - self::AMERICAN_INDIAN_SOUTH => array('South American Indian'), - self::SALISHAN => array('Salishan'), - self::SAMARITAN => array('Samaritan'), - self::SANSKRIT => array('Sanskrit'), - self::SASAK => array('Sasak'), - self::SANTALI => array('Santali'), - self::SICILIAN => array('Sicilian'), - self::SCOTS => array('Scots'), - self::SELKUP => array('Selkup'), - self::SEMITIC => array('Semitic'), - self::IRISH_OLD => array('Old Irish'), - self::SIGN => array('Sign Language'), - self::SHAN => array('Shan'), - self::SIDAMO => array('Sidamo'), - self::SINHALA => array('Sinhala', 'Sinhalese'), - self::SIOUAN => array('Siouan'), - self::SINO_TIBETAN => array('Sino-Tibetan'), - self::SLAVIC => array('Slavic'), - self::SLOVAK => array('Slovak'), - self::SLOVENIAN => array('Slovenian'), - self::SAMI_SOUTHERN => array('Southern Sami'), - self::SAMI_NORTHERN => array('Northern Sami'), - self::SAMI => array('Sami'), - self::SAMI_LULE => array('Lule Sami'), - self::SAMI_IRARI => array('Inari Sami'), - self::SAMOAN => array('Samoan'), - self::SAMI_SKOLT => array('Skolt Sami'), - self::SHONA => array('Shona'), - self::SINDHI => array('Sindhi'), - self::SONINKE => array('Soninke'), - self::SOGDIAN => array('Sogdian'), - self::SOMALI => array('Somali'), - self::SONGHAI => array('Songhai'), - self::SOTHO_SOUTHERN => array('Southern Sotho'), - self::SPANISH => array('Spanish', 'Castilian'), - self::SARDINIAN => array('Sardinian'), - self::SRANAN_TONGO => array('Sranan Tongo'), - self::SERBIAN => array('Serbian'), - self::SERER => array('Serer'), - self::NILO_SAHARAN => array('Nilo-Saharan'), - self::SWATI => array('Swati'), - self::SUKUMA => array('Sukuma'), - self::SUNDANESE => array('Sundanese'), - self::SUSU => array('Susu'), - self::SUMERIAN => array('Sumerian'), - self::SWAHILI => array('Swahili'), - self::SWEDISH => array('Swedish'), - self::SYRIAC_CLASSICAL => array('Classical Syriac'), - self::SYRIAC => array('Syriac'), - self::TAHITIAN => array('Tahitian'), - self::TAI => array('Tai'), - self::TAMIL => array('Tamil'), - self::TATAR => array('Tatar'), - self::TELUGU => array('Telugu'), - self::TIMNE => array('Timne'), - self::TERENO => array('Tereno'), - self::TETUM => array('Tetum'), - self::TAJIK => array('Tajik'), - self::TAGALOG => array('Tagalog'), - self::THAI => array('Thai'), - self::TIGRE => array('Tigre'), - self::TIGRINYA => array('Tigrinya'), - self::TIV => array('Tiv'), - self::TOKELAU => array('Tokelau'), - self::KLINGON => array('Klingon', 'tlhIngan-Hol'), - self::TLINGIT => array('Tlingit'), - self::TAMASHEK => array('Tamashek'), - self::TONGA_NYASA => array('Nyasa Tonga'), - self::TONGA_ISLANDS => array('Tonga Islands Tonga', 'to'), - self::TOK_PISIN => array('Tok Pisin'), - self::TSIMSHIAN => array('Tsimshian'), - self::TSWANA => array('Tswana'), - self::TSONGA => array('Tsonga'), - self::TURKMEN => array('Turkmen'), - self::TUMBUKA => array('Tumbuka'), - self::TUPI => array('Tupi'), - self::TURKISH => array('Turkish'), - self::ALTAIC => array('Altaic'), - self::TUVALU => array('Tuvalu'), - self::TWI => array('Twi'), - self::TUVINIAN => array('Tuvinian'), - self::UDMURT => array('Udmurt'), - self::UGARITIC => array('Ugaritic'), - self::UIGHUR => array('Uighur', 'Uyghur'), - self::UKRAINIAN => array('Ukrainian'), - self::UMBUNDU => array('Umbundu'), - self::UNDETERMINED => array('Undetermined'), - self::URDU => array('Urdu'), - self::UZBEK => array('Uzbek'), - self::VAI => array('Vai'), - self::VENDA => array('Venda'), - self::VIETNAMESE => array('Vietnamese'), - self::VOLAPUK => array('Volapük'), - self::VOTIC => array('Votic'), - self::WAKASHAN => array('Wakashan'), - self::WOLAITTA => array('Wolaitta', 'Wolaytta'), - self::WARAY => array('Waray'), - self::WASHO => array('Washo'), - self::SORBIAN => array('Sorbian'), - self::WALLOON => array('Walloon'), - self::WOLOF => array('Wolof'), - self::KALMYK => array('Kalmyk', 'Oirat'), - self::XHOSA => array('Xhosa'), - self::YAO => array('Yao'), - self::YAPESE => array('Yapese'), - self::YIDDISH => array('Yiddish'), - self::YORUBA => array('Yoruba'), - self::YUPIK => array('Yupik'), - self::ZAPOTEC => array('Zapotec'), - self::BLISSYMBOLS => array('Blissymbols', 'Blissymbolics', 'Bliss'), - self::ZENAGA => array('Zenaga'), - self::MOROCCAN_TAMAZIGHT => array('Standard Moroccan Tamazight'), - self::ZHUANG => array('Zhuang', 'Chuang'), - self::ZANDE => array('Zande'), - self::ZULU => array('Zulu'), - self::ZUNI => array('Zuni'), - self::NOT_APPLICABLE => array('No Linguistic Content', 'Not Applicable'), - self::ZAZA => array('Zaza', 'Dimili', 'Dimli', 'Kirdki', 'Kirmanjki', 'Zazaki'), - ); - - private static $s_ids = array( + private static $s_aliases = [ + self::ENGLISH_US => ['en-us'], + self::ENGLISH => ['eng', 'en'], + self::ENGLISH_CA => ['en-ca'], + self::ENGLISH_GB => ['en-gb'], + self::AFAR => ['aar', 'aa'], + self::ABKHAZIAN => ['abk', 'ab'], + self::ACHINESE => ['ace'], + self::ACOLI => ['ach'], + self::ADANGME => ['ada'], + self::ADYGHE => ['ady'], + self::AFRO_ASIATIC => ['afa'], + self::AFRIHILI => ['afh'], + self::AFRIKAANS => ['afr', 'af'], + self::AINU => ['ain'], + self::AKAN => ['aka', 'ak'], + self::AKKADIAN => ['akk'], + self::ALBANIAN => ['alb', 'sqi', 'sq'], + self::ALEUT => ['ale'], + self::ALGONQUIAN => ['alg'], + self::SOUTHERN_ALTAI => ['alt'], + self::AMHARIC => ['amh', 'am'], + self::ENGLISH_OLD => ['ang'], + self::ANGIKA => ['anp'], + self::APACHE => ['apa'], + self::ARABIC => ['ara', 'ar'], + self::ARAMAIC => ['arc'], + self::ARAGONESE => ['arg', 'an'], + self::ARMENIAN => ['arm', 'hye', 'hy'], + self::MAPUDUNGUN => ['am'], + self::ARAPAHO => ['arp'], + self::ARTIFICIAL => ['art'], + self::ARAWAK => ['arw'], + self::ASSAMESE => ['asm', 'as'], + self::ASTURIAN => ['ast'], + self::ATHAPASCAN => ['ath'], + self::AUSTRALIAN => ['aus'], + self::AVARIC => ['ava', 'av'], + self::AVESTAN => ['ave', 'ae'], + self::AWADHI => ['awa'], + self::AYMARA => ['aym', 'ay'], + self::AZERBAIJANI => ['aze', 'az'], + self::BANDA => ['bad'], + self::BAMILEKE => ['bai'], + self::BASHKIR => ['bak', 'ba'], + self::BALUCHI => ['bal'], + self::BAMBARA => ['bam', 'bm'], + self::BALINESE => ['ban'], + self::BASQUE => ['baq', 'eus', 'eu'], + self::BASA => ['bas'], + self::BALTIC => ['bat'], + self::BEJA => ['bej'], + self::BELARUSIAN => ['bel', 'be'], + self::BEMBA => ['bem'], + self::BENGALI => ['ben', 'bn'], + self::BERBER => ['ber'], + self::BHOJPURI => ['bho'], + self::BIHARI => ['bih', 'bh'], + self::BIKOL => ['bik'], + self::BINI => ['bin'], + self::BISLAMA => ['bis', 'bi'], + self::SIKSIKA => ['bla'], + self::BANTU => ['bnt'], + self::TIBETAN => ['tib', 'bod', 'bo'], + self::BOSNIAN => ['bos', 'bs'], + self::BRAJ => ['bra'], + self::BRETON => ['bre'], + self::BATAK => ['btk'], + self::BURIAT => ['bua'], + self::BUGINESE => ['bug'], + self::BULGARIAN => ['bul'], + self::BURMESE => ['bur', 'mya', 'my'], + self::BLIN => ['byn'], + self::CADDO => ['cad'], + self::AMERICAN_INDIAN_CENTRAL => ['cai'], + self::GALIBI_CARIB => ['car'], + self::CATALAN => ['cat', 'ca'], + self::CAUCASIAN => ['cau'], + self::CEBUANO => ['ceb'], + self::CELTIC => ['cel'], + self::CZECH => ['cze', 'ces', 'cs'], + self::CHAMORRO => ['cha', 'ch'], + self::CHIBCHA => ['chb'], + self::CHECHEN => ['che', 'ce'], + self::CHAGATAI => ['chg'], + self::CHINESE => ['chi', 'zho', 'zh'], + self::CHUUKESE => ['chk'], + self::MARI => ['chm'], + self::CHINOOK_JARGON => ['chn'], + self::CHOCTAW => ['cho'], + self::CHIPEWYAN => ['chp'], + self::CHEROKEE => ['chr'], + self::CHURCH_SLAVIC => ['chu', 'cu'], + self::CHUVASH => ['chv', 'cv'], + self::CHEYENNE => ['chy'], + self::CHAMIC => ['cmc'], + self::COPTIC => ['cop'], + self::CORNISH => ['cor'], + self::CORSICAN => ['cos', 'co'], + self::CREOLES_ENGLISH => ['cpe'], + self::CREOLES_FRENCH => ['cpf'], + self::CREOLES_PORTUGESE => ['cpp'], + self::CREE => ['cre', 'cr'], + self::CRIMEAN_TATAR => ['crh'], + self::CREOLES => ['crp'], + self::KASHUBIAN => ['csb'], + self::CUSHITIC => ['cus'], + self::WELSH => ['wel', 'cym', 'cy'], + self::DAKOTA => ['dak'], + self::DANISH => ['dan', 'da'], + self::DARGWA => ['dar'], + self::LAND_DAYAK => ['day'], + self::DELAWARE => ['del'], + self::SLAVE => ['den'], + self::GERMAN => ['ger', 'deu', 'de'], + self::DOGRIB => ['dgr'], + self::DINKA => ['din'], + self::DIVEHI => ['div', 'dv'], + self::DOGRI => ['doi'], + self::DRAVIDIAN => ['dra'], + self::LOWER_SORBIAN => ['dsb'], + self::DUALA => ['dua'], + self::DUTCH_MIDDLE => ['dum'], + self::DUTCH_FLEMISH => ['dut', 'nld', 'nl'], + self::DYULA => ['dyu'], + self::DZONGKHA => ['dzo', 'dz'], + self::EFIK => ['efi'], + self::EGYPTIAN => ['egy'], + self::EKAJUK => ['eka'], + self::GREEK_MODERN => ['gre', 'ell', 'el'], + self::ELAMITE => ['elx'], + self::ENGLISH_MIDDLE => ['enm'], + self::ESPERANTO => ['epo', 'eo'], + self::ESTONIAN => ['est', 'et'], + self::EWE => ['ewe', 'ee'], + self::EWONDO => ['ewo'], + self::FANG => ['fan'], + self::FAROESE => ['fao', 'fo'], + self::PERSIAN => ['per', 'fas', 'fa'], + self::FANTI => ['fat'], + self::FIJIAN => ['fij', 'fj'], + self::FILIPINO => ['fil'], + self::FINNISH => ['fin', 'fi'], + self::FINNO_UGRIAN => ['fiu'], + self::FON => ['fon'], + self::FRENCH => ['fre', 'fra', 'fr'], + self::FRENCH_MIDDLE => ['frm'], + self::FRENCH_OLD => ['fro'], + self::FRISIAN_NORTHERN => ['frr'], + self::FRISIAN_EASTERN => ['frs'], + self::FRISIAN_WESTERN => ['fry', 'fy'], + self::FULAH => ['ful', 'ff'], + self::FRIULIAN => ['fur'], + self::GA => ['gaa'], + self::GAYO => ['gay'], + self::GBAYA => ['gba'], + self::GERMANIC => ['gem'], + self::GEORGIAN => ['geo', 'kat', 'ka'], + self::GEEZ => ['gez'], + self::GILBERTESE => ['gil'], + self::GAELIC => ['gla', 'gd'], + self::IRISH => ['gle', 'ga'], + self::GALICIAN => ['glg', 'gl'], + self::MANX => ['glv', 'gv'], + self::GERMAN_MIDDLE_HIGH => ['gmh'], + self::GERMAN_OLD_HIGH => ['goh'], + self::GONDI => ['gon'], + self::GORONTALO => ['gor'], + self::GOTHIC => ['got'], + self::GREBO => ['grb'], + self::GREEK_ANCIENT => ['grc'], + self::GUARANI => ['grm', 'gn'], + self::GERMAN_SWISS => ['gsw'], + self::GUJARATI => ['guj', 'gu'], + self::GWICHIN => ['gwi'], + self::HAIDA => ['hai'], + self::HAITIAN => ['hat', 'ht'], + self::HAUSA => ['hau', 'ha'], + self::HAWAIIAN => ['haw'], + self::HEBREW => ['heb', 'he'], + self::HERERO => ['her', 'hz'], + self::HILIGAYNON => ['hil'], + self::HIMACHALI => ['him'], + self::HINDI => ['hin', 'hi'], + self::HITTITE => ['hit'], + self::HMONG => ['hmn'], + self::HIRI_MOTU => ['hmo', 'ho'], + self::CROATIAN => ['hrv'], + self::SORBIAN_UPPER => ['hsb'], + self::HUNGARIAN => ['hun', 'hu'], + self::HUPA => ['hup'], + self::IBAN => ['iba'], + self::IGBO => ['ibo', 'ig'], + self::ICELANDIC => ['ice', 'isl', 'is'], + self::IDO => ['ido', 'io'], + self::SICHUAN_YI => ['iii', 'ii'], + self::IJO => ['ijo'], + self::INUKTITUT => ['iku', 'iu'], + self::INTERLINGUE => ['ile', 'ie'], + self::ILOKO => ['ilo'], + self::INTERLINGUA => ['ina', 'ia'], + self::INDIC => ['inc'], + self::INDONESIAN => ['ind', 'id'], + self::INDO_EUROPEAN => ['ine'], + self::INGUSH => ['inh'], + self::INUPIAQ => ['ipk', 'ik'], + self::IRANIAN => ['ira'], + self::IROQUOIAN => ['iro'], + self::ITALIAN => ['ita', 'it'], + self::JAVANESE => ['jav', 'jv'], + self::LOJBAN => ['jbo'], + self::JAPANESE => ['jpn', 'ja'], + self::JUDEO_PERSIAN => ['jpr'], + self::JUDEO_ARABIC => ['jrb'], + self::KARA_KALPAK => ['kaa'], + self::KABYLE => ['kab'], + self::KACHIN => ['kac'], + self::KALAALLISUT => ['kal', 'kl'], + self::KAMBA => ['kam'], + self::KANNADA => ['kan', 'kn'], + self::KAREN => ['kar'], + self::KASHMIRI => ['kas', 'ks'], + self::KANURI => ['kau', 'kr'], + self::KAWI => ['kaw'], + self::KAZAKH => ['kaz'], + self::KABARDIAN => ['kbd'], + self::KHASI => ['kha'], + self::KHOISAN => ['khi'], + self::CENTRAL_KHMER => ['khm', 'km'], + self::KHOTANESE => ['kho'], + self::KIKUYU => ['kik', 'ki'], + self::KINYARWANDA => ['kin', 'rw'], + self::KIRGHIZ => ['kir', 'ky'], + self::KIMBUNDU => ['kmb'], + self::KONKANI => ['kok'], + self::KOMI => ['kom', 'kv'], + self::KONGO => ['kon', 'kg'], + self::KOREAN => ['kor', 'ko'], + self::KOSRAEAN => ['kos'], + self::KPELLE => ['kpe'], + self::KARACHAY_BALKAR => ['krc'], + self::KARELIAN => ['krl'], + self::KRU => ['kro'], + self::KURUKH => ['kru'], + self::KUANYAMA => ['kua', 'kj'], + self::KUMYK => ['kum'], + self::KURDISH => ['kur', 'ku'], + self::KUTENAI => ['kut'], + self::LADINO => ['lad'], + self::LAHNDA => ['lah'], + self::LAMBA => ['lam'], + self::LAO => ['lao', 'lo'], + self::LATIN => ['lat', 'la'], + self::LATVIAN => ['lav', 'lv'], + self::LEZGHIAN => ['lez'], + self::LIMBURGAN => ['lim', 'li'], + self::LINGALA => ['lin', 'ln'], + self::LITHUANIAN => ['lit', 'lt'], + self::MONGO => ['lol'], + self::LOZI => ['loz'], + self::LUXEMBOURGISH => ['ltz', 'lb'], + self::LUBA_LULUA => ['lua'], + self::LUBA_KATANGA => ['lub', 'lu'], + self::GANDA => ['lug', 'lg'], + self::LUISENO => ['lui'], + self::LUNDA => ['lun'], + self::LUO => ['luo'], + self::LUSHAI => ['lus'], + self::MACEDONIAN => ['mac', 'mkd', 'mk'], + self::MADURESE => ['mad'], + self::MAGAHI => ['mag'], + self::MARSHALLESE => ['mah'], + self::MAITHILI => ['mai'], + self::MAKASAR => ['mak'], + self::MALAYALAM => ['mal'], + self::MANDINGO => ['man'], + self::MAORI => ['mao', 'mri', 'mi'], + self::AUSTRONESIAN => ['map'], + self::MARATHI => ['mar', 'mr'], + self::MASAI => ['mas'], + self::MALAY => ['may', 'msa', 'ms'], + self::MOKSHA => ['mdf'], + self::MANDAR => ['mdr'], + self::MENDE => ['men'], + self::IRISH_MIDDLE => ['mga'], + self::MIKMAQ => ['mic'], + self::MINANGKABAU => ['min'], + self::UNCODED => ['mis'], + self::MON_KHMER => ['mkh'], + self::MALAGASY => ['mlg'], + self::MALTESE => ['mlt'], + self::MANCHU => ['mnc'], + self::MANIPURI => ['mni'], + self::MANOBO => ['mno'], + self::MOHAWK => ['moh'], + self::MONGOLIAN => ['mon', 'mn'], + self::MOSSI => ['mos'], + self::MULTIPLE => ['mul'], + self::MUNDA => ['mun'], + self::CREEK => ['mus'], + self::MIRANDESE => ['mwl'], + self::MARWARI => ['mwr'], + self::MAYAN => ['myn'], + self::ERZYA => ['myv'], + self::NAHUATL => ['nah'], + self::AMERICAN_INDIAN_NORTH => ['nai'], + self::NEAPOLITAN => ['nap'], + self::NAURU => ['nau', 'na'], + self::NAVAJO => ['nav', 'nv'], + self::NDEBELE_SOUTH => ['nbl', 'nr'], + self::NDEBELE_NORTH => ['nde', 'nd'], + self::NDONGA => ['ndo', 'ng'], + self::LOW_GERMAN => ['nds'], + self::NEPALI => ['nep', 'ne'], + self::NEPAL_BHASA => ['new'], + self::NIAS => ['nia'], + self::NIGER_KORDOFANIAN => ['nic'], + self::NIUEAN => ['niu'], + self::NORWEGIAN_NYNORSK => ['nno', 'nn'], + self::BOKMAL => ['nob', 'nb'], + self::NOGAI => ['nog'], + self::NORSE_OLD => ['non'], + self::NORWEGIAN => ['nor', 'no'], + self::NKO => ['nqo'], + self::PEDI => ['nso'], + self::NUBIAN => ['nub'], + self::CLASSICAL_NEWARI => ['nwc'], + self::CHICHEWA => ['nya', 'ny'], + self::NYAMWEZI => ['nym'], + self::NYANKOLE => ['nyn'], + self::NYORO => ['nyo'], + self::NZIMA => ['nzi'], + self::OCCITAN => ['oci', 'oc'], + self::OJIBWA => ['oji', 'oj'], + self::ORIYA => ['ori', 'or'], + self::OROMO => ['orm', 'om'], + self::OSAGE => ['osa'], + self::OSSETIAN => ['oss', 'os'], + self::OTTOMAN => ['ota'], + self::OTOMIAN => ['oto'], + self::PAPUAN => ['paa'], + self::PANGASINAN => ['pag'], + self::PAHLAVI => ['pal'], + self::PAMPANGA => ['pam'], + self::PANJABI => ['pan', 'pa'], + self::PAPIAMENTO => ['pap'], + self::PALAUAN => ['pau'], + self::PERSIAN_OLD => ['peo'], + self::PHILIPPINE => ['phi'], + self::PHOENICIAN => ['phn'], + self::PALI => ['pli', 'pi'], + self::POLISH => ['pol', 'pl'], + self::POHNPEIAN => ['pon'], + self::PORTUGUESE => ['por', 'pt'], + self::PRAKRIT => ['pra'], + self::PROVENCAL => ['pro'], + self::PUSHTO => ['pus', 'ps'], + self::QUECHUA => ['que', 'qu'], + self::RAJASTHANI => ['raj'], + self::RAPANUI => ['rap'], + self::RAROTONGAN => ['rar'], + self::ROMANCE => ['roa'], + self::ROMANSH => ['roh', 'rm'], + self::ROMANY => ['rom'], + self::ROMANIAN => ['rum', 'ron', 'ro'], + self::RUNDI => ['run', 'rn'], + self::AROMANIAN => ['rup'], + self::RUSSIAN => ['rus', 'ru'], + self::SANDAWE => ['sad'], + self::SANGO => ['sag', 'sg'], + self::YAKUT => ['sah'], + self::AMERICAN_INDIAN_SOUTH => ['sai'], + self::SALISHAN => ['sal'], + self::SAMARITAN => ['sam'], + self::SANSKRIT => ['san', 'sa'], + self::SASAK => ['sas'], + self::SANTALI => ['sat'], + self::SICILIAN => ['scn'], + self::SCOTS => ['sco'], + self::SELKUP => ['sel'], + self::SEMITIC => ['sem'], + self::IRISH_OLD => ['sga'], + self::SIGN => ['sgn'], + self::SHAN => ['shn'], + self::SIDAMO => ['sid'], + self::SINHALA => ['sin', 'si'], + self::SIOUAN => ['sio'], + self::SINO_TIBETAN => ['sit'], + self::SLAVIC => ['sla'], + self::SLOVAK => ['slo', 'slk', 'sk'], + self::SLOVENIAN => ['slv', 'sl'], + self::SAMI_SOUTHERN => ['sma'], + self::SAMI_NORTHERN => ['sme', 'se'], + self::SAMI => ['smi'], + self::SAMI_LULE => ['smj'], + self::SAMI_IRARI => ['smn'], + self::SAMOAN => ['smo', 'sm'], + self::SAMI_SKOLT => ['sms'], + self::SHONA => ['sna', 'sn'], + self::SINDHI => ['snd', 'sd'], + self::SONINKE => ['snk'], + self::SOGDIAN => ['sog'], + self::SOMALI => ['som', 'so'], + self::SONGHAI => ['son'], + self::SOTHO_SOUTHERN => ['sot', 'st'], + self::SPANISH => ['spa', 'es'], + self::SARDINIAN => ['srd', 'sc'], + self::SRANAN_TONGO => ['sm'], + self::SERBIAN => ['srp', 'sr'], + self::SERER => ['srr'], + self::NILO_SAHARAN => ['ssa'], + self::SWATI => ['ssw', 'ss'], + self::SUKUMA => ['suk'], + self::SUNDANESE => ['sun', 'su'], + self::SUSU => ['sus'], + self::SUMERIAN => ['sux'], + self::SWAHILI => ['swa', 'sw'], + self::SWEDISH => ['swe', 'sv'], + self::SYRIAC_CLASSICAL => ['syc'], + self::SYRIAC => ['syr'], + self::TAHITIAN => ['tah', 'ty'], + self::TAI => ['tai'], + self::TAMIL => ['tam', 'ta'], + self::TATAR => ['tat', 'tt'], + self::TELUGU => ['tel', 'te'], + self::TIMNE => ['tem'], + self::TERENO => ['ter'], + self::TETUM => ['tet'], + self::TAJIK => ['tgk', 'tg'], + self::TAGALOG => ['tgl', 'tl'], + self::THAI => ['tha', 'th'], + self::TIGRE => ['tig'], + self::TIGRINYA => ['tir', 'ti'], + self::TIV => ['tiv'], + self::TOKELAU => ['tkl'], + self::KLINGON => ['tlh'], + self::TLINGIT => ['tli'], + self::TAMASHEK => ['tmh'], + self::TONGA_NYASA => ['tog'], + self::TONGA_ISLANDS => ['ton', 'to'], + self::TOK_PISIN => ['tpi'], + self::TSIMSHIAN => ['tsi'], + self::TSWANA => ['tsn', 'tn'], + self::TSONGA => ['tso', 'ts'], + self::TURKMEN => ['tuk', 'tk'], + self::TUMBUKA => ['tum'], + self::TUPI => ['tup'], + self::TURKISH => ['tur', 'tr'], + self::ALTAIC => ['tut'], + self::TUVALU => ['tvl'], + self::TWI => ['twi', 'tw'], + self::TUVINIAN => ['tyv'], + self::UDMURT => ['udm'], + self::UGARITIC => ['uga'], + self::UIGHUR => ['uig', 'ug'], + self::UKRAINIAN => ['ukr', 'uk'], + self::UMBUNDU => ['umb'], + self::UNDETERMINED => ['und'], + self::URDU => ['urd', 'ur'], + self::UZBEK => ['uzb', 'uz'], + self::VAI => ['vai'], + self::VENDA => ['ven', 've'], + self::VIETNAMESE => ['vie', 'vi'], + self::VOLAPUK => ['vol', 'vo'], + self::VOTIC => ['vot'], + self::WAKASHAN => ['wak'], + self::WOLAITTA => ['wal'], + self::WARAY => ['war'], + self::WASHO => ['was'], + self::SORBIAN => ['wen'], + self::WALLOON => ['wln', 'wa'], + self::WOLOF => ['wol', 'wo'], + self::KALMYK => ['xal'], + self::XHOSA => ['xho', 'xh'], + self::YAO => ['yao'], + self::YAPESE => ['yap'], + self::YIDDISH => ['yid', 'yi'], + self::YORUBA => ['yor', 'yo'], + self::YUPIK => ['ypk'], + self::ZAPOTEC => ['zap'], + self::BLISSYMBOLS => ['zbl'], + self::ZENAGA => ['zen'], + self::MOROCCAN_TAMAZIGHT => ['zgh'], + self::ZHUANG => ['zha', 'za'], + self::ZANDE => ['znd'], + self::ZULU => ['zul', 'zu'], + self::ZUNI => ['zun'], + self::NOT_APPLICABLE => ['zxx'], + self::ZAZA => ['zza'], + ]; + + private static $s_names = [ + self::ENGLISH_US => ['US English'], + self::ENGLISH => ['English'], + self::ENGLISH_CA => ['Canadian English'], + self::ENGLISH_GB => ['British English'], + self::AFAR => ['Afar'], + self::ABKHAZIAN => ['Abkhazian'], + self::ACHINESE => ['Achinese'], + self::ACOLI => ['Acoli'], + self::ADANGME => ['Adangme'], + self::ADYGHE => ['Adyghe'], + self::AFRO_ASIATIC => ['Afro-Asiatic', 'Adygei'], + self::AFRIHILI => ['Afrihili'], + self::AFRIKAANS => ['Afrikaans'], + self::AINU => ['Ainu'], + self::AKAN => ['Akan'], + self::AKKADIAN => ['Akkadian'], + self::ALBANIAN => ['Albanian'], + self::ALEUT => ['Aleut'], + self::ALGONQUIAN => ['Algonquian'], + self::SOUTHERN_ALTAI => ['Southern Altai'], + self::AMHARIC => ['Amharic'], + self::ENGLISH_OLD => ['Old English'], + self::ANGIKA => ['Angika'], + self::APACHE => ['Apache'], + self::ARABIC => ['Arabic'], + self::ARAMAIC => ['Official Aramaic', 'Imperial Aramaic'], + self::ARAGONESE => ['Aragonese'], + self::ARMENIAN => ['Armenian'], + self::MAPUDUNGUN => ['Mapudungun', 'Mapuche'], + self::ARAPAHO => ['Arapaho'], + self::ARTIFICIAL => ['Artificial'], + self::ARAWAK => ['Arawak'], + self::ASSAMESE => ['Assamese'], + self::ASTURIAN => ['Asturian', 'Bable', 'Leonese', 'Asturleonese'], + self::ATHAPASCAN => ['Athapascan'], + self::AUSTRALIAN => ['Australian'], + self::AVARIC => ['Avaric'], + self::AVESTAN => ['Avestan'], + self::AWADHI => ['Awadhi'], + self::AYMARA => ['Aymara'], + self::AZERBAIJANI => ['Azerbaijani'], + self::BANDA => ['Banda'], + self::BAMILEKE => ['Bamileke'], + self::BASHKIR => ['Bashkir'], + self::BALUCHI => ['Baluchi'], + self::BAMBARA => ['Bambara'], + self::BALINESE => ['Balinese'], + self::BASQUE => ['Basque'], + self::BASA => ['Basa'], + self::BALTIC => ['Baltic'], + self::BEJA => ['Beja'], + self::BELARUSIAN => ['Belarusian'], + self::BEMBA => ['Bemba'], + self::BENGALI => ['Bengali'], + self::BERBER => ['Berber'], + self::BHOJPURI => ['Bhojpuri'], + self::BIHARI => ['Bihari'], + self::BIKOL => ['Bikol'], + self::BINI => ['Bini', 'Edo'], + self::BISLAMA => ['Bislama'], + self::SIKSIKA => ['Siksika'], + self::BANTU => ['Bantu'], + self::TIBETAN => ['Tibetan'], + self::BOSNIAN => ['Bosnian'], + self::BRAJ => ['Braj'], + self::BRETON => ['Breton'], + self::BATAK => ['Batak'], + self::BURIAT => ['Buriat'], + self::BUGINESE => ['Buginese'], + self::BULGARIAN => ['Bulgarian'], + self::BURMESE => ['Burmese'], + self::BLIN => ['Blin', 'Bilin'], + self::CADDO => ['Caddo'], + self::AMERICAN_INDIAN_CENTRAL => ['Central American Indian'], + self::GALIBI_CARIB => ['Galibi Carib'], + self::CATALAN => ['Catalan', 'Valencian'], + self::CAUCASIAN => ['Caucasian'], + self::CEBUANO => ['Cebuano'], + self::CELTIC => ['Celtic'], + self::CZECH => ['Czech'], + self::CHAMORRO => ['Chamorro'], + self::CHIBCHA => ['Chibcha'], + self::CHECHEN => ['Chechen'], + self::CHAGATAI => ['Chagatai'], + self::CHINESE => ['Chinese'], + self::CHUUKESE => ['Chuukese'], + self::MARI => ['Mari'], + self::CHINOOK_JARGON => ['Chinook jargon'], + self::CHOCTAW => ['Choctaw'], + self::CHIPEWYAN => ['Chipewyan', 'Dene Suline'], + self::CHEROKEE => ['Cherokee'], + self::CHURCH_SLAVIC => ['Church Slavic', 'Old Slavonic', 'Church Slavonic', 'Old Bulgarian', 'Old Church Slavonic'], + self::CHUVASH => ['Chuvash'], + self::CHEYENNE => ['Cheyenne'], + self::CHAMIC => ['Chamic'], + self::COPTIC => ['Coptic'], + self::CORNISH => ['Cornish'], + self::CORSICAN => ['Corsican'], + self::CREOLES_ENGLISH => ['Creoles and Pidgins, English Based'], + self::CREOLES_FRENCH => ['Creoles and Pidgins, French Based'], + self::CREOLES_PORTUGESE => ['Creoles and Pidgins, Portugese Based'], + self::CREE => ['Cree'], + self::CRIMEAN_TATAR => ['Crimean Tatar', 'Crimean Turkish'], + self::CREOLES => ['Creoles and Pidgins'], + self::KASHUBIAN => ['Kashubian'], + self::CUSHITIC => ['Cushitic'], + self::WELSH => ['Welsh'], + self::DAKOTA => ['Dakota'], + self::DANISH => ['Danish'], + self::DARGWA => ['Dargwa'], + self::LAND_DAYAK => ['Land Dayak'], + self::DELAWARE => ['Delaware'], + self::SLAVE => ['Athapascan Slave'], + self::GERMAN => ['German'], + self::DOGRIB => ['Dogrib'], + self::DINKA => ['Dinka'], + self::DIVEHI => ['Divehi', 'Dhivehi', 'Maldivian'], + self::DOGRI => ['Dogri'], + self::DRAVIDIAN => ['Dravidian'], + self::LOWER_SORBIAN => ['Lower Sorbian'], + self::DUALA => ['Duala'], + self::DUTCH_MIDDLE => ['Middle Dutch'], + self::DUTCH_FLEMISH => ['Dutch', 'Flemish'], + self::DYULA => ['Dyula'], + self::DZONGKHA => ['Dzongkha'], + self::EFIK => ['Efik'], + self::EGYPTIAN => ['Ancient Egyptian'], + self::EKAJUK => ['Ekajuk'], + self::GREEK_MODERN => ['Modern Greek'], + self::ELAMITE => ['Elamite'], + self::ENGLISH_MIDDLE => ['Middle English'], + self::ESPERANTO => ['Esperanto'], + self::ESTONIAN => ['Estonian'], + self::EWE => ['Ewe'], + self::EWONDO => ['Ewondo'], + self::FANG => ['Fang'], + self::FAROESE => ['Faroese'], + self::PERSIAN => ['Persian'], + self::FANTI => ['Fanti'], + self::FIJIAN => ['Fijian'], + self::FILIPINO => ['Filipino', 'Pilipino'], + self::FINNISH => ['Finnish'], + self::FINNO_UGRIAN => ['Finno-Ugrian '], + self::FON => ['Fon'], + self::FRENCH => ['French'], + self::FRENCH_MIDDLE => ['Middle French'], + self::FRENCH_OLD => ['Old French'], + self::FRISIAN_NORTHERN => ['Northern Frisian'], + self::FRISIAN_EASTERN => ['Eastern Frisian'], + self::FRISIAN_WESTERN => ['Southern Frisian'], + self::FULAH => ['Fulah'], + self::FRIULIAN => ['Friulian'], + self::GA => ['Ga'], + self::GAYO => ['Gayo'], + self::GBAYA => ['Gbaya'], + self::GERMANIC => ['Germanic'], + self::GEORGIAN => ['Georgian'], + self::GEEZ => ['Geez'], + self::GILBERTESE => ['Gilbertese'], + self::GAELIC => ['Gaelic', 'Scottish Gaelic'], + self::IRISH => ['Irish'], + self::GALICIAN => ['Galician'], + self::MANX => ['Manx'], + self::GERMAN_MIDDLE_HIGH => ['Middle High German'], + self::GERMAN_OLD_HIGH => ['Old High German'], + self::GONDI => ['Gondi'], + self::GORONTALO => ['Gorontalo'], + self::GOTHIC => ['Gothic'], + self::GREBO => ['Grebo'], + self::GREEK_ANCIENT => ['Ancient Greek'], + self::GUARANI => ['Guarani'], + self::GERMAN_SWISS => ['Swiss German', 'Alemannic', 'Alsatian'], + self::GUJARATI => ['Gujarati'], + self::GWICHIN => ['Gwich\'in'], + self::HAIDA => ['Haida'], + self::HAITIAN => ['Haitian', 'Haitian Creole'], + self::HAUSA => ['Hausa'], + self::HAWAIIAN => ['Hawaiian'], + self::HEBREW => ['Hebrew'], + self::HERERO => ['Herero'], + self::HILIGAYNON => ['Hiligaynon'], + self::HIMACHALI => ['Himachali', 'Western Pahari'], + self::HINDI => ['Hindi'], + self::HITTITE => ['Hittite'], + self::HMONG => ['Hmong', 'Mong'], + self::HIRI_MOTU => ['Hiri Motu'], + self::CROATIAN => ['Croatian'], + self::SORBIAN_UPPER => ['Upper Sorbian'], + self::HUNGARIAN => ['Hungarian'], + self::HUPA => ['Hupa'], + self::IBAN => ['Iban'], + self::IGBO => ['Igbo'], + self::ICELANDIC => ['Icelandic'], + self::IDO => ['Ido'], + self::SICHUAN_YI => ['Sichuan Yi', 'Nuosu'], + self::IJO => ['Ijo'], + self::INUKTITUT => ['Inuktitut'], + self::INTERLINGUE => ['Interlingue'], + self::ILOKO => ['Iloko'], + self::INTERLINGUA => ['Interlingua'], + self::INDIC => ['Indic'], + self::INDONESIAN => ['Indonesian'], + self::INDO_EUROPEAN => ['Indo-European'], + self::INGUSH => ['Ingush'], + self::INUPIAQ => ['Inupiaq'], + self::IRANIAN => ['Iranian'], + self::IROQUOIAN => ['Iroquoian'], + self::ITALIAN => ['Italian'], + self::JAVANESE => ['Javanese'], + self::LOJBAN => ['Lojban'], + self::JAPANESE => ['Japanese'], + self::JUDEO_PERSIAN => ['Judeo-Persian'], + self::JUDEO_ARABIC => ['Judeo-Arabic'], + self::KARA_KALPAK => ['Kara-Kalpak'], + self::KABYLE => ['Kabyle'], + self::KACHIN => ['Kachin', 'Jingpho'], + self::KALAALLISUT => ['Kalaallisut', 'Greenlandic'], + self::KAMBA => ['Kamba'], + self::KANNADA => ['Kannada'], + self::KAREN => ['Karen'], + self::KASHMIRI => ['Kashmiri'], + self::KANURI => ['Kanuri'], + self::KAWI => ['Kawi'], + self::KAZAKH => ['Kazakh'], + self::KABARDIAN => ['Kabardian'], + self::KHASI => ['Khasi'], + self::KHOISAN => ['Khoisan'], + self::CENTRAL_KHMER => ['Central Khmer'], + self::KHOTANESE => ['Khotanese', 'Sakan'], + self::KIKUYU => ['Kikuyu', 'Gikuyu'], + self::KINYARWANDA => ['Kinyarwanda'], + self::KIRGHIZ => ['Kirghiz', 'Kyrgyz'], + self::KIMBUNDU => ['Kimbundu'], + self::KONKANI => ['Konkani'], + self::KOMI => ['Komi'], + self::KONGO => ['Kongo'], + self::KOREAN => ['Korean'], + self::KOSRAEAN => ['Kosraean'], + self::KPELLE => ['Kpelle'], + self::KARACHAY_BALKAR => ['Karachay-Balkar'], + self::KARELIAN => ['Karelian'], + self::KRU => ['Kru'], + self::KURUKH => ['Kurukh'], + self::KUANYAMA => ['Kuanyama', 'Kwanyama'], + self::KUMYK => ['Kumyk'], + self::KURDISH => ['Kurdish'], + self::KUTENAI => ['Kutenai'], + self::LADINO => ['Ladino'], + self::LAHNDA => ['Lahnda'], + self::LAMBA => ['Lamba'], + self::LAO => ['Lao'], + self::LATIN => ['Latin'], + self::LATVIAN => ['Latvian'], + self::LEZGHIAN => ['Lezghian'], + self::LIMBURGAN => ['Limburgan', 'Limburger', 'Limburgish'], + self::LINGALA => ['Lingala'], + self::LITHUANIAN => ['Lithuanian'], + self::MONGO => ['Mongo'], + self::LOZI => ['Lozi'], + self::LUXEMBOURGISH => ['Luxembourgish', 'Letzeburgesch'], + self::LUBA_LULUA => ['Luba-Lulua'], + self::LUBA_KATANGA => ['Luba-Katanga'], + self::GANDA => ['Ganda'], + self::LUISENO => ['Luiseno'], + self::LUNDA => ['Lunda'], + self::LUO => ['Luo'], + self::LUSHAI => ['Lushai'], + self::MACEDONIAN => ['Macedonian'], + self::MADURESE => ['Madurese'], + self::MAGAHI => ['Magahi'], + self::MARSHALLESE => ['Marshallese'], + self::MAITHILI => ['Maithili'], + self::MAKASAR => ['Makasar'], + self::MALAYALAM => ['Malayalam'], + self::MANDINGO => ['Mandingo'], + self::MAORI => ['Maori'], + self::AUSTRONESIAN => ['Austronesian'], + self::MARATHI => ['Marathi'], + self::MASAI => ['Masai'], + self::MALAY => ['Malay'], + self::MOKSHA => ['Moksha'], + self::MANDAR => ['Mandar'], + self::MENDE => ['Mende'], + self::IRISH_MIDDLE => ['Middle Irish'], + self::MIKMAQ => ['Mi\'kmaq', 'Micmac'], + self::MINANGKABAU => ['Minangkabau'], + self::UNCODED => ['Uncoded'], + self::MON_KHMER => ['Mon-Khmer'], + self::MALAGASY => ['Malagasy'], + self::MALTESE => ['Maltese'], + self::MANCHU => ['Manchu'], + self::MANIPURI => ['Manipuri'], + self::MANOBO => ['Manobo'], + self::MOHAWK => ['Mohawk'], + self::MONGOLIAN => ['Mongolian'], + self::MOSSI => ['Mossi'], + self::MULTIPLE => ['Multiple'], + self::MUNDA => ['Munda'], + self::CREEK => ['Creek'], + self::MIRANDESE => ['Mirandese'], + self::MARWARI => ['Marwari'], + self::MAYAN => ['Mayan'], + self::ERZYA => ['Erzya'], + self::NAHUATL => ['Nahuatl'], + self::AMERICAN_INDIAN_NORTH => ['North American Indian'], + self::NEAPOLITAN => ['Neapolitan'], + self::NAURU => ['Nauru'], + self::NAVAJO => ['Navajo', 'Navaho'], + self::NDEBELE_SOUTH => ['South Ndebele'], + self::NDEBELE_NORTH => ['North Ndebele'], + self::NDONGA => ['Ndonga'], + self::LOW_GERMAN => ['Low German', 'Low Saxon'], + self::NEPALI => ['Nepali'], + self::NEPAL_BHASA => ['Nepal Bhasa', 'Newari'], + self::NIAS => ['Nias'], + self::NIGER_KORDOFANIAN => ['Niger-Kordofanian'], + self::NIUEAN => ['Niuean'], + self::NORWEGIAN_NYNORSK => ['Norwegian Nynorsk'], + self::BOKMAL => ['Bokmål', 'Norwegian Bokmål'], + self::NOGAI => ['Nogai'], + self::NORSE_OLD => ['Old Norse'], + self::NORWEGIAN => ['Norwegian'], + self::NKO => ['N\'Ko'], + self::PEDI => ['Pedi', 'Sepedi', 'Northern Sotho'], + self::NUBIAN => ['Nubian'], + self::CLASSICAL_NEWARI => ['Classical Newari', 'Old Newari', 'Classical Nepal Bhasa'], + self::CHICHEWA => ['Chichewa', 'Chewa', 'Nyanja'], + self::NYAMWEZI => ['Nyamwezi'], + self::NYANKOLE => ['Nyankole'], + self::NYORO => ['Nyoro'], + self::NZIMA => ['Nzima'], + self::OCCITAN => ['Occitan'], + self::OJIBWA => ['Ojibwa'], + self::ORIYA => ['Oriya'], + self::OROMO => ['Oromo'], + self::OSAGE => ['Osage'], + self::OSSETIAN => ['Ossetian', 'Ossetic'], + self::OTTOMAN => ['Ottoman Turkish'], + self::OTOMIAN => ['Otomian'], + self::PAPUAN => ['Papuan'], + self::PANGASINAN => ['Pangasinan'], + self::PAHLAVI => ['Pahlavi'], + self::PAMPANGA => ['Pampanga', 'Kapampangan'], + self::PANJABI => ['Panjabi', 'Punjabi'], + self::PAPIAMENTO => ['Papiamento'], + self::PALAUAN => ['Palauan'], + self::PERSIAN_OLD => ['Old Persian'], + self::PHILIPPINE => ['Philippine'], + self::PHOENICIAN => ['Phoenician'], + self::PALI => ['Pali'], + self::POLISH => ['Polish'], + self::POHNPEIAN => ['Pohnpeian'], + self::PORTUGUESE => ['Portuguese'], + self::PRAKRIT => ['Prakrit'], + self::PROVENCAL => ['Old Provençal', 'Old Occitan'], + self::PUSHTO => ['Pushto', 'Pashto'], + self::QUECHUA => ['Quechua'], + self::RAJASTHANI => ['Rajasthani'], + self::RAPANUI => ['Rapanui'], + self::RAROTONGAN => ['Rarotongan', 'Cook Islands Maori'], + self::ROMANCE => ['Romance'], + self::ROMANSH => ['Romansh'], + self::ROMANY => ['Romany'], + self::ROMANIAN => ['Romanian', 'Moldavian', 'Moldovan'], + self::RUNDI => ['Rundi'], + self::AROMANIAN => ['Aromanian', 'Arumanian', 'Macedo-Romanian'], + self::RUSSIAN => ['Russian'], + self::SANDAWE => ['Sandawe'], + self::SANGO => ['Sango'], + self::YAKUT => ['Yakut'], + self::AMERICAN_INDIAN_SOUTH => ['South American Indian'], + self::SALISHAN => ['Salishan'], + self::SAMARITAN => ['Samaritan'], + self::SANSKRIT => ['Sanskrit'], + self::SASAK => ['Sasak'], + self::SANTALI => ['Santali'], + self::SICILIAN => ['Sicilian'], + self::SCOTS => ['Scots'], + self::SELKUP => ['Selkup'], + self::SEMITIC => ['Semitic'], + self::IRISH_OLD => ['Old Irish'], + self::SIGN => ['Sign Language'], + self::SHAN => ['Shan'], + self::SIDAMO => ['Sidamo'], + self::SINHALA => ['Sinhala', 'Sinhalese'], + self::SIOUAN => ['Siouan'], + self::SINO_TIBETAN => ['Sino-Tibetan'], + self::SLAVIC => ['Slavic'], + self::SLOVAK => ['Slovak'], + self::SLOVENIAN => ['Slovenian'], + self::SAMI_SOUTHERN => ['Southern Sami'], + self::SAMI_NORTHERN => ['Northern Sami'], + self::SAMI => ['Sami'], + self::SAMI_LULE => ['Lule Sami'], + self::SAMI_IRARI => ['Inari Sami'], + self::SAMOAN => ['Samoan'], + self::SAMI_SKOLT => ['Skolt Sami'], + self::SHONA => ['Shona'], + self::SINDHI => ['Sindhi'], + self::SONINKE => ['Soninke'], + self::SOGDIAN => ['Sogdian'], + self::SOMALI => ['Somali'], + self::SONGHAI => ['Songhai'], + self::SOTHO_SOUTHERN => ['Southern Sotho'], + self::SPANISH => ['Spanish', 'Castilian'], + self::SARDINIAN => ['Sardinian'], + self::SRANAN_TONGO => ['Sranan Tongo'], + self::SERBIAN => ['Serbian'], + self::SERER => ['Serer'], + self::NILO_SAHARAN => ['Nilo-Saharan'], + self::SWATI => ['Swati'], + self::SUKUMA => ['Sukuma'], + self::SUNDANESE => ['Sundanese'], + self::SUSU => ['Susu'], + self::SUMERIAN => ['Sumerian'], + self::SWAHILI => ['Swahili'], + self::SWEDISH => ['Swedish'], + self::SYRIAC_CLASSICAL => ['Classical Syriac'], + self::SYRIAC => ['Syriac'], + self::TAHITIAN => ['Tahitian'], + self::TAI => ['Tai'], + self::TAMIL => ['Tamil'], + self::TATAR => ['Tatar'], + self::TELUGU => ['Telugu'], + self::TIMNE => ['Timne'], + self::TERENO => ['Tereno'], + self::TETUM => ['Tetum'], + self::TAJIK => ['Tajik'], + self::TAGALOG => ['Tagalog'], + self::THAI => ['Thai'], + self::TIGRE => ['Tigre'], + self::TIGRINYA => ['Tigrinya'], + self::TIV => ['Tiv'], + self::TOKELAU => ['Tokelau'], + self::KLINGON => ['Klingon', 'tlhIngan-Hol'], + self::TLINGIT => ['Tlingit'], + self::TAMASHEK => ['Tamashek'], + self::TONGA_NYASA => ['Nyasa Tonga'], + self::TONGA_ISLANDS => ['Tonga Islands Tonga', 'to'], + self::TOK_PISIN => ['Tok Pisin'], + self::TSIMSHIAN => ['Tsimshian'], + self::TSWANA => ['Tswana'], + self::TSONGA => ['Tsonga'], + self::TURKMEN => ['Turkmen'], + self::TUMBUKA => ['Tumbuka'], + self::TUPI => ['Tupi'], + self::TURKISH => ['Turkish'], + self::ALTAIC => ['Altaic'], + self::TUVALU => ['Tuvalu'], + self::TWI => ['Twi'], + self::TUVINIAN => ['Tuvinian'], + self::UDMURT => ['Udmurt'], + self::UGARITIC => ['Ugaritic'], + self::UIGHUR => ['Uighur', 'Uyghur'], + self::UKRAINIAN => ['Ukrainian'], + self::UMBUNDU => ['Umbundu'], + self::UNDETERMINED => ['Undetermined'], + self::URDU => ['Urdu'], + self::UZBEK => ['Uzbek'], + self::VAI => ['Vai'], + self::VENDA => ['Venda'], + self::VIETNAMESE => ['Vietnamese'], + self::VOLAPUK => ['Volapük'], + self::VOTIC => ['Votic'], + self::WAKASHAN => ['Wakashan'], + self::WOLAITTA => ['Wolaitta', 'Wolaytta'], + self::WARAY => ['Waray'], + self::WASHO => ['Washo'], + self::SORBIAN => ['Sorbian'], + self::WALLOON => ['Walloon'], + self::WOLOF => ['Wolof'], + self::KALMYK => ['Kalmyk', 'Oirat'], + self::XHOSA => ['Xhosa'], + self::YAO => ['Yao'], + self::YAPESE => ['Yapese'], + self::YIDDISH => ['Yiddish'], + self::YORUBA => ['Yoruba'], + self::YUPIK => ['Yupik'], + self::ZAPOTEC => ['Zapotec'], + self::BLISSYMBOLS => ['Blissymbols', 'Blissymbolics', 'Bliss'], + self::ZENAGA => ['Zenaga'], + self::MOROCCAN_TAMAZIGHT => ['Standard Moroccan Tamazight'], + self::ZHUANG => ['Zhuang', 'Chuang'], + self::ZANDE => ['Zande'], + self::ZULU => ['Zulu'], + self::ZUNI => ['Zuni'], + self::NOT_APPLICABLE => ['No Linguistic Content', 'Not Applicable'], + self::ZAZA => ['Zaza', 'Dimili', 'Dimli', 'Kirdki', 'Kirmanjki', 'Zazaki'], + ]; + + private static $s_ids = [ 'en-us' => self::ENGLISH_US, 'en' => self::ENGLISH, 'eng' => self::ENGLISH, @@ -2716,11 +2716,11 @@ final class c_base_languages_all implements i_base_languages { 'zun' => self::ZUNI, 'zxx' => self::NOT_APPLICABLE, 'zza' => self::ZAZA, - ); + ]; - private static $s_rtl_ids = array( + private static $s_rtl_ids = [ // @todo: populate this with $id => $id. - ); + ]; /** @@ -2728,8 +2728,8 @@ final class c_base_languages_all implements i_base_languages { */ public static function s_get_names_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($id, self::$s_names)) { @@ -2744,8 +2744,8 @@ final class c_base_languages_all implements i_base_languages { */ public static function s_get_names_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($alias, self::$s_ids) && array_key_exists(self::$s_ids[$alias], self::$s_names)) { @@ -2760,7 +2760,7 @@ final class c_base_languages_all implements i_base_languages { */ public static function s_get_id_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -2776,7 +2776,7 @@ final class c_base_languages_all implements i_base_languages { */ public static function s_get_id_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -2792,8 +2792,8 @@ final class c_base_languages_all implements i_base_languages { */ public static function s_get_aliases_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($id, self::$s_aliases)) { @@ -2808,8 +2808,8 @@ final class c_base_languages_all implements i_base_languages { */ public static function s_get_aliases_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } if (array_key_exists($name, self::$s_aliases)) { @@ -2837,7 +2837,7 @@ final class c_base_languages_all implements i_base_languages { * Implementation of s_get_ids(). */ public static function s_get_ids() { - $ids = array(); + $ids = []; foreach (self::$s_aliases as $key => $value) { $ids[$key] = $key; } diff --git a/common/base/classes/base_ldap.php b/common/base/classes/base_ldap.php index d3f33d5..85b48b8 100644 --- a/common/base/classes/base_ldap.php +++ b/common/base/classes/base_ldap.php @@ -79,7 +79,7 @@ class c_base_ldap extends c_base_return { */ public function set_name($name) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -87,7 +87,7 @@ class c_base_ldap extends c_base_return { $parsed = parse_url($name, PHP_URL_HOST); if ($parsed === FALSE) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'parse_url', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'parse_url', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -119,7 +119,7 @@ class c_base_ldap extends c_base_return { */ public function set_bind_name($name) { if (!is_null($name) && (!is_string($name) || empty($name))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -149,7 +149,7 @@ class c_base_ldap extends c_base_return { */ public function set_bind_password($password) { if (!is_null($password) && (!is_string($password) || empty($password))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -181,7 +181,7 @@ class c_base_ldap extends c_base_return { */ public function do_connect() { if (is_null($this->name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -194,7 +194,7 @@ class c_base_ldap extends c_base_return { if (!is_resource($this->ldap)) { $this->ldap = NULL; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_connect', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_connect', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -205,7 +205,7 @@ class c_base_ldap extends c_base_return { } unset($bound); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::FUNCTION_FAILURE); return c_base_return_error::s_false($error); } @@ -232,7 +232,7 @@ class c_base_ldap extends c_base_return { } unset($unbound); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_unbind', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_unbind', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -266,32 +266,32 @@ class c_base_ldap extends c_base_return { */ public function do_search($directory_name, $filter, $attributes, $attributes_only = FALSE, $entry_limit = 0, $time_limit = 0, $dereference = LDAP_DEREF_NEVER) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($directory_name) || !is_string($filter)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($attributes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($entry_limit) || $entry_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($time_limit) || $time_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($dereference)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -307,7 +307,7 @@ class c_base_ldap extends c_base_return { } unset($found); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_search', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_search', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -341,37 +341,37 @@ class c_base_ldap extends c_base_return { */ public function do_list($directory_name, $filter, $attributes, $attributes_only = FALSE, $entry_limit = 0, $time_limit = 0, $dereference = LDAP_DEREF_NEVER) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($directory_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($filter)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'filter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'filter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($attributes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($entry_limit) || $entry_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($time_limit) || $time_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($dereference)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -387,7 +387,7 @@ class c_base_ldap extends c_base_return { } unset($found); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -421,37 +421,37 @@ class c_base_ldap extends c_base_return { */ public function do_read($directory_name, $filter, $attributes, $attributes_only = FALSE, $entry_limit = 0, $time_limit = 0, $dereference = LDAP_DEREF_NEVER) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($directory_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($filter)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'filter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'filter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($attributes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($entry_limit) || $entry_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($time_limit) || $time_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($dereference)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -467,7 +467,7 @@ class c_base_ldap extends c_base_return { } unset($found); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_read', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_read', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -490,22 +490,22 @@ class c_base_ldap extends c_base_return { */ public function do_compare($directory_name, $attribute, $value) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($directory_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attibute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attibute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -513,7 +513,7 @@ class c_base_ldap extends c_base_return { if ($result === -1) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_compare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_compare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -536,7 +536,7 @@ class c_base_ldap extends c_base_return { */ public function get_error_message() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } @@ -556,7 +556,7 @@ class c_base_ldap extends c_base_return { */ public function get_error_number() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } @@ -592,19 +592,19 @@ class c_base_ldap extends c_base_return { */ public function get_option($option) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_int($option)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $value = NULL; if (ldap_get_option($this->ldap, $option, $value) === FALSE) { unset($value); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_get_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_get_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -693,7 +693,7 @@ class c_base_ldap_result extends c_base_return_resource { */ public function set_ldap($ldap) { if (!is_resource($ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -714,14 +714,14 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_count() { if (!is_resource($ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } $total = ldap_count_entries($this->ldap, $this->value); if ($total === FALSE) { unset($total); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_count_entries', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_count_entries', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -738,14 +738,14 @@ class c_base_ldap_result extends c_base_return_resource { */ public function load_entry_first() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } $first = ldap_first_entry($this->ldap, $this->value); if ($first === FALSE) { unset($first); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_first_entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_first_entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -769,7 +769,7 @@ class c_base_ldap_result extends c_base_return_resource { */ public function load_entry_next() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } @@ -780,7 +780,7 @@ class c_base_ldap_result extends c_base_return_resource { // the entry must first be loaded by self::load_entry_first(). if (!is_null($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -807,7 +807,7 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_entry_all() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } @@ -815,7 +815,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($entries === FALSE) { unset($entries); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_get_entries', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_get_entries', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -837,12 +837,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_attribute_first() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -850,7 +850,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($attribute === FALSE) { unset($attribute); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_first_attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_first_attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -873,12 +873,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_attribute_next() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -886,7 +886,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($attribute === FALSE) { unset($attribute); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_next_attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_next_attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -909,12 +909,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_attribute_all() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -922,7 +922,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($attributes === FALSE) { unset($attributes); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_get_attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_get_attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -945,12 +945,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_directory_name() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -958,7 +958,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($directory_name === FALSE) { unset($directory_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_get_dn', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_get_dn', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -981,22 +981,22 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_values($attribute, $binary = FALSE) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_string($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($binary)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'binary', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'binary', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1010,7 +1010,7 @@ class c_base_ldap_result extends c_base_return_resource { if (!is_array($values)) { unset($values); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => ($binary ? 'ldap_get_values_len' : 'ldap_get_values'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => ($binary ? 'ldap_get_values_len' : 'ldap_get_values'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1027,12 +1027,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function do_sort($attribute) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1040,7 +1040,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($status === FALSE) { unset($status); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_sort', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_sort', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } unset($status); @@ -1066,7 +1066,7 @@ class c_base_ldap_result extends c_base_return_resource { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_free_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'ldap_free_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } } diff --git a/common/base/classes/base_log.php b/common/base/classes/base_log.php index f4bc986..2427d83 100644 --- a/common/base/classes/base_log.php +++ b/common/base/classes/base_log.php @@ -132,7 +132,7 @@ class c_base_log extends c_base_return_array { */ public function set_type($type) { if (!is_int($type) || $type < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -152,7 +152,7 @@ class c_base_log extends c_base_return_array { */ public function set_type_sub($type_sub) { if (!is_int($type_sub) || $type_sub < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type_sub', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type_sub', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -172,7 +172,7 @@ class c_base_log extends c_base_return_array { */ public function set_severity($severity) { if (!is_int($severity) || $severity < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'severity', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'severity', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -194,7 +194,7 @@ class c_base_log extends c_base_return_array { */ public function set_facility($facility) { if (!is_int($facility) || $facility < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'facility', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'facility', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_markup.php b/common/base/classes/base_markup.php index 93b4e42..25766f2 100644 --- a/common/base/classes/base_markup.php +++ b/common/base/classes/base_markup.php @@ -550,8 +550,8 @@ class c_base_markup_tag extends c_base_rfc_string { public function __construct() { parent::__construct(); - $this->attributes = array(); - $this->tags = array(); + $this->attributes = []; + $this->tags = []; $this->tags_total = 0; $this->text = NULL; $this->type = static::TYPE_TEXT; @@ -608,7 +608,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function set_attribute($attribute, $value) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -621,7 +621,7 @@ class c_base_markup_tag extends c_base_rfc_string { case c_base_markup_attributes::ATTRIBUTE_NONE: // when attribute none is specified, the entire attributes array is to be reset. unset($this->attributes); - $this->attributes = array(); + $this->attributes = []; return new c_base_return_true(); case c_base_markup_attributes::ATTRIBUTE_ABBR: @@ -988,7 +988,7 @@ class c_base_markup_tag extends c_base_rfc_string { if (!is_array($value)) { if (is_string($value)) { if (!isset($this->attributes[$attribute])) { - $this->attributes[$attribute] = array(); + $this->attributes[$attribute] = []; } $this->attributes[$attribute][] = $value; @@ -1022,7 +1022,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function get_attributes() { if (!isset($this->attributes) && !is_array($this->attributes)) { - $this->attributes = array(); + $this->attributes = []; } return c_base_return_array::s_new($this->attributes); @@ -1041,19 +1041,19 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function get_attribute($attribute) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!isset($this->attributes) && !is_array($this->attributes)) { - $this->attributes = array(); + $this->attributes = []; } if (array_key_exists($attribute, $this->attributes)) { switch ($attribute) { case c_base_markup_attributes::ATTRIBUTE_NONE: // should not be possible, so consider this an error (when attribute is set to NONE, the entire attributes array is unset). - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); case c_base_markup_attributes::ATTRIBUTE_ABBR: @@ -1441,29 +1441,29 @@ class c_base_markup_tag extends c_base_rfc_string { * * @see: self::pr_check_attribute_as_text() */ - public function check_attribute($attribute, $sanitize = FALSE, $type = NULL, $sub_type = NULL, $options = array()) { + public function check_attribute($attribute, $sanitize = FALSE, $type = NULL, $sub_type = NULL, $options = []) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($sanitize)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'sanitize', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'sanitize', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($sub_type) && !is_int($sub_type) && !is_string($sub_type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'sub_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'sub_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1596,17 +1596,17 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function set_tag($tag, $index = NULL) { if (!($tag instanceof c_base_markup_tag)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($index) && (!is_int($index) && $index < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->tags)) { - $this->tags = array(); + $this->tags = []; } if (is_null($index)) { @@ -1634,12 +1634,12 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function unset_tag($index) { if (!is_null($index) && (!is_int($index) && $index < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->tags)) { - $this->tags = array(); + $this->tags = []; } if (is_null($index)) { @@ -1676,7 +1676,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function get_tag($index) { if (!is_int($index) && $index < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1696,7 +1696,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function get_tags() { if (!is_array($this->tags)) { - $this->tags = array(); + $this->tags = []; } return c_base_return_array::s_new($this->tags); @@ -1716,7 +1716,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function set_text($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1753,7 +1753,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function set_type($type) { if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1932,7 +1932,7 @@ class c_base_markup_tag extends c_base_rfc_string { $value = (string) $this->attributes[$attribute]; } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } @@ -1943,7 +1943,7 @@ class c_base_markup_tag extends c_base_rfc_string { $this->attributes[$attribute] = NULL; - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); if ($sanitize) { return c_base_return_error::s_true($error); @@ -1990,7 +1990,7 @@ class c_base_markup_tag extends c_base_rfc_string { if ($invalid) { unset($invalid); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); if ($changed) { unset($changed); return c_base_return_error::s_true($error); @@ -2029,7 +2029,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ protected function pr_check_attribute_as_numeric($attribute, $sanitize = TRUE) { if (!is_numeric($this->attributes[$attribute])) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'value attribute', ':{expected_format}' => 'number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'value attribute', ':{expected_format}' => 'number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_menu.php b/common/base/classes/base_menu.php index 9e3a183..380fb09 100644 --- a/common/base/classes/base_menu.php +++ b/common/base/classes/base_menu.php @@ -38,7 +38,7 @@ class c_base_menu extends c_base_rfc_string { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -64,23 +64,23 @@ class c_base_menu extends c_base_rfc_string { */ public function do_build(&$http, &$database, &$session, $settings, $items = NULL) { if (!($http instanceof c_base_http)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } elseif (!($database instanceof c_base_database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } elseif (!($session instanceof c_base_session)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } elseif (!is_array($settings)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } elseif (!is_null($items) && !is_array($items)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'items', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'items', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -139,7 +139,7 @@ class c_base_menu_item extends c_base_array { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -155,7 +155,7 @@ class c_base_menu_item extends c_base_array { */ public function set_text($text) { if (!is_int($text) && !is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -176,7 +176,7 @@ class c_base_menu_item extends c_base_array { */ public function set_uri($uri) { if (!is_null($uri) && !is_string($uri) && !is_array($uri)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -198,12 +198,12 @@ class c_base_menu_item extends c_base_array { */ public function set_attribute($attribute, $value) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->attributes)) { - $this->attributes = array(); + $this->attributes = []; } $this->attributes[$attribute] = $value; @@ -222,7 +222,7 @@ class c_base_menu_item extends c_base_array { */ public function set_attributes($attributes) { if (!is_array($attributes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -246,17 +246,17 @@ class c_base_menu_item extends c_base_array { */ public function set_item($item, $index = NULL) { if (!($item instanceof c_base_menu_item)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'item', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'item', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($index) && !is_int($index) && !is_string($index)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->items)) { - $this->items = array(); + $this->items = []; } if (is_null($index)) { @@ -283,7 +283,7 @@ class c_base_menu_item extends c_base_array { */ public function set_items($items) { if (!is_null($items) && !($items instanceof c_base_menu_item)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'items', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'items', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -344,7 +344,7 @@ class c_base_menu_item extends c_base_array { public function get_attribute($attribute) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -364,7 +364,7 @@ class c_base_menu_item extends c_base_array { */ public function get_attributes() { if (!is_array($this->attributes)) { - return c_base_return_array::s_new(array()); + return c_base_return_array::s_new([]); } return c_base_return_array::s_new($this->attributes); @@ -383,7 +383,7 @@ class c_base_menu_item extends c_base_array { */ public function get_item($index) { if (!is_string($index) || empty($index)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -403,7 +403,7 @@ class c_base_menu_item extends c_base_array { */ public function get_items() { if (!is_null($this->items) && !is_array($this->items)) { - return c_base_return_array::s_new(array()); + return c_base_return_array::s_new([]); } return c_base_return_array::s_new($this->items); @@ -433,7 +433,7 @@ class c_base_menu_item extends c_base_array { */ public function get_items_keys() { if (empty($this->items)) { - return array(); + return []; } return array_keys($this->items); diff --git a/common/base/classes/base_mime.php b/common/base/classes/base_mime.php index 8de2e4c..29b7c78 100644 --- a/common/base/classes/base_mime.php +++ b/common/base/classes/base_mime.php @@ -99,172 +99,172 @@ class c_base_mime { const TYPE_APPLICATION_OCSP_RESPONSE = 7002; - private static $s_names_provided = array( - self::TYPE_PROVIDED => array('*/*', 'text/*', 'image/*', 'audio/*', 'video/*', 'application/*'), - self::TYPE_STREAM => array('application/octet-stream'), - self::TYPE_DATA_FORM => array('multipart/form-data'), - self::TYPE_DATA_URL => array('application/x-www-form-urlencoded'), - ); - - private static $s_names_text = array( - self::TYPE_TEXT => array('text/*'), - self::TYPE_TEXT_PLAIN => array('text/plain'), - self::TYPE_TEXT_HTML => array('text/html'), - self::TYPE_TEXT_RSS => array('application/rss', 'application/rss+xml', 'application/rdf+xml', 'application/atom+xml'), - self::TYPE_TEXT_ICAL => array('text/calendar'), - self::TYPE_TEXT_CSV => array('text/csv'), - self::TYPE_TEXT_XML => array('application/xml'), - self::TYPE_TEXT_CSS => array('text/css'), - self::TYPE_TEXT_JS => array('text/javascript', 'application/javascript'), - self::TYPE_TEXT_JSON => array('text/json', 'application/json'), - self::TYPE_TEXT_RICH => array('text/rtf'), - self::TYPE_TEXT_XHTML => array('application/xhtml', 'application/xhtml+xml'), - self::TYPE_TEXT_PS => array('text/ps'), - self::TYPE_TEXT_FSS => array('text/fss'), - ); - - private static $s_names_image = array( - self::TYPE_IMAGE => array('image/*'), - self::TYPE_IMAGE_PNG => array('image/png'), - self::TYPE_IMAGE_GIF => array('image/gif'), - self::TYPE_IMAGE_JPEG => array('image/jpeg', 'image/jpg', 'image/jpx'), - self::TYPE_IMAGE_BMP => array('image/bmp'), - self::TYPE_IMAGE_SVG => array('image/svg'), - self::TYPE_IMAGE_TIFF => array('image/tiff', 'image/tiff-fx'), - ); - - private static $s_names_audio = array( - self::TYPE_AUDIO => array('audio/*'), - self::TYPE_AUDIO_WAV => array('audio/wav'), - self::TYPE_AUDIO_OGG => array('audio/ogg'), - self::TYPE_AUDIO_OPUS => array('audio/opus'), - self::TYPE_AUDIO_SPEEX => array('audio/speex'), - self::TYPE_AUDIO_FLAC => array('audio/flac'), - self::TYPE_AUDIO_MP3 => array('audio/mpeg'), - self::TYPE_AUDIO_MP4 => array('audio/mp4'), - self::TYPE_AUDIO_MIDI => array('audio/midi'), - self::TYPE_AUDIO_BASIC => array('audio/au', 'audio/snd'), - ); - - private static $s_names_video = array( - self::TYPE_VIDEO => array('video/*'), - self::TYPE_VIDEO_MPEG => array('video/mp4', 'video/mpeg'), - self::TYPE_VIDEO_OGG => array('video/ogv'), - self::TYPE_VIDEO_H264 => array('video/h264', 'video/x264'), - self::TYPE_VIDEO_QUICKTIME => array('video/qt'), - self::TYPE_VIDEO_DV => array('video/dv'), - self::TYPE_VIDEO_JPEG => array('video/jpeg', 'video/jpeg2000'), - self::TYPE_VIDEO_WEBM => array('video/webm'), - ); - - private static $s_names_document = array( - self::TYPE_DOCUMENT => array('application/*'), - self::TYPE_DOCUMENT_PDF => array('application/pdf'), - self::TYPE_DOCUMENT_LIBRECHART => array('application/vnd.oasis.opendocument.chart'), - self::TYPE_DOCUMENT_LIBREFORMULA => array('application/vnd.oasis.opendocument.formula'), - self::TYPE_DOCUMENT_LIBREGRAPHIC => array('application/vnd.oasis.opendocument.graphics'), - self::TYPE_DOCUMENT_LIBREPRESENTATION => array('application/vnd.oasis.opendocument.presentation'), - self::TYPE_DOCUMENT_LIBRESPREADSHEET => array('application/vnd.oasis.opendocument.spreadsheet'), - self::TYPE_DOCUMENT_LIBRETEXT => array('application/vnd.oasis.opendocument.text'), - self::TYPE_DOCUMENT_LIBREHTML => array('application/vnd.oasis.opendocument.text-web'), - self::TYPE_DOCUMENT_ABIWORD => array('application/abiword', 'application/abiword-compressed'), - self::TYPE_DOCUMENT_MSWORD => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/msword'), - self::TYPE_DOCUMENT_MSEXCEL => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/ms-excel'), - self::TYPE_DOCUMENT_MSPOWERPOINT => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/ms-powerpoint'), - ); - - private static $s_names_container = array( - self::TYPE_CONTAINER => array('application/*'), - self::TYPE_CONTAINER_TAR => array('application/tar'), - self::TYPE_CONTAINER_CPIO => array('application/cpio'), - self::TYPE_CONTAINER_JAVA => array('application/java'), - ); - - private static $s_names_application = array( - self::TYPE_APPLICATION => array('application/*'), - self::TYPE_APPLICATION_OCSP_REQUEST => array('application/ocsp-request'), - self::TYPE_APPLICATION_OCSP_RESPONSE => array('application/ocsp-response'), - ); - - private static $s_extensions_text = array( - self::TYPE_TEXT => array(), - self::TYPE_TEXT_PLAIN => array('txt'), - self::TYPE_TEXT_HTML => array('html'), - self::TYPE_TEXT_RSS => array('rss', 'rdf'), - self::TYPE_TEXT_ICAL => array('ics'), - self::TYPE_TEXT_CSV => array('csv'), - self::TYPE_TEXT_XML => array('xml'), - self::TYPE_TEXT_CSS => array('css'), - self::TYPE_TEXT_JS => array('js'), - self::TYPE_TEXT_JSON => array('json'), - self::TYPE_TEXT_RICH => array('rtf'), - self::TYPE_TEXT_XHTML => array('xhtml'), - self::TYPE_TEXT_PS => array('ps'), - self::TYPE_TEXT_FSS => array('setting'), - ); - - private static $s_extensions_image = array( - self::TYPE_IMAGE => array(), - self::TYPE_IMAGE_PNG => array('png'), - self::TYPE_IMAGE_GIF => array('gif'), - self::TYPE_IMAGE_JPEG => array('jpg', 'jpeg'), - self::TYPE_IMAGE_BMP => array('bmp'), - self::TYPE_IMAGE_SVG => array('svg'), - self::TYPE_IMAGE_TIFF => array('tiff'), - ); - - private static $s_extensions_audio = array( - self::TYPE_AUDIO => array(), - self::TYPE_AUDIO_WAV => array('wav'), - self::TYPE_AUDIO_OGG => array('ogg'), - self::TYPE_AUDIO_OPUS => array('opus', 'ogg'), - self::TYPE_AUDIO_SPEEX => array('spx'), - self::TYPE_AUDIO_FLAC => array('flac'), - self::TYPE_AUDIO_MP3 => array('mp3', 'mp2', 'mp1'), - self::TYPE_AUDIO_MP4 => array('mp4', 'mpeg'), - self::TYPE_AUDIO_MIDI => array('midi'), - self::TYPE_AUDIO_BASIC => array('au', 'snd'), - ); - - private static $s_extensions_video = array( - self::TYPE_VIDEO => array(), - self::TYPE_VIDEO_MPEG => array('mp4', 'video/mpeg'), - self::TYPE_VIDEO_OGG => array('video/ogv'), - self::TYPE_VIDEO_H264 => array('video/h264'), - self::TYPE_VIDEO_QUICKTIME => array('video/qt'), - self::TYPE_VIDEO_DV => array('video/dv'), - self::TYPE_VIDEO_JPEG => array('video/jpeg', 'video/jpeg2000'), - self::TYPE_VIDEO_WEBM => array('video/webm'), - ); - - private static $s_extensions_document = array( - self::TYPE_DOCUMENT => array('application/*'), - self::TYPE_DOCUMENT_PDF => array('application/pdf'), - self::TYPE_DOCUMENT_LIBRECHART => array('application/vnd.oasis.opendocument.chart'), - self::TYPE_DOCUMENT_LIBREFORMULA => array('application/vnd.oasis.opendocument.formula'), - self::TYPE_DOCUMENT_LIBREGRAPHIC => array('application/vnd.oasis.opendocument.graphics'), - self::TYPE_DOCUMENT_LIBREPRESENTATION => array('application/vnd.oasis.opendocument.presentation'), - self::TYPE_DOCUMENT_LIBRESPREADSHEET => array('application/vnd.oasis.opendocument.spreadsheet'), - self::TYPE_DOCUMENT_LIBRETEXT => array('application/vnd.oasis.opendocument.text'), - self::TYPE_DOCUMENT_LIBREHTML => array('application/vnd.oasis.opendocument.text-web'), - self::TYPE_DOCUMENT_ABIWORD => array('application/abiword', 'application/abiword-compressed'), - self::TYPE_DOCUMENT_MSWORD => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/msword'), - self::TYPE_DOCUMENT_MSEXCEL => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/ms-excel'), - self::TYPE_DOCUMENT_MSPOWERPOINT => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/ms-powerpoint'), - ); - - private static $s_extensions_container = array( - self::TYPE_CONTAINER => array('application/*'), - self::TYPE_CONTAINER_TAR => array('application/tar'), - self::TYPE_CONTAINER_CPIO => array('application/cpio'), - self::TYPE_CONTAINER_JAVA => array('application/java'), - ); - - private static $s_extensions_application = array( - self::TYPE_APPLICATION => array('application/*'), - self::TYPE_APPLICATION_OCSP_REQUEST => array('application/ocsp-request'), - self::TYPE_APPLICATION_OCSP_RESPONSE => array('application/ocsp-response'), - ); + private static $s_names_provided = [ + self::TYPE_PROVIDED => ['*/*', 'text/*', 'image/*', 'audio/*', 'video/*', 'application/*'], + self::TYPE_STREAM => ['application/octet-stream'], + self::TYPE_DATA_FORM => ['multipart/form-data'], + self::TYPE_DATA_URL => ['application/x-www-form-urlencoded'], + ]; + + private static $s_names_text = [ + self::TYPE_TEXT => ['text/*'], + self::TYPE_TEXT_PLAIN => ['text/plain'], + self::TYPE_TEXT_HTML => ['text/html'], + self::TYPE_TEXT_RSS => ['application/rss', 'application/rss+xml', 'application/rdf+xml', 'application/atom+xml'], + self::TYPE_TEXT_ICAL => ['text/calendar'], + self::TYPE_TEXT_CSV => ['text/csv'], + self::TYPE_TEXT_XML => ['application/xml'], + self::TYPE_TEXT_CSS => ['text/css'], + self::TYPE_TEXT_JS => ['text/javascript', 'application/javascript'], + self::TYPE_TEXT_JSON => ['text/json', 'application/json'], + self::TYPE_TEXT_RICH => ['text/rtf'], + self::TYPE_TEXT_XHTML => ['application/xhtml', 'application/xhtml+xml'], + self::TYPE_TEXT_PS => ['text/ps'], + self::TYPE_TEXT_FSS => ['text/fss'], + ]; + + private static $s_names_image = [ + self::TYPE_IMAGE => ['image/*'], + self::TYPE_IMAGE_PNG => ['image/png'], + self::TYPE_IMAGE_GIF => ['image/gif'], + self::TYPE_IMAGE_JPEG => ['image/jpeg', 'image/jpg', 'image/jpx'], + self::TYPE_IMAGE_BMP => ['image/bmp'], + self::TYPE_IMAGE_SVG => ['image/svg'], + self::TYPE_IMAGE_TIFF => ['image/tiff', 'image/tiff-fx'], + ]; + + private static $s_names_audio = [ + self::TYPE_AUDIO => ['audio/*'], + self::TYPE_AUDIO_WAV => ['audio/wav'], + self::TYPE_AUDIO_OGG => ['audio/ogg'], + self::TYPE_AUDIO_OPUS => ['audio/opus'], + self::TYPE_AUDIO_SPEEX => ['audio/speex'], + self::TYPE_AUDIO_FLAC => ['audio/flac'], + self::TYPE_AUDIO_MP3 => ['audio/mpeg'], + self::TYPE_AUDIO_MP4 => ['audio/mp4'], + self::TYPE_AUDIO_MIDI => ['audio/midi'], + self::TYPE_AUDIO_BASIC => ['audio/au', 'audio/snd'], + ]; + + private static $s_names_video = [ + self::TYPE_VIDEO => ['video/*'], + self::TYPE_VIDEO_MPEG => ['video/mp4', 'video/mpeg'], + self::TYPE_VIDEO_OGG => ['video/ogv'], + self::TYPE_VIDEO_H264 => ['video/h264', 'video/x264'], + self::TYPE_VIDEO_QUICKTIME => ['video/qt'], + self::TYPE_VIDEO_DV => ['video/dv'], + self::TYPE_VIDEO_JPEG => ['video/jpeg', 'video/jpeg2000'], + self::TYPE_VIDEO_WEBM => ['video/webm'], + ]; + + private static $s_names_document = [ + self::TYPE_DOCUMENT => ['application/*'], + self::TYPE_DOCUMENT_PDF => ['application/pdf'], + self::TYPE_DOCUMENT_LIBRECHART => ['application/vnd.oasis.opendocument.chart'], + self::TYPE_DOCUMENT_LIBREFORMULA => ['application/vnd.oasis.opendocument.formula'], + self::TYPE_DOCUMENT_LIBREGRAPHIC => ['application/vnd.oasis.opendocument.graphics'], + self::TYPE_DOCUMENT_LIBREPRESENTATION => ['application/vnd.oasis.opendocument.presentation'], + self::TYPE_DOCUMENT_LIBRESPREADSHEET => ['application/vnd.oasis.opendocument.spreadsheet'], + self::TYPE_DOCUMENT_LIBRETEXT => ['application/vnd.oasis.opendocument.text'], + self::TYPE_DOCUMENT_LIBREHTML => ['application/vnd.oasis.opendocument.text-web'], + self::TYPE_DOCUMENT_ABIWORD => ['application/abiword', 'application/abiword-compressed'], + self::TYPE_DOCUMENT_MSWORD => ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/msword'], + self::TYPE_DOCUMENT_MSEXCEL => ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/ms-excel'], + self::TYPE_DOCUMENT_MSPOWERPOINT => ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/ms-powerpoint'], + ]; + + private static $s_names_container = [ + self::TYPE_CONTAINER => ['application/*'], + self::TYPE_CONTAINER_TAR => ['application/tar'], + self::TYPE_CONTAINER_CPIO => ['application/cpio'], + self::TYPE_CONTAINER_JAVA => ['application/java'], + ]; + + private static $s_names_application = [ + self::TYPE_APPLICATION => ['application/*'], + self::TYPE_APPLICATION_OCSP_REQUEST => ['application/ocsp-request'], + self::TYPE_APPLICATION_OCSP_RESPONSE => ['application/ocsp-response'], + ]; + + private static $s_extensions_text = [ + self::TYPE_TEXT => [], + self::TYPE_TEXT_PLAIN => ['txt'], + self::TYPE_TEXT_HTML => ['html'], + self::TYPE_TEXT_RSS => ['rss', 'rdf'], + self::TYPE_TEXT_ICAL => ['ics'], + self::TYPE_TEXT_CSV => ['csv'], + self::TYPE_TEXT_XML => ['xml'], + self::TYPE_TEXT_CSS => ['css'], + self::TYPE_TEXT_JS => ['js'], + self::TYPE_TEXT_JSON => ['json'], + self::TYPE_TEXT_RICH => ['rtf'], + self::TYPE_TEXT_XHTML => ['xhtml'], + self::TYPE_TEXT_PS => ['ps'], + self::TYPE_TEXT_FSS => ['setting'], + ]; + + private static $s_extensions_image = [ + self::TYPE_IMAGE => [], + self::TYPE_IMAGE_PNG => ['png'], + self::TYPE_IMAGE_GIF => ['gif'], + self::TYPE_IMAGE_JPEG => ['jpg', 'jpeg'], + self::TYPE_IMAGE_BMP => ['bmp'], + self::TYPE_IMAGE_SVG => ['svg'], + self::TYPE_IMAGE_TIFF => ['tiff'], + ]; + + private static $s_extensions_audio = [ + self::TYPE_AUDIO => [], + self::TYPE_AUDIO_WAV => ['wav'], + self::TYPE_AUDIO_OGG => ['ogg'], + self::TYPE_AUDIO_OPUS => ['opus', 'ogg'], + self::TYPE_AUDIO_SPEEX => ['spx'], + self::TYPE_AUDIO_FLAC => ['flac'], + self::TYPE_AUDIO_MP3 => ['mp3', 'mp2', 'mp1'], + self::TYPE_AUDIO_MP4 => ['mp4', 'mpeg'], + self::TYPE_AUDIO_MIDI => ['midi'], + self::TYPE_AUDIO_BASIC => ['au', 'snd'], + ]; + + private static $s_extensions_video = [ + self::TYPE_VIDEO => [], + self::TYPE_VIDEO_MPEG => ['mp4', 'video/mpeg'], + self::TYPE_VIDEO_OGG => ['video/ogv'], + self::TYPE_VIDEO_H264 => ['video/h264'], + self::TYPE_VIDEO_QUICKTIME => ['video/qt'], + self::TYPE_VIDEO_DV => ['video/dv'], + self::TYPE_VIDEO_JPEG => ['video/jpeg', 'video/jpeg2000'], + self::TYPE_VIDEO_WEBM => ['video/webm'], + ]; + + private static $s_extensions_document = [ + self::TYPE_DOCUMENT => ['application/*'], + self::TYPE_DOCUMENT_PDF => ['application/pdf'], + self::TYPE_DOCUMENT_LIBRECHART => ['application/vnd.oasis.opendocument.chart'], + self::TYPE_DOCUMENT_LIBREFORMULA => ['application/vnd.oasis.opendocument.formula'], + self::TYPE_DOCUMENT_LIBREGRAPHIC => ['application/vnd.oasis.opendocument.graphics'], + self::TYPE_DOCUMENT_LIBREPRESENTATION => ['application/vnd.oasis.opendocument.presentation'], + self::TYPE_DOCUMENT_LIBRESPREADSHEET => ['application/vnd.oasis.opendocument.spreadsheet'], + self::TYPE_DOCUMENT_LIBRETEXT => ['application/vnd.oasis.opendocument.text'], + self::TYPE_DOCUMENT_LIBREHTML => ['application/vnd.oasis.opendocument.text-web'], + self::TYPE_DOCUMENT_ABIWORD => ['application/abiword', 'application/abiword-compressed'], + self::TYPE_DOCUMENT_MSWORD => ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/msword'], + self::TYPE_DOCUMENT_MSEXCEL => ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/ms-excel'], + self::TYPE_DOCUMENT_MSPOWERPOINT => ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/ms-powerpoint'], + ]; + + private static $s_extensions_container = [ + self::TYPE_CONTAINER => ['application/*'], + self::TYPE_CONTAINER_TAR => ['application/tar'], + self::TYPE_CONTAINER_CPIO => ['application/cpio'], + self::TYPE_CONTAINER_JAVA => ['application/java'], + ]; + + private static $s_extensions_application = [ + self::TYPE_APPLICATION => ['application/*'], + self::TYPE_APPLICATION_OCSP_REQUEST => ['application/ocsp-request'], + self::TYPE_APPLICATION_OCSP_RESPONSE => ['application/ocsp-response'], + ]; /** @@ -281,7 +281,7 @@ class c_base_mime { */ static function s_get_names_by_id($id, $category = NULL) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -318,7 +318,7 @@ class c_base_mime { } else { if (!is_int($category)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'category', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'category', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -389,12 +389,12 @@ class c_base_mime { */ static function s_identify($mime, $lowercase = FALSE) { if (!is_string($mime)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'mime', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'mime', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($lowercase)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'lowercase', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'lowercase', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -405,12 +405,12 @@ class c_base_mime { $lower_mime = $mime; } - $information = array( + $information = [ 'id_category' => static::CATEGORY_PROVIDED, 'id_type' => static::TYPE_PROVIDED, 'name_category' => '*', 'name_type' => '*', - ); + ]; if ($mime == '*/*') { return c_base_return_array::s_new($information); diff --git a/common/base/classes/base_path.php b/common/base/classes/base_path.php index fa4c708..ec8926a 100644 --- a/common/base/classes/base_path.php +++ b/common/base/classes/base_path.php @@ -65,17 +65,17 @@ require_once('common/base/classes/base_array.php'); class c_base_path extends c_base_rfc_string { use t_base_return_value_exact; - private const DEFAULT_ALLOWED_METHODS = array( + private const DEFAULT_ALLOWED_METHODS = [ c_base_http::HTTP_METHOD_GET => c_base_http::HTTP_METHOD_GET, c_base_http::HTTP_METHOD_POST => c_base_http::HTTP_METHOD_POST, c_base_http::HTTP_METHOD_HEAD => c_base_http::HTTP_METHOD_HEAD, c_base_http::HTTP_METHOD_OPTIONS => c_base_http::HTTP_METHOD_OPTIONS, - ); + ]; - private const DEFAULT_SANITIZE_HTML = array( + private const DEFAULT_SANITIZE_HTML = [ 'flags' => ENT_HTML5 | ENT_NOQUOTES | ENT_DISALLOWED | ENT_SUBSTITUTE, 'encoding' => 'UTF-8', - ); + ]; protected $id_group; @@ -188,7 +188,7 @@ class c_base_path extends c_base_rfc_string { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -214,7 +214,7 @@ class c_base_path extends c_base_rfc_string { unset($class); // @todo: store all errors on return. - $errors = array(); + $errors = []; $path->set_id_group($id_group); $path->set_value($field_path); @@ -264,7 +264,7 @@ class c_base_path extends c_base_rfc_string { unset($class); // @todo: store all errors on return. - $errors = array(); + $errors = []; $path->set_id_group($id_group); $path->set_value($field_path); @@ -320,7 +320,7 @@ class c_base_path extends c_base_rfc_string { unset($class); // @todo: store all errors on return. - $errors = array(); + $errors = []; $path->set_field_destination($field_destination); $path->set_field_response_code($field_response_code); @@ -412,7 +412,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_id_group($id_group) { if (!is_int($id_group) || $id_group < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_group', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_group', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -433,7 +433,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_field_destination($field_destination) { if (!is_string($field_destination) && !is_array($field_destination)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_destination', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'field_destination', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -453,7 +453,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_field_response_code($field_response_code) { if (!is_int($field_response_code)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_response_code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'field_response_code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -473,7 +473,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_date_created($date_created) { if (!is_float($date_created) && !is_int($date_created)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_created', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_created', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -493,7 +493,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_date_changed($date_changed) { if (!is_float($date_changed) && !is_int($date_changed)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_changed', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_changed', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -513,7 +513,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_date_synced($date_synced) { if (!is_float($date_synced) && !is_int($date_synced)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_synced', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_synced', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -533,7 +533,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_date_locked($date_locked) { if (!is_float($date_locked) && !is_int($date_locked)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -553,7 +553,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_date_deleted($date_deleted) { if (!is_float($date_deleted) && !is_int($date_deleted)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_deleted', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_deleted', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -575,7 +575,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_include_directory($directory) { if (!is_string($directory) && !is_null($directory)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_directory' => 'directory', ':function_directory' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'directory', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -597,7 +597,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_include_name($name) { if (!is_string($name) && !is_null($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -620,17 +620,17 @@ class c_base_path extends c_base_rfc_string { */ public function set_allowed_method($method, $append = TRUE) { if (!is_int($method)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!$append) { - $this->allowed_methods = array(); + $this->allowed_methods = []; } $this->allowed_methods[$method] = $method; @@ -649,11 +649,11 @@ class c_base_path extends c_base_rfc_string { */ public function set_allowed_methods($methods) { if (!is_array($methods)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'methods', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'methods', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->allowed_methods = array(); + $this->allowed_methods = []; foreach ($methods as $method) { if (is_int($method)) { $this->allowed_methods[$method] = $method; @@ -680,12 +680,12 @@ class c_base_path extends c_base_rfc_string { */ public function set_sanitize_html($flags = NULL, $encoding = NULL) { if (!is_null($flags) && !is_int($flags)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'flags', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'flags', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($encoding) && !is_string($encoding)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -720,7 +720,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_path_tree($path_tree) { if (!is_null($path_tree) && !($path_tree instanceof c_base_path_tree)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path_tree', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'path_tree', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -996,7 +996,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_content($is_content = NULL) { if (!is_null($is_content) && !is_bool($is_content)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1029,7 +1029,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_alias($is_alias = NULL) { if (!is_null($is_alias) && !is_bool($is_alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1062,7 +1062,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_redirect($is_redirect = NULL) { if (!is_null($is_redirect) && !is_bool($is_redirect)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_redirect', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_redirect', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1095,7 +1095,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_private($is_private = NULL) { if (!is_null($is_private) && !is_bool($is_private)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_private', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_private', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1128,7 +1128,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_locked($is_locked = NULL) { if (!is_null($is_locked) && !is_bool($is_locked)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1161,7 +1161,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_root($is_root = NULL) { if (!is_null($is_root) && !is_bool($is_root)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_root', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_root', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1197,7 +1197,7 @@ class c_base_path extends c_base_rfc_string { * An executed array object is returned on success. * An executed array object with error bit set is returned on error. */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { $executed = new c_base_path_executed(); if ($this->is_redirect) { @@ -1238,22 +1238,22 @@ class c_base_path extends c_base_rfc_string { */ public function set_parameters(&$http, &$database, &$session, $settings) { if (!($http instanceof c_base_http)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!($database instanceof c_base_database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!($session instanceof c_base_session)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($settings)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1271,14 +1271,14 @@ class c_base_path extends c_base_rfc_string { $this->request_uri = $request_uri; } else { - $this->request_uri = array( + $this->request_uri = [ 'scheme' => $this->settings['base_scheme'], 'authority' => $this->settings['base_host'], 'path' => $this->settings['base_path'], 'query' => NULL, 'fragment' => NULL, 'url' => TRUE, - ); + ]; } unset($request_uri); @@ -1339,12 +1339,12 @@ class c_base_path extends c_base_rfc_string { */ protected function pr_sanitize($id, $type, $type_sub = NULL) { if (!is_string($id) && mb_strlen($id) > 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(NULL, 'c_base_return_null', $error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(NULL, 'c_base_return_null', $error); } @@ -1480,7 +1480,7 @@ class c_base_path_executed extends c_base_array { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -1498,17 +1498,17 @@ class c_base_path_executed extends c_base_array { */ public function set_cookies($cookie, $append = TRUE) { if (!($cookie instanceof c_base_cookie)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!$append || !is_array($this->cookies)) { - $this->cookies = array(); + $this->cookies = []; } $this->cookies[] = $cookie; @@ -1528,7 +1528,7 @@ class c_base_path_executed extends c_base_array { */ public function set_output($output) { if (!is_null($output) && !($output instanceof c_base_return)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'output', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'output', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1597,7 +1597,7 @@ class c_base_path_tree extends c_base_array { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -1612,7 +1612,7 @@ class c_base_path_tree extends c_base_array { */ public function set_id_group($id_group) { if (!is_int($id_group)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_group', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_group', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_paths.php b/common/base/classes/base_paths.php index 657849f..b570364 100644 --- a/common/base/classes/base_paths.php +++ b/common/base/classes/base_paths.php @@ -32,7 +32,7 @@ class c_base_paths extends c_base_return { public function __construct() { parent::__construct(); - $this->paths = array(); + $this->paths = []; $this->root = NULL; } @@ -64,7 +64,7 @@ class c_base_paths extends c_base_return { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -96,22 +96,22 @@ class c_base_paths extends c_base_return { */ public function add_path($path, $handler, $include_directory = NULL, $include_name = NULL, $allowed_methods = NULL) { if (!is_string($path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($handler)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'handler', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'handler', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ((!is_null($include_directory) || (is_null($include_directory) && !is_null($include_name))) && !is_string($include_directory)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'include_directory', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'include_directory', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ((!is_null($include_name) || (is_null($include_name) && !is_null($include_directory))) && !is_string($include_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'include_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'include_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -121,7 +121,7 @@ class c_base_paths extends c_base_return { if (is_null($allowed_methods)) { $methods = $path_object->get_allowed_methods()->get_value_exact(); if (!is_array($methods)) { - $methods = array(); + $methods = []; } } else { @@ -130,13 +130,13 @@ class c_base_paths extends c_base_return { if (mb_strlen($path) == 0) { unset($path_object); - $this->root = array('handler' => $handler, 'include_directory' => $include_directory, 'include_name' => $include_name, 'is_root' => TRUE, 'methods' => $methods); + $this->root = ['handler' => $handler, 'include_directory' => $include_directory, 'include_name' => $include_name, 'is_root' => TRUE, 'methods' => $methods]; return new c_base_return_true(); } if (!is_null($allowed_methods) && !is_array($allowed_methods)) { unset($path_object); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allowed_methods', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'allowed_methods', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -145,7 +145,7 @@ class c_base_paths extends c_base_return { unset($path_object); unset($valid_path); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } unset($valid_path); @@ -170,11 +170,11 @@ class c_base_paths extends c_base_return { } if (!is_array($this->paths)) { - $this->paths = array(); + $this->paths = []; } if (!array_key_exists($id_group, $this->paths)) { - $this->paths[$id_group] = array(); + $this->paths[$id_group] = []; } $path_tree = &$this->paths[$id_group]; @@ -186,13 +186,13 @@ class c_base_paths extends c_base_return { // note that 'paths' is not populated here, but is later used when being processed by self::find_path(). $path_part = array_shift($path_parts); if (!array_key_exists($path_part, $path_tree)) { - $path_tree[$path_part] = array( - 'paths' => array(), + $path_tree[$path_part] = [ + 'paths' => [], 'include_directory' => NULL, 'include_name' => NULL, 'handler' => NULL, - 'methods' => array(), - ); + 'methods' => [], + ]; } $path_tree = &$path_tree[$path_part]; @@ -205,13 +205,13 @@ class c_base_paths extends c_base_return { else { foreach ($path_parts as $path_part) { if (!isset($path_tree['paths'][$path_part])) { - $path_tree['paths'][$path_part] = array( - 'paths' => array(), + $path_tree['paths'][$path_part] = [ + 'paths' => [], 'include_directory' => NULL, 'include_name' => NULL, 'handler' => NULL, - 'methods' => array(), - ); + 'methods' => [], + ]; } $path_tree = &$path_tree['paths'][$path_part]; @@ -264,7 +264,7 @@ class c_base_paths extends c_base_return { */ public function find_path($path_string) { if (!is_null($path_string) && !is_string($path_string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'path_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -272,7 +272,7 @@ class c_base_paths extends c_base_return { if (is_array($this->root)) { $root_array = $this->root; $root_array['id_group'] = 0; - $root_array['path_tree'] = array(); + $root_array['path_tree'] = []; return c_base_return_array::s_new($root_array); } @@ -283,7 +283,7 @@ class c_base_paths extends c_base_return { 'handler' => NULL, 'methods' => NULL, 'id_group' => 0, - 'path_tree' => array(), + 'path_tree' => [], )); } @@ -293,7 +293,7 @@ class c_base_paths extends c_base_return { if (!$path->set_value($path_string)) { unset($path); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'path_string', ':{expected_format}' => 'Valid URL path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'path_string', ':{expected_format}' => 'Valid URL path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } @@ -331,7 +331,7 @@ class c_base_paths extends c_base_return { $depth_total = count($path_parts); $found = NULL; $path_tree = &$this->paths[$id_group]; - $path_tree_history = array(); + $path_tree_history = []; if (is_array($this->root)) { $path_tree_history[] = $this->root; @@ -347,23 +347,23 @@ class c_base_paths extends c_base_return { $path_tree = &$path_tree['%']; } - $path_tree_history[] = array( + $path_tree_history[] = [ 'path' => $path_part, 'include_directory' => isset($path_tree['include_directory']) ? $path_tree['include_directory'] : NULL, 'include_name' => isset($path_tree['include_name']) ? $path_tree['include_name'] : NULL, 'handler' => isset($path_tree['handler']) ? $path_tree['handler'] : NULL, 'methods' => isset($path_tree['methods']) ? $path_tree['methods'] : NULL, - ); + ]; if ($depth_current == $depth_total) { - $found = array( + $found = [ 'include_directory' => $path_tree['include_directory'], 'include_name' => $path_tree['include_name'], 'handler' => $path_tree['handler'], 'methods' => $path_tree['methods'], 'id_group' => $id_group, 'path_tree' => $path_tree_history, - ); + ]; } else { foreach ($path_parts as $path_part) { @@ -379,23 +379,23 @@ class c_base_paths extends c_base_return { break; } - $path_tree_history[] = array( + $path_tree_history[] = [ 'path' => $path_part, 'include_directory' => isset($path_tree['include_directory']) ? $path_tree['include_directory'] : NULL, 'include_name' => isset($path_tree['include_name']) ? $path_tree['include_name'] : NULL, 'handler' => isset($path_tree['handler']) ? $path_tree['handler'] : NULL, 'methods' => isset($path_tree['methods']) ? $path_tree['methods'] : NULL, - ); + ]; if ($depth_current == $depth_total) { - $found = array( + $found = [ 'include_directory' => $path_tree['include_directory'], 'include_name' => $path_tree['include_name'], 'handler' => $path_tree['handler'], 'methods' => $path_tree['methods'], 'id_group' => $id_group, 'path_tree' => $path_tree_history, - ); + ]; break; } } diff --git a/common/base/classes/base_return.php b/common/base/classes/base_return.php index d39965a..669a450 100644 --- a/common/base/classes/base_return.php +++ b/common/base/classes/base_return.php @@ -238,7 +238,7 @@ class c_base_return { * Class constructor. */ public function __construct() { - $this->errors = array(); + $this->errors = []; } /** @@ -336,12 +336,12 @@ class c_base_return { } if (is_null($error)) { - $this->errors = array(); + $this->errors = []; return TRUE; } if (!is_array($this->errors)) { - $this->errors = array(); + $this->errors = []; } if (is_null($delta)) { @@ -371,7 +371,7 @@ class c_base_return { */ public function get_error($delta = NULL) { if (!is_array($this->errors)) { - $this->errors = array(); + $this->errors = []; } if (is_null($delta)) { @@ -1079,7 +1079,7 @@ class c_base_return_array extends c_base_return_value { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -1293,7 +1293,7 @@ class c_base_return_array extends c_base_return_value { } unset($unserialized); - $this->value = array(); + $this->value = []; return FALSE; } @@ -1341,7 +1341,7 @@ class c_base_return_array extends c_base_return_value { } unset($decoded); - $this->value = array(); + $this->value = []; return FALSE; } @@ -1368,7 +1368,7 @@ class c_base_return_array extends c_base_return_value { */ public function get_value_exact() { if (!is_array($this->value)) { - return array(); + return []; } return $this->value; @@ -1417,7 +1417,7 @@ class c_base_return_array extends c_base_return_value { } if (!is_array($this->value)) { - $this->value = array(); + $this->value = []; } if (!array_key_exists($key, $this->value)) { @@ -1510,7 +1510,7 @@ class c_base_return_array extends c_base_return_value { */ public function get_value_keys() { if (empty($this->value)) { - return array(); + return []; } return array_keys($this->value); diff --git a/common/base/classes/base_rfc_string.php b/common/base/classes/base_rfc_string.php index 6472b31..29f977a 100644 --- a/common/base/classes/base_rfc_string.php +++ b/common/base/classes/base_rfc_string.php @@ -85,11 +85,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: c_base_utf8::s_ordinals_to_string_array() */ protected function pr_rfc_string_prepare($text) { - $result = array( - 'ordinals' => array(), - 'characters' => array(), + $result = [ + 'ordinals' => [], + 'characters' => [], 'invalid' => FALSE, - ); + ]; $ordinals = c_base_utf8::s_string_to_ordinals($text); if ($ordinals instanceof c_base_return_false) { @@ -132,11 +132,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: c_base_utf8::s_ordinals_to_string_array() */ protected function pr_rfc_string_prepare_ordinals($text) { - $result = array( - 'ordinals' => array(), - 'characters' => array(), + $result = [ + 'ordinals' => [], + 'characters' => [], 'invalid' => FALSE, - ); + ]; $ordinals = c_base_utf8::s_string_to_ordinals($text); if ($ordinals instanceof c_base_return_false) { @@ -181,15 +181,15 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_qtext() */ protected function pr_rfc_string_is_quoted_string($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( - 'comments' => array( + $result = [ + 'comments' => [ 'before' => NULL, 'after' => NULL, - ), + ], 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -352,11 +352,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * - 'invalid': a boolean representing whether or not this string is valid or if an error occurred. */ protected function pr_rfc_string_is_entity_tag($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -418,11 +418,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * - 'invalid': a boolean representing whether or not this string is valid or if an error occurred. */ protected function pr_rfc_string_is_comment($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'comment' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -512,11 +512,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_digit() */ protected function pr_rfc_string_is_digit($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -573,11 +573,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc7230#section-3.2.6 */ protected function pr_rfc_string_is_token($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -635,11 +635,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc7230#section-3.2.6 */ protected function pr_rfc_string_is_token68($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -699,11 +699,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc7234#section-5.2.3 */ protected function pr_rfc_string_is_token_quoted($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -796,12 +796,12 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc7235#appendix-C */ protected function pr_rfc_string_is_credentials($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'scheme' => NULL, - 'parameters' => array(), + 'parameters' => [], 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -988,11 +988,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc7233#appendix-D */ protected function pr_rfc_string_is_range($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; // @todo: this looks like a lot of work, so deal with this at some point in the future because this is a low to moderate priority function. $result['invalid'] = TRUE; @@ -1055,11 +1055,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_wsp() */ protected function pr_rfc_string_is_basic($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -1115,11 +1115,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_text() */ protected function pr_rfc_string_is_text($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -1175,11 +1175,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_atext() */ protected function pr_rfc_string_is_atext($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -1235,11 +1235,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_dtext() */ protected function pr_rfc_string_is_dtext($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -1295,11 +1295,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_qtext() */ protected function pr_rfc_string_is_qtext($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -1382,11 +1382,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * - 'invalid': a boolean representing whether or not this string is valid or if an error occurred. */ protected function pr_rfc_string_is_negotiation($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( - 'choices' => array(), + $result = [ + 'choices' => [], 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -1396,10 +1396,10 @@ abstract class c_base_rfc_string extends c_base_rfc_char { return $result; } - $choice = array( + $choice = [ 'choice' => NULL, 'weight' => NULL, - ); + ]; for (; $result['current'] < $stop; $result['current']++) { $code = $ordinals[$result['current']]; @@ -1552,7 +1552,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { // the weight has been identified, so store its value and prepare for another run. $choice['weight'] = $weight; if (!isset($result['choices'][$weight])) { - $result['choices'][$weight] = array(); + $result['choices'][$weight] = []; } // strip out leading and trailing whitespace. @@ -1561,10 +1561,10 @@ abstract class c_base_rfc_string extends c_base_rfc_char { $result['choices'][$weight][$choice['choice']] = $choice; unset($weight); - $choice = array( + $choice = [ 'choice' => NULL, 'weight' => NULL, - ); + ]; if ($result['current'] >= $stop) { break; @@ -1598,7 +1598,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { // this is an unweighted choice. $choice['weight'] = NULL; if (!isset($result['choices'][NULL])) { - $result['choices'][NULL] = array(); + $result['choices'][NULL] = []; } // strip out leading and trailing whitespace. @@ -1606,10 +1606,10 @@ abstract class c_base_rfc_string extends c_base_rfc_char { $result['choices'][NULL][$choice['choice']] = $choice; - $choice = array( + $choice = [ 'choice' => NULL, 'weight' => NULL, - ); + ]; continue; } @@ -1626,7 +1626,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { if ($choice['choice'] != NULL) { $choice['weight'] = NULL; if (!isset($result['choices'][NULL])) { - $result['choices'][NULL] = array(); + $result['choices'][NULL] = []; } // strip out leading and trailing whitespace. @@ -1678,12 +1678,12 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc2616#section-3.7 */ protected function pr_rfc_string_is_media_type($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'media' => NULL, - 'parameters' => array(), + 'parameters' => [], 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -1957,11 +1957,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc2616#section-3.7 */ protected function pr_rfc_string_is_valued_token($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'tokens' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -2157,11 +2157,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc2616#section-3.7 */ protected function pr_rfc_string_is_valued_token_comma($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'tokens' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -2353,11 +2353,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc7230#appendix-B */ protected function pr_rfc_string_is_commad_token($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'tokens' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -2455,11 +2455,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc3986#section-3.4 */ protected function pr_rfc_string_is_path($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -2545,11 +2545,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc3986#section-3.4 */ protected function pr_rfc_string_is_query($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -2640,12 +2640,12 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc2616#section-3.7 */ protected function pr_rfc_string_is_ip_literal($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'address' => NULL, 'is_future' => FALSE, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -2665,10 +2665,10 @@ abstract class c_base_rfc_string extends c_base_rfc_char { } if ($result['is_future']) { - $result['address'] = array( + $result['address'] = [ 'version' => NULL, 'ip' => NULL, - ); + ]; $result['current']++; if ($result['current'] >= $stop) { @@ -2783,11 +2783,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_digit() */ protected function pr_rfc_string_is_alpha_numeric_dash($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -2845,11 +2845,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_digit() */ protected function pr_rfc_string_is_numeric($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -2975,11 +2975,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_hexdigit() */ protected function pr_rfc_string_is_hexanumeric($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -3104,11 +3104,11 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: base_rfc_char::pr_rfc_char_is_vchar() */ protected function pr_rfc_string_is_directive_value($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'text' => NULL, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -3227,7 +3227,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { * @see: https://tools.ietf.org/html/rfc3986 */ protected function pr_rfc_string_is_uri($ordinals, $characters, $start = 0, $stop = NULL) { - $result = array( + $result = [ 'scheme' => NULL, 'authority' => NULL, 'path' => NULL, @@ -3236,7 +3236,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { 'url' => TRUE, 'current' => $start, 'invalid' => FALSE, - ); + ]; if (is_null($stop)) { $stop = count($ordinals); @@ -3778,9 +3778,9 @@ abstract class c_base_rfc_string extends c_base_rfc_char { $value = $array[$key]; unset($array[$key]); - $new_array = array( + $new_array = [ $key => $value, - ); + ]; unset($value); foreach ($array as $key => $value) { @@ -3937,7 +3937,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { $query_value = NULL; $no_value = FALSE; - $result['query'] = array(); + $result['query'] = []; for (; $result['current'] < $stop; $result['current']++) { if (!array_key_exists($result['current'], $ordinals) || !array_key_exists($result['current'], $characters)) { unset($code); diff --git a/common/base/classes/base_roles.php b/common/base/classes/base_roles.php index fa08d48..a12bc60 100644 --- a/common/base/classes/base_roles.php +++ b/common/base/classes/base_roles.php @@ -123,7 +123,7 @@ class c_base_roles extends c_base_return { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -143,12 +143,12 @@ class c_base_roles extends c_base_return { */ public function set_role($role, $value) { if (!is_int($role)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'role', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'role', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -230,7 +230,7 @@ class c_base_roles extends c_base_return { */ public function set_roles($roles) { if (!is_array($roles)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'roles', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'roles', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -310,7 +310,7 @@ class c_base_roles extends c_base_return { */ public function get_role($role) { if (!is_int($role)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'role', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'role', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -396,7 +396,7 @@ class c_base_roles extends c_base_return { * An array with error bit set is returned on error. */ public function get_roles() { - $roles = array(); + $roles = []; if ($this->public) { $roles[static::PUBLIC] = static::PUBLIC; diff --git a/common/base/classes/base_session.php b/common/base/classes/base_session.php index 5677cbd..bb2ba80 100644 --- a/common/base/classes/base_session.php +++ b/common/base/classes/base_session.php @@ -153,7 +153,7 @@ class c_base_session extends c_base_return { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -171,7 +171,7 @@ class c_base_session extends c_base_return { */ public function set_socket_directory($socket_directory) { if (!is_null($socket_directory) && (!is_string($socket_directory) || empty($socket_directory))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'socket_directory', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'socket_directory', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -181,7 +181,7 @@ class c_base_session extends c_base_return { } if (!is_dir($socket_directory)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{directory_name}' => $socket_directory, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_DIRECTORY); + $error = c_base_error::s_log(NULL, ['arguments' => [':{directory_name}' => $socket_directory, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_DIRECTORY); return c_base_return_error::s_false($error); } @@ -211,7 +211,7 @@ class c_base_session extends c_base_return { */ public function set_cookie($cookie) { if (!is_null($cookie) && !($cookie instanceof c_base_cookie)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -232,7 +232,7 @@ class c_base_session extends c_base_return { */ public function set_system_name($system_name) { if (!is_null($system_name) && (!is_string($system_name) || empty($system_name))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'system_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'system_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -260,7 +260,7 @@ class c_base_session extends c_base_return { */ public function set_name($name) { if (!is_null($name) && (!is_string($name) || empty($name))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -270,7 +270,7 @@ class c_base_session extends c_base_return { } if (mb_strlen($name) == 0 || preg_match('/^(\w|-)+$/i', $name) != 1) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'name', ':{expected_format}' => '. Alphanumeric and dash characters only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{format_name}' => 'name', ':{expected_format}' => '. Alphanumeric and dash characters only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } @@ -291,7 +291,7 @@ class c_base_session extends c_base_return { */ public function set_host($host) { if (!is_null($host) && (!is_string($host) || empty($host))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -301,7 +301,7 @@ class c_base_session extends c_base_return { } if (mb_strlen($host) == 0 || ip2long($host) === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -327,7 +327,7 @@ class c_base_session extends c_base_return { */ public function set_password($password) { if (!is_null($password) && (!is_string($password) || empty($password))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -338,7 +338,7 @@ class c_base_session extends c_base_return { // deny 0-length passwords. if (mb_strlen($password) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -361,12 +361,12 @@ class c_base_session extends c_base_return { */ public function set_setting($delta, $setting) { if (!is_int($delta) && !is_string($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($this->settings)) { - $this->settings = array(); + $this->settings = []; } $this->settings[$delta] = $setting; @@ -388,7 +388,7 @@ class c_base_session extends c_base_return { */ public function set_settings($settings) { if (!is_null($settings) && !is_array($settings)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -414,7 +414,7 @@ class c_base_session extends c_base_return { */ public function set_session_id($session_id) { if (!is_null($session_id) && (!is_string($session_id) || empty($session_id))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -425,7 +425,7 @@ class c_base_session extends c_base_return { // deny 0-length session_id. if (mb_strlen($session_id) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -448,7 +448,7 @@ class c_base_session extends c_base_return { */ public function set_timeout_expire($timeout_expire) { if (!is_null($timeout_expire) && !is_int($timeout_expire)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timeout_expire', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'timeout_expire', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -471,7 +471,7 @@ class c_base_session extends c_base_return { */ public function set_timeout_max($timeout_max) { if (!is_null($timeout_max) && !is_int($timeout_max)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timeout_max', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'timeout_max', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -492,11 +492,11 @@ class c_base_session extends c_base_return { */ public function set_problems($problems) { if (!is_null($problems) && !is_array($problems)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'problems', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'problems', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->problems = array(); + $this->problems = []; if (is_null($problems)) { return new c_base_return_true(); @@ -533,17 +533,17 @@ class c_base_session extends c_base_return { */ public function set_socket_timeout($seconds, $microseconds = 0, $receive = TRUE) { if (!is_null($seconds) && (!is_int($seconds) || $seconds < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($microseconds) || $microseconds < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'microseconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'microseconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($receive)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'receive', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'receive', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -553,35 +553,35 @@ class c_base_session extends c_base_return { } if (!is_array($this->socket_timeout)) { - $this->socket_timeout = array( + $this->socket_timeout = [ 'send' => NULL, 'receive' => NULL, - ); + ]; } if ($receive) { - $this->socket_timeout['receive'] = array('seconds' => $seconds, 'microseconds' => $microseconds); + $this->socket_timeout['receive'] = ['seconds' => $seconds, 'microseconds' => $microseconds]; if (is_resource($this->socket)) { $result = @socket_set_option($this->socket, SOL_SOCKET, SO_RCVTIMEO, $seconds, $microseconds); if ($result === FALSE) { unset($result); $this->socket_error = @socket_last_error($this->socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_set_option', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_set_option', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } unset($result); } } else { - $this->socket_timeout['send'] = array('seconds' => $seconds, 'microseconds' => $microseconds); + $this->socket_timeout['send'] = ['seconds' => $seconds, 'microseconds' => $microseconds]; if (is_resource($this->socket)) { $result = @socket_set_option($this->socket, SOL_SOCKET, SO_SNDTIMEO, $seconds, $microseconds); if ($result === FALSE) { unset($result); $this->socket_error = @socket_last_error($this->socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_set_option', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_set_option', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } unset($result); @@ -605,7 +605,7 @@ class c_base_session extends c_base_return { */ public function set_user_current($user) { if (!is_null($user) && !($user instanceof c_base_users_user)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -633,7 +633,7 @@ class c_base_session extends c_base_return { */ public function set_user_session($user) { if (!is_null($user) && !($user instanceof c_base_users_user)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -764,7 +764,7 @@ class c_base_session extends c_base_return { */ public function get_setting($delta) { if (!is_int($delta) && !is_string($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -773,7 +773,7 @@ class c_base_session extends c_base_return { } if (!array_key_exists($delta, $this->settings)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, ['arguments' => [':{index_name}' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -853,7 +853,7 @@ class c_base_session extends c_base_return { */ public function get_problems() { if (is_null($this->problems)) { - $this->problems = array(); + $this->problems = []; } return c_base_return_array::s_new($this->problems); @@ -908,7 +908,7 @@ class c_base_session extends c_base_return { return clone($this->user_current); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{data_name}' => 'user_current', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_DEFINED); + $error = c_base_error::s_log(NULL, ['arguments' => [':{data_name}' => 'user_current', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_DEFINED); return c_base_return_error::s_return('c_base_users_user', $error); } @@ -924,7 +924,7 @@ class c_base_session extends c_base_return { return clone($this->user_session); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':{data_name}' => 'user_session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_DEFINED); + $error = c_base_error::s_log(NULL, ['arguments' => [':{data_name}' => 'user_session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_DEFINED); return c_base_return_error::s_return('c_base_users_user', $error); } @@ -941,7 +941,7 @@ class c_base_session extends c_base_return { */ public function is_logged_in($is_logged_in = NULL) { if (!is_null($is_logged_in) && !is_bool($is_logged_in)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_logged_in', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_logged_in', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -974,7 +974,7 @@ class c_base_session extends c_base_return { */ public function is_expired($is_expired = NULL) { if (!is_null($is_expired) && !is_bool($is_expired)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_expired', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_expired', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1026,12 +1026,12 @@ class c_base_session extends c_base_return { */ function do_connect() { if (is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->system_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->system_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->system_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1043,7 +1043,7 @@ class c_base_session extends c_base_return { @socket_clear_error(); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_create', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_create', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } @@ -1056,7 +1056,7 @@ class c_base_session extends c_base_return { $this->do_disconnect(); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_connect', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_connect', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } unset($connected); @@ -1083,7 +1083,7 @@ class c_base_session extends c_base_return { */ public function do_disconnect() { if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1105,17 +1105,17 @@ class c_base_session extends c_base_return { */ public function do_pull() { if (is_null($this->host)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->session_id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1128,7 +1128,7 @@ class c_base_session extends c_base_return { if (empty($response['result']) || !is_array($response['result'])) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1188,38 +1188,38 @@ class c_base_session extends c_base_return { */ public function do_push($interval_expire = NULL, $interval_max = NULL) { if (is_null($this->name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->host)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->password)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_null($interval_expire) && (!is_int($interval_expire) || $interval_expire < 1)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'interval_expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'interval_expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($interval_max) && (!is_int($interval_max) || $interval_max < 1)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'interval_max', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'interval_max', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } // settings is allowed to be undefined, so send it as an empty array. if (is_null($this->settings)) { - $this->settings = array(); + $this->settings = []; } $response = $this->p_transfer(array('name' => $this->name, 'ip' => $this->host, 'password' => $this->password, 'expire' => $interval_expire, 'max' => $interval_max, 'settings' => $this->settings)); @@ -1229,7 +1229,7 @@ class c_base_session extends c_base_return { $response = c_base_return_array::s_value_exact($response); if (isset($response['error']) && isset($response['error']['message']) && is_string($response['error']['message'])) { - $error = c_base_error::s_log(' ' . $response['error']['message'], array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(' ' . $response['error']['message'], ['arguments' => [':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); unset($response); return c_base_return_error::s_false($error); @@ -1237,7 +1237,7 @@ class c_base_session extends c_base_return { elseif (empty($response['result']) || !is_array($response['result'])) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1277,17 +1277,17 @@ class c_base_session extends c_base_return { */ public function do_terminate() { if (is_null($this->host)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->session_id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1300,7 +1300,7 @@ class c_base_session extends c_base_return { if (empty($response['result']) || !is_array($response['result'])) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1326,7 +1326,7 @@ class c_base_session extends c_base_return { */ public function do_flush() { if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1339,7 +1339,7 @@ class c_base_session extends c_base_return { if (empty($response['result']) || !is_array($response['result'])) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1372,13 +1372,13 @@ class c_base_session extends c_base_return { $this->socket_error = @socket_last_error($this->socket); @socket_clear_error($this->socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_write', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_write', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } elseif ($written == 0) { unset($written); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_write', ':{socket_error}' => NULL, ':{socket_error_message}' => 'No bytes written.', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_write', ':{socket_error}' => NULL, ':{socket_error_message}' => 'No bytes written.', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } unset($written); @@ -1390,7 +1390,7 @@ class c_base_session extends c_base_return { $this->socket_error = @socket_last_error($this->socket); @socket_clear_error($this->socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_read', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_read', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } @@ -1398,7 +1398,7 @@ class c_base_session extends c_base_return { unset($json); if ($response === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_users.php b/common/base/classes/base_users.php index a17a96d..4121f3f 100644 --- a/common/base/classes/base_users.php +++ b/common/base/classes/base_users.php @@ -125,7 +125,7 @@ class c_base_users_user extends c_base_return_array { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -140,7 +140,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_id($id) { if (!is_int($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -160,7 +160,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_id_external($id_external) { if (!is_int($id_external)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_external', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_external', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -180,7 +180,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_id_sort($id_sort) { if (!is_int($id_sort)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_sort', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_sort', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -200,7 +200,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_name_machine($name_machine) { if (!is_string($name_machine)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name_machine', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name_machine', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -220,7 +220,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_name_human($name_human) { if (!($name_human instanceof c_base_users_user_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name_human', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'name_human', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -240,7 +240,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_address_email($address_email) { if (!($address_email instanceof c_base_address_email)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'address_email', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'address_email', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -269,7 +269,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_date_created($date_created) { if (!is_int($date_created) && !is_float($date_created)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_created', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_created', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -289,7 +289,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_date_changed($date_changed) { if (!is_int($date_changed) && !is_float($date_changed)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_changed', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_changed', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -309,7 +309,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_date_synced($date_synced) { if (!is_int($date_synced) && !is_float($date_synced)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_synced', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_synced', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -329,7 +329,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_date_locked($date_locked) { if (!is_int($date_locked) && !is_float($date_locked)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -349,7 +349,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_date_deleted($date_deleted) { if (!is_int($date_deleted) && !is_float($date_deleted)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_deleted', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date_deleted', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -370,7 +370,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_image_original($image_original) { if (!is_int($image_original) && !is_null($image_original)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'image_original', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'image_original', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -391,7 +391,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_image_cropped($image_cropped) { if (!is_int($image_cropped) && !is_null($image_cropped)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'image_cropped', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'image_cropped', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -412,7 +412,7 @@ class c_base_users_user extends c_base_return_array { */ public function set_image_icon($image_icon) { if (!is_int($image_icon) && !is_null($image_icon)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'image_icon', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'image_icon', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -689,7 +689,7 @@ class c_base_users_user extends c_base_return_array { */ public function is_private($is_private = NULL) { if (!is_null($is_private) && !is_bool($is_private)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_private', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_private', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -718,7 +718,7 @@ class c_base_users_user extends c_base_return_array { */ public function is_locked($is_locked = NULL) { if (!is_null($is_locked) && !is_bool($is_locked)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -747,7 +747,7 @@ class c_base_users_user extends c_base_return_array { */ public function is_deleted($is_deleted = NULL) { if (!is_null($is_deleted) && !is_bool($is_deleted)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_deleted', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_deleted', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -779,7 +779,7 @@ class c_base_users_user extends c_base_return_array { */ public function is_roler($is_roler = NULL) { if (!is_null($is_roler) && !is_bool($is_roler)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_roler', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'is_roler', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -876,7 +876,7 @@ class c_base_users_user_name extends c_base_return { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -888,7 +888,7 @@ class c_base_users_user_name extends c_base_return { */ public function set_prefix($prefix) { if (!is_string($prefix)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'prefix', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'prefix', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -905,7 +905,7 @@ class c_base_users_user_name extends c_base_return { */ public function set_first($first) { if (!is_string($first)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'first', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'first', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -922,7 +922,7 @@ class c_base_users_user_name extends c_base_return { */ public function set_middle($middle) { if (!is_string($middle)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'middle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'middle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -939,7 +939,7 @@ class c_base_users_user_name extends c_base_return { */ public function set_last($last) { if (!is_string($last)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'last', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'last', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -956,7 +956,7 @@ class c_base_users_user_name extends c_base_return { */ public function set_suffix($suffix) { if (!is_string($suffix)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'suffix', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'suffix', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -973,7 +973,7 @@ class c_base_users_user_name extends c_base_return { */ public function set_complete($complete) { if (!is_string($complete)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'complete', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'complete', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_utf8.php b/common/base/classes/base_utf8.php index 3b79b15..c1b222f 100644 --- a/common/base/classes/base_utf8.php +++ b/common/base/classes/base_utf8.php @@ -77,7 +77,7 @@ class c_base_utf8 { */ public static function s_is_UTF_8($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -101,7 +101,7 @@ class c_base_utf8 { */ public static function s_character_to_ordinal($character) { if (!is_string($character)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -109,7 +109,7 @@ class c_base_utf8 { if ($ordinal === FALSE) { unset($ordinal); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_character_to_ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_character_to_ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -128,7 +128,7 @@ class c_base_utf8 { */ public static function s_ordinal_to_character($ordinal) { if (!is_int($ordinal)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -151,7 +151,7 @@ class c_base_utf8 { */ public static function s_length_string($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -159,7 +159,7 @@ class c_base_utf8 { if ($length === FALSE) { unset($length); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_length_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_length_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -181,12 +181,12 @@ class c_base_utf8 { */ public static function s_clean($text, $remove_bom = FALSE) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_bool($remove_bom)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'remove_bom', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'remove_bom', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -194,7 +194,7 @@ class c_base_utf8 { if ($sanitized === FALSE) { unset($sanitized); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_clean', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_clean', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -215,12 +215,12 @@ class c_base_utf8 { */ public static function s_split($text, $split_length = 1) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_int($split_length)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'split_length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'split_length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -228,7 +228,7 @@ class c_base_utf8 { if ($split === FALSE) { unset($split); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -247,16 +247,16 @@ class c_base_utf8 { */ public static function s_character_size_list($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } $size_list = self::p_s_character_size_list($text); if ($size_list === FALSE) { unset($size_list); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_character_size_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_character_size_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } return c_base_return_array::s_new($size_list); @@ -276,7 +276,7 @@ class c_base_utf8 { */ public static function s_character_max_width($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -284,7 +284,7 @@ class c_base_utf8 { if ($size_list === FALSE) { unset($size_list); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_character_size_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_character_size_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -305,7 +305,7 @@ class c_base_utf8 { */ public static function s_encode_html_character($character) { if (!is_string($character)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -313,7 +313,7 @@ class c_base_utf8 { if ($encoded === FALSE) { unset($encoded); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_encode_html_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_encode_html_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -332,7 +332,7 @@ class c_base_utf8 { */ public static function s_encode_html($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -340,11 +340,11 @@ class c_base_utf8 { if ($split === FALSE) { unset($split); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } - $new_array = array(); + $new_array = []; foreach ($split as $character) { $encoded = self::p_s_character_to_ordinal($character); if ($encoded === FALSE) { @@ -381,17 +381,17 @@ class c_base_utf8 { */ public static function s_substring($text, $start = 0, $length = NULL) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_int($start)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_null($length) && !is_int($length)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -414,7 +414,7 @@ class c_base_utf8 { */ public static function s_lowercase($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -437,7 +437,7 @@ class c_base_utf8 { */ public static function s_uppercase($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -457,7 +457,7 @@ class c_base_utf8 { */ public static function s_is_bom($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -479,12 +479,12 @@ class c_base_utf8 { */ public static function s_file_has_bom($file_path) { if (!is_string($file_path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'file_path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'file_path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!file_exists($file_path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $file_path, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{file_name}' => $file_path, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -506,7 +506,7 @@ class c_base_utf8 { */ public static function s_string_has_bom($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -531,7 +531,7 @@ class c_base_utf8 { */ public static function s_prepend_bom($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -554,7 +554,7 @@ class c_base_utf8 { */ public static function s_reverse($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -562,7 +562,7 @@ class c_base_utf8 { if ($split === FALSE) { unset($split); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -591,17 +591,17 @@ class c_base_utf8 { */ public static function s_position_string($haystack, $needle, $offset = 0) { if (!is_string($haystack)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'haystack', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'haystack', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($needle) && !is_string($needle)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'needle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'needle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($offset) || $offset < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'offset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'offset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -628,7 +628,7 @@ class c_base_utf8 { */ public static function s_string_to_ordinals($text) { if (!is_string($text) && !is_array($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -648,16 +648,16 @@ class c_base_utf8 { */ public static function s_ordinals_to_string($ordinals) { if (!is_array($ordinals)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $errors = array(); + $errors = []; $string = ''; foreach ($ordinals as $ordinal) { $character = self::p_s_ordinal_to_character($ordinal); if ($character === FALSE) { - $errors[] = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_s_ordinal_to_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $errors[] = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_s_ordinal_to_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); continue; } @@ -695,16 +695,16 @@ class c_base_utf8 { */ public static function s_ordinals_to_string_array($ordinals) { if (!is_array($ordinals)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_value(array(), 'c_base_return_array', $error); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_value([], 'c_base_return_array', $error); } - $errors = array(); - $array = array(); + $errors = []; + $array = []; foreach ($ordinals as $ordinal) { $character = self::p_s_ordinal_to_character($ordinal); if ($character === FALSE) { - $errors[] = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_s_ordinal_to_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $errors[] = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'this->p_s_ordinal_to_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); continue; } @@ -741,11 +741,11 @@ class c_base_utf8 { */ public static function s_ordinal_array_to_string($ordinals) { if (!is_array($ordinals)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $array = array(); + $array = []; foreach ($ordinals as $key => $ordinal) { $array[$key] = self::p_s_ordinal_to_character($ordinal); } @@ -767,7 +767,7 @@ class c_base_utf8 { */ public static function s_ordinal_to_codepoint($ordinal) { if (!is_int($ordinal)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -775,7 +775,7 @@ class c_base_utf8 { if ($codepoint === FALSE) { unset($codepoint); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_orginal_to_codepoint', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_orginal_to_codepoint', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -800,22 +800,22 @@ class c_base_utf8 { */ public static function s_count_substrings($haystack, $needle, $offset = 0, $length = NULL) { if (!is_string($haystack)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'haystack', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'haystack', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($needle)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'needle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'needle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($offset)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'offset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'offset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($length) && !is_int($length)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -842,7 +842,7 @@ class c_base_utf8 { */ public static function s_is_ascii($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -867,12 +867,12 @@ class c_base_utf8 { */ public static function s_strip_tags($text, $allowable_tags = '') { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($allowable_tags)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allowable_tags', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'allowable_tags', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -881,7 +881,7 @@ class c_base_utf8 { if ($sanitized === FALSE) { unset($sanitized); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_clean', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'self::p_s_clean', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -981,7 +981,7 @@ class c_base_utf8 { $text = self::p_s_split($text); } - $ordinals = array(); + $ordinals = []; foreach ($text as $character) { $value = self::p_s_character_to_ordinal($character); if ($value === FALSE) { @@ -1030,7 +1030,7 @@ class c_base_utf8 { * @see: self::s_split() */ private static function p_s_split($text, $split_length = 1) { - $split = array(); + $split = []; $text = self::p_s_clean($text); preg_match_all('/\X/u', $text, $split); @@ -1042,7 +1042,7 @@ class c_base_utf8 { return FALSE; } - $array = array(); + $array = []; foreach ($split as $key => $value) { $array[$key] = implode($value); } @@ -1054,7 +1054,7 @@ class c_base_utf8 { } if (empty($split) || $split[0] === '') { - return array(); + return []; } return $split; @@ -1072,7 +1072,7 @@ class c_base_utf8 { return FALSE; } - $array = array(); + $array = []; foreach ($split as $key => $value) { $array[$key] = strlen($value); } diff --git a/common/base/classes/base_view.php b/common/base/classes/base_view.php index 1e62487..9d39c8f 100644 --- a/common/base/classes/base_view.php +++ b/common/base/classes/base_view.php @@ -76,44 +76,44 @@ class c_base_view extends c_base_array { * FALSE without error bit set is returned if nothing was done. * FALSE with error bit set is returned on error. */ - public function pull(&$database, $query = NULL, $arguments = array(), $conditions = NULL, $limit = NULL, $offset = NULL, $group_by = NULL, $order_by = NULL) { + public function pull(&$database, $query = NULL, $arguments = [], $conditions = NULL, $limit = NULL, $offset = NULL, $group_by = NULL, $order_by = NULL) { if (!($database instanceof c_base_database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($query) && !is_string($query)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($arguments)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'arguments', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'arguments', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($conditions) && !is_string($conditions)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($limit) && !is_string($limit)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($offset) && !is_string($offset)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'offset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'offset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($group_by) && !is_string($group_by)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'group_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'group_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($order_by) && !is_string($order_by)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'order_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'order_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_warning.php b/common/base/classes/base_warning.php index e635f50..d7be437 100644 --- a/common/base/classes/base_warning.php +++ b/common/base/classes/base_warning.php @@ -130,16 +130,16 @@ class c_base_warning_handler { } if (!is_array($this->warnings)) { - $this->warnings = array(); + $this->warnings = []; } - $this->warnings[] = array( + $this->warnings[] = [ 'code' => (int) $code, 'message' => (string) $message, 'file_name' => (is_null($file_name) ? NULL : (string) $file_name), 'line_number' => (is_null($line_number) ? NULL : (int) $line_number), 'context' => (is_null($context) ? NULL : (array) $context), - ); + ]; return TRUE; } diff --git a/common/standard/classes/standard_database.php b/common/standard/classes/standard_database.php index c517254..89f4849 100644 --- a/common/standard/classes/standard_database.php +++ b/common/standard/classes/standard_database.php @@ -16,21 +16,21 @@ class c_standard_database extends c_base_database { /** * Write a log to the database, associated with the current user. */ - public function do_log_user($log_type, $response_code, $data = array()) { + public function do_log_user($log_type, $response_code, $data = []) { if (!is_int($log_type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'log_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'log_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($response_code)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'response_code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'response_code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $query_string = 'insert into v_log_users_self_insert (log_title, log_type, log_type_sub, log_severity, log_facility, request_client, response_code, log_details)'; $query_string .= ' values ($1, $2, $3, $4, $5, ($6, $7, $8), $9, $10)'; - $query_parameters = array(); + $query_parameters = []; $query_parameters[5] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0'; $query_parameters[6] = isset($_SERVER['REMOTE_PORT']) && is_numeric($_SERVER['REMOTE_PORT']) ? (int) $_SERVER['REMOTE_PORT'] : 0; $query_parameters[7] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '' ; @@ -107,7 +107,7 @@ class c_standard_database extends c_base_database { unset($query_result); if (!empty($last_error)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_ERROR); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_ERROR); $false->set_error($error); } unset($last_error); diff --git a/common/standard/classes/standard_index.php b/common/standard/classes/standard_index.php index de90c26..fc92751 100644 --- a/common/standard/classes/standard_index.php +++ b/common/standard/classes/standard_index.php @@ -54,7 +54,7 @@ class c_standard_index extends c_base_return { public function __construct() { parent::__construct(); - $this->settings = array(); + $this->settings = []; // database information $this->settings['database_host'] = '127.0.0.1'; @@ -84,7 +84,7 @@ class c_standard_index extends c_base_return { $this->settings['ldap_bind_name'] = NULL; $this->settings['ldap_bind_password'] = NULL; $this->settings['ldap_base_dn'] = ''; - $this->settings['ldap_fields'] = array(); + $this->settings['ldap_fields'] = []; // base settings $this->settings['base_scheme'] = 'https'; @@ -174,7 +174,7 @@ class c_standard_index extends c_base_return { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -189,7 +189,7 @@ class c_standard_index extends c_base_return { */ public static function s_do_initialize_database(&$database) { if (!($database instanceof c_base_database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -314,7 +314,7 @@ class c_standard_index extends c_base_return { } else { $this->languages_selected = i_base_languages::ENGLISH_US; - $this->languages_all = array(i_base_languages::ENGLISH_US => i_base_languages::ENGLISH_US, i_base_languages::ENGLISH => i_base_languages::ENGLISH); + $this->languages_all = [i_base_languages::ENGLISH_US => i_base_languages::ENGLISH_US, i_base_languages::ENGLISH => i_base_languages::ENGLISH]; } // select the primary language. @@ -382,7 +382,7 @@ class c_standard_index extends c_base_return { unset($cookie_login); unset($no_session); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{session_name}' => $this->settings['cookie_name'], ':{function_name}' => __FUNCTION__)), i_base_error_messages::NO_SESSION); + $error = c_base_error::s_log(NULL, ['arguments' => [':{session_name}' => $this->settings['cookie_name'], ':{function_name}' => __FUNCTION__]], i_base_error_messages::NO_SESSION); return c_base_return_error::s_true($error); } unset($no_session); @@ -395,7 +395,7 @@ class c_standard_index extends c_base_return { unset($cookie_login); // cookie_login failed validation or the cookie contains no session id. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{session_name}' => $this->settings['cookie_name'], ':{function_name}' => __FUNCTION__)), i_base_error_messages::SESSION_INVALID); + $error = c_base_error::s_log(NULL, ['arguments' => [':{session_name}' => $this->settings['cookie_name'], ':{function_name}' => __FUNCTION__]], i_base_error_messages::SESSION_INVALID); // also set the error on the session object. $this->session->set_error($error); @@ -836,7 +836,7 @@ class c_standard_index extends c_base_return { $query_string = 'insert into v_log_user_activity_self_insert (request_path, request_arguments, request_client, request_headers, response_headers, response_code)'; $query_string .= ' values ($1, $2, ($3, $4, $5), $6, $7, $8)'; - $query_parameters = array(); + $query_parameters = []; $query_parameters[0] = $this->http->get_request_uri_relative($this->settings['base_path'])->get_value_exact(); $query_parameters[1] = $this->http->get_request_uri_query($this->settings['base_path'])->get_value_exact(); @@ -857,7 +857,7 @@ class c_standard_index extends c_base_return { unset($query_result); if (!empty($last_error)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_ERROR); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_ERROR); $false->set_error($error); } unset($last_error); diff --git a/common/standard/classes/standard_menu.php b/common/standard/classes/standard_menu.php index b6224a6..eae7ec2 100644 --- a/common/standard/classes/standard_menu.php +++ b/common/standard/classes/standard_menu.php @@ -46,7 +46,7 @@ class c_standard_menu extends c_base_menu { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -69,10 +69,10 @@ class c_standard_menu extends c_base_menu { * The created markup tag with error bit set on error. */ protected function pr_create_html_create_menu($name_machine = NULL, $name_human = NULL, $depth = 1) { - $menu = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_NAVIGATION, $name_machine, array(static::CSS_MENU)); + $menu = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_NAVIGATION, $name_machine, [static::CSS_MENU]); if (is_string($name_human)) { - $wrapper = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_MENU_HEADER, static::CSS_MENU_HEADER . '-' . $depth)); + $wrapper = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, [static::CSS_MENU_HEADER, static::CSS_MENU_HEADER . '-' . $depth]); if ($depth == 1) { $type = c_base_markup_tag::TYPE_H1; @@ -96,7 +96,7 @@ class c_standard_menu extends c_base_menu { $type = c_base_markup_tag::TYPE_HX; } - $header = c_theme_html::s_create_tag($type, NULL, array(static::CSS_MENU_HEADER_TEXT, static::CSS_MENU_HEADER_TEXT . '-' . $depth)); + $header = c_theme_html::s_create_tag($type, NULL, [static::CSS_MENU_HEADER_TEXT, static::CSS_MENU_HEADER_TEXT . '-' . $depth]); unset($type); if ($depth > 6) { @@ -130,9 +130,9 @@ class c_standard_menu extends c_base_menu { * Markup tag with error bit set on error. */ protected function pr_create_html_add_menu_item_label($label, $tooltip = NULL) { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_MENU_ITEM, static::CSS_ITEM_LABEL)); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, [static::CSS_MENU_ITEM, static::CSS_ITEM_LABEL]); - $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, NULL, array(static::CSS_MENU_ITEM_CONTENT)); + $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, NULL, [static::CSS_MENU_ITEM_CONTENT]); $tag_content->set_text($label); if (is_string($tooltip)) { @@ -164,7 +164,7 @@ class c_standard_menu extends c_base_menu { * Markup tag with error bit set on error. */ protected function pr_create_html_add_menu_item_link($label, $uri, $tooltip = NULL, $local = TRUE) { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_MENU_ITEM, static::CSS_ITEM_LINK)); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, [static::CSS_MENU_ITEM, static::CSS_ITEM_LINK]); if ($local) { $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CSS_ITEM_LOCAL); @@ -173,7 +173,7 @@ class c_standard_menu extends c_base_menu { $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CSS_ITEM_REMOTE); } - $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array(static::CSS_MENU_ITEM_CONTENT)); + $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, [static::CSS_MENU_ITEM_CONTENT]); $tag_content->set_text($label); $tag_content->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $uri); @@ -204,11 +204,11 @@ class c_standard_menu extends c_base_menu { * Markup tag with error bit set on error. */ protected function pr_create_html_add_menu_item_menu($label, $menu, $tooltip = NULL) { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_MENU_ITEM, static::CSS_ITEM_MENU)); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, [static::CSS_MENU_ITEM, static::CSS_ITEM_MENU]); $tag->set_text($label); - $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, NULL, array(static::CSS_MENU_ITEM_CONTENT)); + $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, NULL, [static::CSS_MENU_ITEM_CONTENT]); $tag_content->set_tag($menu); if (is_string($tooltip)) { @@ -229,7 +229,7 @@ class c_standard_menu extends c_base_menu { * @param array $arguments * (optional) An array of arguments to convert into text. */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { return ''; } diff --git a/common/standard/classes/standard_path.php b/common/standard/classes/standard_path.php index 389feb2..57c71e1 100644 --- a/common/standard/classes/standard_path.php +++ b/common/standard/classes/standard_path.php @@ -120,15 +120,15 @@ class c_standard_path extends c_base_path { $this->http = NULL; $this->database = NULL; $this->session = NULL; - $this->settings = array(); + $this->settings = []; - $this->languages = array(); + $this->languages = []; $this->language_alias = NULL; $this->text_type = NULL; $this->request_uri = NULL; $this->breadcrumbs = NULL; - $this->arguments = array(); + $this->arguments = []; $this->output_format = c_base_mime::TYPE_TEXT_HTML; } @@ -157,7 +157,7 @@ class c_standard_path extends c_base_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { return $executed; @@ -186,7 +186,7 @@ class c_standard_path extends c_base_path { $this->languages = $this->http->get_response_content_language()->get_value_exact(); if (!is_array($this->languages)) { - $this->languages = array(); + $this->languages = []; } $this->pr_get_language_alias(); @@ -237,7 +237,7 @@ class c_standard_path extends c_base_path { if (mb_strlen($path) == 0) { unset($path); - $this->arguments = array(); + $this->arguments = []; return FALSE; } @@ -359,8 +359,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_section($headers = NULL, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_SECTION, static::CSS_AS_SECTION); + protected function pr_create_tag_section($headers = NULL, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_SECTION, static::CSS_AS_SECTION]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -398,7 +398,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_wrapper($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_WRAPPER, static::CSS_AS_WRAPPER); + $classes = [$this->settings['base_css'] . static::CSS_AS_WRAPPER, static::CSS_AS_WRAPPER]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -427,7 +427,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_break($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_BREAK, static::CSS_AS_BREAK); + $classes = [$this->settings['base_css'] . static::CSS_AS_BREAK, static::CSS_AS_BREAK]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -459,8 +459,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_text($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT); + protected function pr_create_tag_text($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -501,8 +501,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_header($text, $header, $arguments = array(), $id = NULL, $extra_class = NULL, $prepend = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_HEADER, static::CSS_AS_HEADER, static::CSS_AS_HEADER . '-' . $header); + protected function pr_create_tag_header($text, $header, $arguments = [], $id = NULL, $extra_class = NULL, $prepend = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_HEADER, static::CSS_AS_HEADER, static::CSS_AS_HEADER . '-' . $header]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -583,8 +583,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_headers($headers, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_HEADERS, static::CSS_AS_HEADERS); + protected function pr_create_tag_headers($headers, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_HEADERS, static::CSS_AS_HEADERS]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -660,8 +660,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_paragraph($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_PARAGRAPH, static::CSS_AS_PARAGRAPH); + protected function pr_create_tag_paragraph($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_PARAGRAPH, static::CSS_AS_PARAGRAPH]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -698,8 +698,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_text_block($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TEXT_BLOCK, static::CSS_AS_TEXT_BLOCK); + protected function pr_create_tag_text_block($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_TEXT_BLOCK, static::CSS_AS_TEXT_BLOCK]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -715,10 +715,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if (is_int($text)) { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT], $this->pr_get_text($text, $arguments)); } else { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $text); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT], $text); } $block->set_tag($tag); @@ -749,8 +749,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_paragraph_block($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_PARAGRAPH_BLOCK, static::CSS_AS_PARAGRAPH_BLOCK); + protected function pr_create_tag_paragraph_block($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_PARAGRAPH_BLOCK, static::CSS_AS_PARAGRAPH_BLOCK]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -766,10 +766,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if (is_int($text)) { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT], $this->pr_get_text($text, $arguments)); } else { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $text); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT], $text); } $block->set_tag($tag); @@ -805,8 +805,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_link($text, $tooltip, $destination, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_LINK, static::CSS_AS_LINK); + protected function pr_create_tag_link($text, $tooltip, $destination, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_LINK, static::CSS_AS_LINK]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -821,10 +821,10 @@ class c_standard_path extends c_base_path { unset($classes); if (is_int($text)) { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT], $this->pr_get_text($text, $arguments)); } else { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $text); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT], $text); } if (is_array($destination)) { @@ -881,8 +881,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_link_block($text, $tooltip, $destination, $description, $arguments = array(), $header = 0, $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_LINK_BLOCK, static::CSS_AS_LINK_BLOCK); + protected function pr_create_tag_link_block($text, $tooltip, $destination, $description, $arguments = [], $header = 0, $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_LINK_BLOCK, static::CSS_AS_LINK_BLOCK]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -898,10 +898,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if ($header < 1) { - $wrapper = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_AS_TEXT, static::CSS_AS_LINK_BLOCK_NAME)); + $wrapper = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, [static::CSS_AS_TEXT, static::CSS_AS_LINK_BLOCK_NAME]); } else { - $header_classes = array($this->settings['base_css'] . static::CSS_AS_HEADER, static::CSS_AS_HEADER, static::CSS_AS_HEADER . '-' . $header, static::CSS_AS_LINK_BLOCK_NAME); + $header_classes = [$this->settings['base_css'] . static::CSS_AS_HEADER, static::CSS_AS_HEADER, static::CSS_AS_HEADER . '-' . $header, static::CSS_AS_LINK_BLOCK_NAME]; if ($header == 1) { $type = c_base_markup_tag::TYPE_H1; @@ -975,8 +975,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_fieldset($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_PARAGRAPH_BLOCK, static::CSS_AS_PARAGRAPH_BLOCK); + protected function pr_create_tag_fieldset($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_PARAGRAPH_BLOCK, static::CSS_AS_PARAGRAPH_BLOCK]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -992,10 +992,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if (is_int($text)) { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_FIELD_SET_LEGEND, static::CSS_AS_FIELD_SET_LEGEND), $this->pr_get_text($text, $arguments)); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, [$this->settings['base_css'] . static::CSS_AS_FIELD_SET_LEGEND, static::CSS_AS_FIELD_SET_LEGEND], $this->pr_get_text($text, $arguments)); } else { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_FIELD_SET_LEGEND, static::CSS_AS_FIELD_SET_LEGEND), $text); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, [$this->settings['base_css'] . static::CSS_AS_FIELD_SET_LEGEND, static::CSS_AS_FIELD_SET_LEGEND], $text); } $block->set_tag($tag); @@ -1027,8 +1027,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_row($value = NULL, $arguments = array(), $id = NULL, $extra_class = NULL, $row = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_ROW, static::CSS_AS_ROW); + protected function pr_create_tag_row($value = NULL, $arguments = [], $id = NULL, $extra_class = NULL, $row = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_ROW, static::CSS_AS_ROW]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1083,8 +1083,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_field_row($field_name = NULL, $field_value = NULL, $arguments = array(), $id = NULL, $extra_class = NULL, $row = NULL, $spacer = FALSE) { - $classes = array($this->settings['base_css'] . static::CSS_AS_FIELD_ROW, static::CSS_AS_FIELD_ROW); + protected function pr_create_tag_field_row($field_name = NULL, $field_value = NULL, $arguments = [], $id = NULL, $extra_class = NULL, $row = NULL, $spacer = FALSE) { + $classes = [$this->settings['base_css'] . static::CSS_AS_FIELD_ROW, static::CSS_AS_FIELD_ROW]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1139,8 +1139,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_table($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE, static::CSS_AS_TABLE); + protected function pr_create_tag_table($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE, static::CSS_AS_TABLE]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1155,10 +1155,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if (is_int($text)) { - $tag_text = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CAPTION, NULL, array($this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION), $this->pr_get_text($text, $arguments)); + $tag_text = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CAPTION, NULL, [$this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION], $this->pr_get_text($text, $arguments)); } else { - $tag_text = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CAPTION, NULL, array($this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION), $text); + $tag_text = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CAPTION, NULL, [$this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION], $text); } $tag->set_tag($tag_text); @@ -1188,8 +1188,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_table_caption($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION); + protected function pr_create_tag_table_caption($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1226,7 +1226,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_column($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_COLUMN, static::CSS_AS_TABLE_COLUMN); + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_COLUMN, static::CSS_AS_TABLE_COLUMN]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1255,7 +1255,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_column_group($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_COLUMN_GROUP, static::CSS_AS_TABLE_COLUMN_GROUP); + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_COLUMN_GROUP, static::CSS_AS_TABLE_COLUMN_GROUP]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1284,7 +1284,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_header($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_HEADER, static::CSS_AS_TABLE_HEADER); + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_HEADER, static::CSS_AS_TABLE_HEADER]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1318,8 +1318,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_table_header_cell($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_HEADER_CELL, static::CSS_AS_TABLE_HEADER_CELL); + protected function pr_create_tag_table_header_cell($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_HEADER_CELL, static::CSS_AS_TABLE_HEADER_CELL]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1356,7 +1356,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_body($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_BODY, static::CSS_AS_TABLE_BODY); + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_BODY, static::CSS_AS_TABLE_BODY]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1385,7 +1385,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_row($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_ROW, static::CSS_AS_TABLE_ROW); + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_ROW, static::CSS_AS_TABLE_ROW]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1419,8 +1419,8 @@ class c_standard_path extends c_base_path { * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_table_cell($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_CELL, static::CSS_AS_TABLE_CELL); + protected function pr_create_tag_table_cell($text, $arguments = [], $id = NULL, $extra_class = NULL) { + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_CELL, static::CSS_AS_TABLE_CELL]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1457,7 +1457,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_footer($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_FOOTER, static::CSS_AS_TABLE_FOOTER); + $classes = [$this->settings['base_css'] . static::CSS_AS_TABLE_FOOTER, static::CSS_AS_TABLE_FOOTER]; if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1497,7 +1497,7 @@ class c_standard_path extends c_base_path { * @see: self::pr_create_html_add_header_link_shortlink() * @see: self::pr_create_html_add_header_script() */ - protected function pr_create_html($real_page = TRUE, $arguments_title = array(), $arguments_script = array()) { + protected function pr_create_html($real_page = TRUE, $arguments_title = [], $arguments_script = []) { $this->html = new c_base_html(); $this->pr_create_html_add_primary_ids(); @@ -1608,7 +1608,7 @@ class c_standard_path extends c_base_path { * * @see: self::pr_create_html() */ - protected function pr_create_html_add_title($arguments = array()) { + protected function pr_create_html_add_title($arguments = []) { $title = $this->pr_get_text_title($arguments); if (is_string($title)) { @@ -1692,7 +1692,7 @@ class c_standard_path extends c_base_path { // assign content http-equiv header tag - $aliases = array(); + $aliases = []; if (!empty($this->languages)) { // assign the primary language. $language_aliases = c_base_defaults_global::s_get_languages()::s_get_aliases_by_id(reset($this->languages))->get_value_exact(); @@ -1764,7 +1764,7 @@ class c_standard_path extends c_base_path { * * @see: self::pr_create_html() */ - protected function pr_create_html_add_header_script($arguments = array()) { + protected function pr_create_html_add_header_script($arguments = []) { // provide a custom javascript for detecting if javascript is enabled and storing in a css class name. $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SCRIPT, 'f_standard_paths_hmtl_javascript_detection'); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_TYPE, c_base_mime::TYPE_TEXT_JS); @@ -1790,7 +1790,7 @@ class c_standard_path extends c_base_path { * The markup tag to assign the spacer to. */ protected function pr_create_tag_spacer(&$tag) { - $tag_text = $this->pr_create_tag_text(' ', array(), NULL, static::CSS_AS_SPACER); + $tag_text = $this->pr_create_tag_text(' ', [], NULL, static::CSS_AS_SPACER); $tag->set_tag($tag_text); unset($tag_text); } @@ -1976,7 +1976,7 @@ class c_standard_path extends c_base_path { * A string is returned as the custom title. * NULL is returned to enforce default title. */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return NULL; } @@ -1991,7 +1991,7 @@ class c_standard_path extends c_base_path { * @return string * A string is returned as the custom text. */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { return ''; } @@ -1999,7 +1999,7 @@ class c_standard_path extends c_base_path { * Load and save the current preferred language alias. */ protected function pr_get_language_alias() { - $aliases = array(); + $aliases = []; if (is_array($this->languages) && !empty($this->languages)) { $language = reset($this->languages); @@ -2083,7 +2083,7 @@ class c_standard_path extends c_base_path { * TRUE on success, FALSE otherwise. */ protected function pr_process_arguments(&$executed) { - $this->arguments = array(); + $this->arguments = []; return TRUE; } diff --git a/common/standard/classes/standard_path_user.php b/common/standard/classes/standard_path_user.php index f84cbfa..0823cd6 100644 --- a/common/standard/classes/standard_path_user.php +++ b/common/standard/classes/standard_path_user.php @@ -52,7 +52,7 @@ class c_standard_path_user extends c_standard_path { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return $this->pr_get_text(0, $arguments); } @@ -103,7 +103,7 @@ class c_standard_path_user extends c_standard_path { $this->path_user_id = FALSE; unset($argument); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -151,7 +151,7 @@ class c_standard_path_user extends c_standard_path { unset($argument); unset($arguments_total); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -186,7 +186,7 @@ class c_standard_path_user extends c_standard_path { } if ($this->path_user_id === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); diff --git a/common/standard/classes/standard_paths.php b/common/standard/classes/standard_paths.php index fb275dd..910e192 100644 --- a/common/standard/classes/standard_paths.php +++ b/common/standard/classes/standard_paths.php @@ -186,7 +186,7 @@ class c_standard_paths extends c_base_return { parent::__construct(); $this->handler = NULL; - $this->paths = array(); + $this->paths = []; $this->http = NULL; $this->database = NULL; @@ -235,7 +235,7 @@ class c_standard_paths extends c_base_return { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -339,27 +339,27 @@ class c_standard_paths extends c_base_return { public function do_process_path(&$http, &$database, &$session, $settings) { // @todo: these parameter errors might need a custom service unavailable and system log support. if (!($http instanceof c_base_http)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_return('c_base_path_executed', $error); } if (!($database instanceof c_base_database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_return('c_base_path_executed', $error); } if (!($session instanceof c_base_session)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_return('c_base_path_executed', $error); } if (!is_array($settings)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_return('c_base_path_executed', $error); } if (!($session instanceof c_base_session)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_return('c_base_path_executed', $error); } @@ -379,7 +379,7 @@ class c_standard_paths extends c_base_return { $path_tree = new c_base_path_tree(); $path_tree->set_id_group(0); - $path_tree->set_items(array()); + $path_tree->set_items([]); $path_not_found->set_path_tree($path_tree); unset($path_tree); @@ -481,7 +481,7 @@ class c_standard_paths extends c_base_return { } } else { - $path_tree->set_items(array()); + $path_tree->set_items([]); $handler_settings_index = $this->paths->find_path('')->get_value(); if (isset($handler_settings_index['handler'])) { @@ -503,7 +503,7 @@ class c_standard_paths extends c_base_return { $path_tree->set_items($handler_settings['path_tree']); } else { - $path_tree->set_items(array()); + $path_tree->set_items([]); } if (isset($handler_settings['id_group'])) { @@ -537,7 +537,7 @@ class c_standard_paths extends c_base_return { $options_method_path->set_allowed_methods($handler_settings['methods']); } else { - $options_method_path->set_allowed_methods(array()); + $options_method_path->set_allowed_methods([]); } $options_method_path->set_path_tree($path_tree); @@ -1033,7 +1033,7 @@ class c_standard_paths extends c_base_return { * Load and save the current preferred language alias. */ protected function pr_get_language_alias() { - $aliases = array(); + $aliases = []; $languages = $this->http->get_response_content_language()->get_value_exact(); if (is_array($languages) && !empty($languages)) { $language = reset($languages); diff --git a/common/standard/classes/standard_users.php b/common/standard/classes/standard_users.php index 73ccc80..8c6eb61 100644 --- a/common/standard/classes/standard_users.php +++ b/common/standard/classes/standard_users.php @@ -49,7 +49,7 @@ class c_standard_users_user extends c_base_users_user { * @see: t_base_return_value_exact::p_s_value_exact() */ public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); + return self::p_s_value_exact($return, __CLASS__, []); } /** @@ -57,22 +57,22 @@ class c_standard_users_user extends c_base_users_user { */ public function do_load(&$database, $user_name_or_id = NULL, $administrative = FALSE) { if (!($database instanceof c_base_database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($user_name_or_id) && !is_int($user_name_or_id) && $user_name_or_id !== TRUE && !is_string($user_name_or_id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'user_name_or_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'user_name_or_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($administrative)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'administrative', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'administrative', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $query_string = 'select id, id_external, id_sort, name_machine, name_human, address_email, is_public, is_system, is_requester, is_drafter, is_editor, is_reviewer, is_insurer, is_financer, is_publisher, is_auditor, is_manager, is_administer, is_private, is_locked, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, date_deleted, image_original, image_cropped, image_icon, settings '; - $query_arguments = array(); + $query_arguments = []; if (is_null($user_name_or_id)) { $query_string .= 'from v_users_self'; @@ -110,7 +110,7 @@ class c_standard_users_user extends c_base_users_user { $last_error = $database->get_last_error()->get_value_exact(); if (!empty($last_error)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_ERROR); + $error = c_base_error::s_log(NULL, ['arguments' => [':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_ERROR); $false->set_error($error); unset($error); } @@ -299,7 +299,7 @@ class c_standard_users_user extends c_base_users_user { $this->settings = json_decode($columns[30], TRUE); } else { - $this->settings = array(); + $this->settings = []; } } else { diff --git a/common/standard/internal/access_denied.php b/common/standard/internal/access_denied.php index ce65bc6..c3e63d0 100644 --- a/common/standard/internal/access_denied.php +++ b/common/standard/internal/access_denied.php @@ -17,7 +17,7 @@ class c_standard_path_access_denied extends c_standard_path_exception { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -49,14 +49,14 @@ class c_standard_path_access_denied extends c_standard_path_exception { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return $this->pr_get_text(0, $arguments); } /** * Implements pr_get_text_breadcrumbs(). */ - protected function pr_get_text_breadcrumbs($code, $arguments = array()) { + protected function pr_get_text_breadcrumbs($code, $arguments = []) { $string = ''; switch ($code) { case 0: @@ -74,7 +74,7 @@ class c_standard_path_access_denied extends c_standard_path_exception { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/bad_method.php b/common/standard/internal/bad_method.php index 9676af8..2ded5e3 100644 --- a/common/standard/internal/bad_method.php +++ b/common/standard/internal/bad_method.php @@ -17,7 +17,7 @@ class c_standard_path_bad_method extends c_standard_path_exception { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // @todo: This needs to return the HTTP invalid method response status. // the parent function performs validation on the parameters. @@ -51,14 +51,14 @@ class c_standard_path_bad_method extends c_standard_path_exception { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return $this->pr_get_text(0, $arguments); } /** * Implements pr_get_text_breadcrumbs(). */ - protected function pr_get_text_breadcrumbs($code, $arguments = array()) { + protected function pr_get_text_breadcrumbs($code, $arguments = []) { $string = ''; switch ($code) { case 0: @@ -76,7 +76,7 @@ class c_standard_path_bad_method extends c_standard_path_exception { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/index.php b/common/standard/internal/index.php index 6ec93c6..5a4bf8c 100644 --- a/common/standard/internal/index.php +++ b/common/standard/internal/index.php @@ -31,7 +31,7 @@ class c_standard_path_index extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -58,14 +58,14 @@ class c_standard_path_index extends c_standard_path { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return $this->pr_get_text(0, $arguments); } /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/ja/access_denied.php b/common/standard/internal/ja/access_denied.php index 34fb8b4..243dacd 100644 --- a/common/standard/internal/ja/access_denied.php +++ b/common/standard/internal/ja/access_denied.php @@ -13,7 +13,7 @@ final class c_standard_path_access_denied_ja extends c_standard_path_access_deni /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/ja/bad_method.php b/common/standard/internal/ja/bad_method.php index 5b29328..a399324 100644 --- a/common/standard/internal/ja/bad_method.php +++ b/common/standard/internal/ja/bad_method.php @@ -13,7 +13,7 @@ final class c_standard_path_bad_method_ja extends c_standard_path_bad_method { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/ja/index.php b/common/standard/internal/ja/index.php index fac2b1e..9945454 100644 --- a/common/standard/internal/ja/index.php +++ b/common/standard/internal/ja/index.php @@ -13,7 +13,7 @@ final class c_standard_path_index_ja extends c_standard_path_index { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/ja/not_found.php b/common/standard/internal/ja/not_found.php index d81a271..9de2a6f 100644 --- a/common/standard/internal/ja/not_found.php +++ b/common/standard/internal/ja/not_found.php @@ -13,7 +13,7 @@ final class c_standard_path_not_found_ja extends c_standard_path_not_found { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/ja/server_error.php b/common/standard/internal/ja/server_error.php index 51fab44..d9cbe1b 100644 --- a/common/standard/internal/ja/server_error.php +++ b/common/standard/internal/ja/server_error.php @@ -13,7 +13,7 @@ final class c_standard_path_server_error_ja extends c_standard_path_server_error /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/not_found.php b/common/standard/internal/not_found.php index 8c10cdd..f36da42 100644 --- a/common/standard/internal/not_found.php +++ b/common/standard/internal/not_found.php @@ -17,7 +17,7 @@ class c_standard_path_not_found extends c_standard_path_exception { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -49,14 +49,14 @@ class c_standard_path_not_found extends c_standard_path_exception { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return $this->pr_get_text(0, $arguments); } /** * Implements pr_get_text_breadcrumbs(). */ - protected function pr_get_text_breadcrumbs($code, $arguments = array()) { + protected function pr_get_text_breadcrumbs($code, $arguments = []) { $string = ''; switch ($code) { case 0: @@ -74,7 +74,7 @@ class c_standard_path_not_found extends c_standard_path_exception { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/internal/options.php b/common/standard/internal/options.php index 25b18b5..bd0c9f5 100644 --- a/common/standard/internal/options.php +++ b/common/standard/internal/options.php @@ -19,7 +19,7 @@ final class c_standard_path_options_method extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -46,7 +46,7 @@ final class c_standard_path_options_method extends c_standard_path { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { return ''; } } diff --git a/common/standard/internal/server_error.php b/common/standard/internal/server_error.php index 5c49f96..ab660da 100644 --- a/common/standard/internal/server_error.php +++ b/common/standard/internal/server_error.php @@ -17,7 +17,7 @@ class c_standard_path_server_error extends c_standard_path_exception { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -49,14 +49,14 @@ class c_standard_path_server_error extends c_standard_path_exception { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return $this->pr_get_text(0, $arguments); } /** * Implements pr_get_text_breadcrumbs(). */ - protected function pr_get_text_breadcrumbs($code, $arguments = array()) { + protected function pr_get_text_breadcrumbs($code, $arguments = []) { $string = ''; switch ($code) { case 0: @@ -74,7 +74,7 @@ class c_standard_path_server_error extends c_standard_path_exception { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/ja/menu_breadcrumbs.php b/common/standard/menus/ja/menu_breadcrumbs.php index 64d7e31..7164dab 100644 --- a/common/standard/menus/ja/menu_breadcrumbs.php +++ b/common/standard/menus/ja/menu_breadcrumbs.php @@ -15,7 +15,7 @@ class c_standard_menu_breadcrumbs_ja extends c_standard_menu_breadcrumbs { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/ja/menu_content.php b/common/standard/menus/ja/menu_content.php index 778f232..3cef6f0 100644 --- a/common/standard/menus/ja/menu_content.php +++ b/common/standard/menus/ja/menu_content.php @@ -15,7 +15,7 @@ class c_standard_menu_content_ja extends c_standard_menu_content { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/ja/menu_content_user_view.php b/common/standard/menus/ja/menu_content_user_view.php index a18079e..67c4c42 100644 --- a/common/standard/menus/ja/menu_content_user_view.php +++ b/common/standard/menus/ja/menu_content_user_view.php @@ -15,7 +15,7 @@ class c_standard_menu_content_user_view_ja extends c_standard_menu_content_user_ /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/ja/menu_footer.php b/common/standard/menus/ja/menu_footer.php index d3a353b..8ed2d62 100644 --- a/common/standard/menus/ja/menu_footer.php +++ b/common/standard/menus/ja/menu_footer.php @@ -15,7 +15,7 @@ class c_standard_menu_footer_ja extends c_standard_menu_footer { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/ja/menu_header.php b/common/standard/menus/ja/menu_header.php index e96681a..9be97c7 100644 --- a/common/standard/menus/ja/menu_header.php +++ b/common/standard/menus/ja/menu_header.php @@ -15,7 +15,7 @@ class c_standard_menu_header_ja extends c_standard_menu_header { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/ja/menu_utility.php b/common/standard/menus/ja/menu_utility.php index 0e1a571..8d26d7d 100644 --- a/common/standard/menus/ja/menu_utility.php +++ b/common/standard/menus/ja/menu_utility.php @@ -15,7 +15,7 @@ class c_standard_menu_utility_ja extends c_standard_menu_utility { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/menu_breadcrumbs.php b/common/standard/menus/menu_breadcrumbs.php index 374360e..c526c9d 100644 --- a/common/standard/menus/menu_breadcrumbs.php +++ b/common/standard/menus/menu_breadcrumbs.php @@ -77,7 +77,7 @@ class c_standard_menu_breadcrumbs extends c_standard_menu { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/menu_content.php b/common/standard/menus/menu_content.php index 4a183ff..b4851c7 100644 --- a/common/standard/menus/menu_content.php +++ b/common/standard/menus/menu_content.php @@ -22,7 +22,7 @@ class c_standard_menu_content extends c_standard_menu { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/menu_content_user_view.php b/common/standard/menus/menu_content_user_view.php index c160bbc..154de77 100644 --- a/common/standard/menus/menu_content_user_view.php +++ b/common/standard/menus/menu_content_user_view.php @@ -120,7 +120,7 @@ class c_standard_menu_content_user_view extends c_standard_menu_content { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/menu_footer.php b/common/standard/menus/menu_footer.php index 069e61f..01545db 100644 --- a/common/standard/menus/menu_footer.php +++ b/common/standard/menus/menu_footer.php @@ -22,7 +22,7 @@ class c_standard_menu_footer extends c_standard_menu { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/menu_header.php b/common/standard/menus/menu_header.php index 104c471..c3b41a2 100644 --- a/common/standard/menus/menu_header.php +++ b/common/standard/menus/menu_header.php @@ -22,7 +22,7 @@ class c_standard_menu_header extends c_standard_menu { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/menus/menu_utility.php b/common/standard/menus/menu_utility.php index 4a92a9b..a245ad6 100644 --- a/common/standard/menus/menu_utility.php +++ b/common/standard/menus/menu_utility.php @@ -96,7 +96,7 @@ class c_standard_menu_utility extends c_standard_menu { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/a/administer_content.php b/common/standard/paths/a/administer_content.php index 343f810..340410b 100644 --- a/common/standard/paths/a/administer_content.php +++ b/common/standard/paths/a/administer_content.php @@ -28,7 +28,7 @@ class c_standard_path_administer_content extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -42,7 +42,7 @@ class c_standard_path_administer_content extends c_standard_path { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -54,7 +54,7 @@ class c_standard_path_administer_content extends c_standard_path { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -106,7 +106,7 @@ class c_standard_path_administer_content extends c_standard_path { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/a/administer_dashboard.php b/common/standard/paths/a/administer_dashboard.php index 8b2dd0a..ced8ca6 100644 --- a/common/standard/paths/a/administer_dashboard.php +++ b/common/standard/paths/a/administer_dashboard.php @@ -27,7 +27,7 @@ class c_standard_path_administer_dashboard extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -64,7 +64,7 @@ class c_standard_path_administer_dashboard extends c_standard_path { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { switch ($code) { case 0: $string = 'Administration Dashboard'; diff --git a/common/standard/paths/a/administer_logs.php b/common/standard/paths/a/administer_logs.php index dd798fe..d997508 100644 --- a/common/standard/paths/a/administer_logs.php +++ b/common/standard/paths/a/administer_logs.php @@ -28,7 +28,7 @@ class c_standard_path_administer_logs extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -42,7 +42,7 @@ class c_standard_path_administer_logs extends c_standard_path { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -54,7 +54,7 @@ class c_standard_path_administer_logs extends c_standard_path { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -106,7 +106,7 @@ class c_standard_path_administer_logs extends c_standard_path { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/a/ja/administer_content.php b/common/standard/paths/a/ja/administer_content.php index 47c87df..8fa5111 100644 --- a/common/standard/paths/a/ja/administer_content.php +++ b/common/standard/paths/a/ja/administer_content.php @@ -13,7 +13,7 @@ class c_standard_path_administer_content_ja extends c_standard_path_administer_c /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/a/ja/administer_dashboard.php b/common/standard/paths/a/ja/administer_dashboard.php index ee7aec8..09051da 100644 --- a/common/standard/paths/a/ja/administer_dashboard.php +++ b/common/standard/paths/a/ja/administer_dashboard.php @@ -13,7 +13,7 @@ class c_standard_path_administer_dashboard_ja extends c_standard_path_administer /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/a/ja/administer_logs.php b/common/standard/paths/a/ja/administer_logs.php index 5158d7d..5efac20 100644 --- a/common/standard/paths/a/ja/administer_logs.php +++ b/common/standard/paths/a/ja/administer_logs.php @@ -13,7 +13,7 @@ class c_standard_path_administer_logs_ja extends c_standard_path_administer_logs /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/c/cache_error.php b/common/standard/paths/c/cache_error.php index 5bfb6b0..62f0f0e 100644 --- a/common/standard/paths/c/cache_error.php +++ b/common/standard/paths/c/cache_error.php @@ -27,7 +27,7 @@ class c_standard_path_cache_error extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -41,7 +41,7 @@ class c_standard_path_cache_error extends c_standard_path { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -53,7 +53,7 @@ class c_standard_path_cache_error extends c_standard_path { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); diff --git a/common/standard/paths/c/cache_static.php b/common/standard/paths/c/cache_static.php index 2d590ce..f7f8280 100644 --- a/common/standard/paths/c/cache_static.php +++ b/common/standard/paths/c/cache_static.php @@ -28,7 +28,7 @@ class c_standard_path_cache_static extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -42,7 +42,7 @@ class c_standard_path_cache_static extends c_standard_path { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -54,7 +54,7 @@ class c_standard_path_cache_static extends c_standard_path { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); diff --git a/common/standard/paths/f/file_by_checksum.php b/common/standard/paths/f/file_by_checksum.php index 24cfe2a..0f1d8b6 100644 --- a/common/standard/paths/f/file_by_checksum.php +++ b/common/standard/paths/f/file_by_checksum.php @@ -24,7 +24,7 @@ class c_standard_path_file_by_checksum extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { diff --git a/common/standard/paths/f/file_by_id.php b/common/standard/paths/f/file_by_id.php index eed1cc4..75277e5 100644 --- a/common/standard/paths/f/file_by_id.php +++ b/common/standard/paths/f/file_by_id.php @@ -24,7 +24,7 @@ class c_standard_path_file_by_checksum extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { diff --git a/common/standard/paths/f/file_checksum_by_checksum.php b/common/standard/paths/f/file_checksum_by_checksum.php index 1ebce3a..7a4ee60 100644 --- a/common/standard/paths/f/file_checksum_by_checksum.php +++ b/common/standard/paths/f/file_checksum_by_checksum.php @@ -24,7 +24,7 @@ class c_standard_path_file_checksum_by_checksum extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { diff --git a/common/standard/paths/f/file_checksum_by_id.php b/common/standard/paths/f/file_checksum_by_id.php index c576de2..8ae4d08 100644 --- a/common/standard/paths/f/file_checksum_by_id.php +++ b/common/standard/paths/f/file_checksum_by_id.php @@ -24,7 +24,7 @@ class c_standard_path_file_checksum_by_checksum extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { diff --git a/common/standard/paths/m/ja/management_content.php b/common/standard/paths/m/ja/management_content.php index 233959a..22fdac3 100644 --- a/common/standard/paths/m/ja/management_content.php +++ b/common/standard/paths/m/ja/management_content.php @@ -13,7 +13,7 @@ class c_standard_path_management_content_ja extends c_standard_path_management_c /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/m/ja/management_dashboard.php b/common/standard/paths/m/ja/management_dashboard.php index b3cac48..6b75076 100644 --- a/common/standard/paths/m/ja/management_dashboard.php +++ b/common/standard/paths/m/ja/management_dashboard.php @@ -13,7 +13,7 @@ class c_standard_path_management_dashboard_ja extends c_standard_path_management /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/m/ja/management_logs.php b/common/standard/paths/m/ja/management_logs.php index 5ed6c17..f9cc340 100644 --- a/common/standard/paths/m/ja/management_logs.php +++ b/common/standard/paths/m/ja/management_logs.php @@ -13,7 +13,7 @@ class c_standard_path_management_logs_ja extends c_standard_path_management_logs /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/m/management_content.php b/common/standard/paths/m/management_content.php index 1308fdb..4a2245b 100644 --- a/common/standard/paths/m/management_content.php +++ b/common/standard/paths/m/management_content.php @@ -28,7 +28,7 @@ class c_standard_path_management_content extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -42,7 +42,7 @@ class c_standard_path_management_content extends c_standard_path { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -54,7 +54,7 @@ class c_standard_path_management_content extends c_standard_path { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -106,7 +106,7 @@ class c_standard_path_management_content extends c_standard_path { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/m/management_dashboard.php b/common/standard/paths/m/management_dashboard.php index 7e2c34e..66e18a3 100644 --- a/common/standard/paths/m/management_dashboard.php +++ b/common/standard/paths/m/management_dashboard.php @@ -19,7 +19,7 @@ class c_standard_path_management_dashboard extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -56,7 +56,7 @@ class c_standard_path_management_dashboard extends c_standard_path { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { switch ($code) { case 0: $string = 'Management Dashboard'; diff --git a/common/standard/paths/m/management_logs.php b/common/standard/paths/m/management_logs.php index e2ae603..17198f8 100644 --- a/common/standard/paths/m/management_logs.php +++ b/common/standard/paths/m/management_logs.php @@ -28,7 +28,7 @@ class c_standard_path_management_logs extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -42,7 +42,7 @@ class c_standard_path_management_logs extends c_standard_path { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -54,7 +54,7 @@ class c_standard_path_management_logs extends c_standard_path { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -106,7 +106,7 @@ class c_standard_path_management_logs extends c_standard_path { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/s/submit_form_id.php b/common/standard/paths/s/submit_form_id.php index a443e5c..af8dd6f 100644 --- a/common/standard/paths/s/submit_form_id.php +++ b/common/standard/paths/s/submit_form_id.php @@ -24,7 +24,7 @@ class c_standard_path_submit_form_id extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { diff --git a/common/standard/paths/u/ja/user_check.php b/common/standard/paths/u/ja/user_check.php index 673a6bd..d40b7b3 100644 --- a/common/standard/paths/u/ja/user_check.php +++ b/common/standard/paths/u/ja/user_check.php @@ -13,7 +13,7 @@ class c_standard_path_user_check_ja extends c_standard_path_user_check { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_create.php b/common/standard/paths/u/ja/user_create.php index ccab400..a68d89d 100644 --- a/common/standard/paths/u/ja/user_create.php +++ b/common/standard/paths/u/ja/user_create.php @@ -12,7 +12,7 @@ class c_standard_path_user_create_ja extends c_standard_path_user_create { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_dashboard.php b/common/standard/paths/u/ja/user_dashboard.php index 7025ccc..cbfd343 100644 --- a/common/standard/paths/u/ja/user_dashboard.php +++ b/common/standard/paths/u/ja/user_dashboard.php @@ -13,7 +13,7 @@ class c_standard_path_user_dashboard_ja extends c_standard_path_user_dashboard { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_delete.php b/common/standard/paths/u/ja/user_delete.php index 607474b..06e6a60 100644 --- a/common/standard/paths/u/ja/user_delete.php +++ b/common/standard/paths/u/ja/user_delete.php @@ -13,7 +13,7 @@ class c_standard_path_user_delete_ja extends c_standard_path_user_delete { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_edit.php b/common/standard/paths/u/ja/user_edit.php index 79e74c8..3a4febf 100644 --- a/common/standard/paths/u/ja/user_edit.php +++ b/common/standard/paths/u/ja/user_edit.php @@ -13,7 +13,7 @@ class c_standard_path_user_edit_ja extends c_standard_path_user_edit { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_lock.php b/common/standard/paths/u/ja/user_lock.php index f84ec99..bcc5c5b 100644 --- a/common/standard/paths/u/ja/user_lock.php +++ b/common/standard/paths/u/ja/user_lock.php @@ -13,7 +13,7 @@ class c_standard_path_user_lock_ja extends c_standard_path_user_lock { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_login.php b/common/standard/paths/u/ja/user_login.php index 689ef3b..f1e2ae7 100644 --- a/common/standard/paths/u/ja/user_login.php +++ b/common/standard/paths/u/ja/user_login.php @@ -13,7 +13,7 @@ class c_standard_path_user_login_ja extends c_standard_path_user_login { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_logout.php b/common/standard/paths/u/ja/user_logout.php index 57ad387..48b5bf3 100644 --- a/common/standard/paths/u/ja/user_logout.php +++ b/common/standard/paths/u/ja/user_logout.php @@ -13,7 +13,7 @@ class c_standard_path_user_logout_ja extends c_standard_path_user_logout { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_refresh.php b/common/standard/paths/u/ja/user_refresh.php index 0617c58..5407942 100644 --- a/common/standard/paths/u/ja/user_refresh.php +++ b/common/standard/paths/u/ja/user_refresh.php @@ -13,7 +13,7 @@ class c_standard_path_user_refresh_ja extends c_standard_path_user_refresh { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_session.php b/common/standard/paths/u/ja/user_session.php index 5251172..756e9f1 100644 --- a/common/standard/paths/u/ja/user_session.php +++ b/common/standard/paths/u/ja/user_session.php @@ -13,7 +13,7 @@ class c_standard_path_user_session_ja extends c_standard_path_user_session { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { return ''; } } diff --git a/common/standard/paths/u/ja/user_settings.php b/common/standard/paths/u/ja/user_settings.php index 0147aab..8f30f3c 100644 --- a/common/standard/paths/u/ja/user_settings.php +++ b/common/standard/paths/u/ja/user_settings.php @@ -13,7 +13,7 @@ class c_standard_path_user_dashboard_ja extends c_standard_path_user_dashboard { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_unlock.php b/common/standard/paths/u/ja/user_unlock.php index 7591066..e99c2d5 100644 --- a/common/standard/paths/u/ja/user_unlock.php +++ b/common/standard/paths/u/ja/user_unlock.php @@ -13,7 +13,7 @@ class c_standard_path_user_unlock_ja extends c_standard_path_user_unlock { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/ja/user_view.php b/common/standard/paths/u/ja/user_view.php index 9dd5f01..218599a 100644 --- a/common/standard/paths/u/ja/user_view.php +++ b/common/standard/paths/u/ja/user_view.php @@ -19,7 +19,7 @@ class c_standard_path_user_view_ja extends c_standard_path_user_view { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_check.php b/common/standard/paths/u/user_check.php index 9d08ea0..3abd620 100644 --- a/common/standard/paths/u/user_check.php +++ b/common/standard/paths/u/user_check.php @@ -32,7 +32,7 @@ class c_standard_path_user_check extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -46,7 +46,7 @@ class c_standard_path_user_check extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -58,7 +58,7 @@ class c_standard_path_user_check extends c_standard_path_user { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -110,7 +110,7 @@ class c_standard_path_user_check extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_create.php b/common/standard/paths/u/user_create.php index ef29942..910b7cf 100644 --- a/common/standard/paths/u/user_create.php +++ b/common/standard/paths/u/user_create.php @@ -28,7 +28,7 @@ class c_standard_path_user_create extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -42,7 +42,7 @@ class c_standard_path_user_create extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -113,7 +113,7 @@ class c_standard_path_user_create extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_dashboard.php b/common/standard/paths/u/user_dashboard.php index 524203e..ccb4ab3 100644 --- a/common/standard/paths/u/user_dashboard.php +++ b/common/standard/paths/u/user_dashboard.php @@ -47,7 +47,7 @@ class c_standard_path_user_dashboard extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -61,7 +61,7 @@ class c_standard_path_user_dashboard extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -82,7 +82,7 @@ class c_standard_path_user_dashboard extends c_standard_path_user { $roles = new c_base_users_user(); } - $wrapper->set_tag($this->pr_create_tag_text_block($this->pr_get_text(2, array('@{user}' => $session->get_name()->get_value_exact())))); + $wrapper->set_tag($this->pr_create_tag_text_block($this->pr_get_text(2, ['@{user}' => $session->get_name()->get_value_exact()]))); $block = $this->pr_create_tag_text_block(NULL); $block->set_tag($this->pr_create_tag_text(3)); @@ -170,7 +170,7 @@ class c_standard_path_user_dashboard extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_delete.php b/common/standard/paths/u/user_delete.php index e8b25a4..2f01afc 100644 --- a/common/standard/paths/u/user_delete.php +++ b/common/standard/paths/u/user_delete.php @@ -29,7 +29,7 @@ class c_standard_path_user_delete extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -43,7 +43,7 @@ class c_standard_path_user_delete extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -112,7 +112,7 @@ class c_standard_path_user_delete extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_edit.php b/common/standard/paths/u/user_edit.php index 1c11952..f44acf4 100644 --- a/common/standard/paths/u/user_edit.php +++ b/common/standard/paths/u/user_edit.php @@ -64,7 +64,7 @@ class c_standard_path_user_edit extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -78,7 +78,7 @@ class c_standard_path_user_edit extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -119,7 +119,7 @@ class c_standard_path_user_edit extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_lock.php b/common/standard/paths/u/user_lock.php index 2fadf91..a41ee53 100644 --- a/common/standard/paths/u/user_lock.php +++ b/common/standard/paths/u/user_lock.php @@ -29,7 +29,7 @@ class c_standard_path_user_lock extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -43,7 +43,7 @@ class c_standard_path_user_lock extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -55,7 +55,7 @@ class c_standard_path_user_lock extends c_standard_path_user { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -107,7 +107,7 @@ class c_standard_path_user_lock extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_login.php b/common/standard/paths/u/user_login.php index 8eeac63..a0ac96f 100644 --- a/common/standard/paths/u/user_login.php +++ b/common/standard/paths/u/user_login.php @@ -35,7 +35,7 @@ class c_standard_path_user_login extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -67,7 +67,7 @@ class c_standard_path_user_login extends c_standard_path { // Content $wrapper = $this->pr_create_tag_section(array(1 => 3)); - $wrapper->set_tag($this->pr_create_tag_text_block(4, array('@{user}' => $session->get_name()->get_value_exact()))); + $wrapper->set_tag($this->pr_create_tag_text_block(4, ['@{user}' => $session->get_name()->get_value_exact()])); $wrapper->set_tag($this->pr_create_tag_break()); @@ -103,8 +103,8 @@ class c_standard_path_user_login extends c_standard_path { // handle any resulting errors. - $problem_fields = array(); - $problem_messages = array(); + $problem_fields = []; + $problem_messages = []; // perform login if session information is provided. if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') { @@ -138,12 +138,12 @@ class c_standard_path_user_login extends c_standard_path { unset($login_result); if (!empty($problem_messages)) { - $messages = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, 'form_problems', array('form_problems')); + $messages = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, 'form_problems', ['form_problems']); foreach ($problem_messages as $problem_delta => $problem_message) { - $class = array( + $class = [ 'form_problems-problem', 'form_problems-problem-' . $problem_delta, - ); + ]; $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, 'form_problems-problem-' . $problem_delta, $class); $tag->set_text($problem_message); @@ -161,26 +161,26 @@ class c_standard_path_user_login extends c_standard_path { unset($problem_messages); } else { - $form_defaults = array(); + $form_defaults = []; } unset($logged_in); // login form - $form = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_FORM, 'login_form', array('login_form')); + $form = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_FORM, 'login_form', ['login_form']); $form->set_attribute(c_base_markup_attributes::ATTRIBUTE_METHOD, 'post'); $form->set_attribute(c_base_markup_attributes::ATTRIBUTE_ROLE, 'form'); $form->set_attribute(c_base_markup_attributes::ATTRIBUTE_ACCEPT_CHARACTER_SET, c_base_charset::UTF_8); // form id: represents the form. - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_HIDDEN, 'form_id', array('form-id', 'login_form-id')); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_HIDDEN, 'form_id', ['form-id', 'login_form-id']); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_VALUE, 'login_form'); $form->set_tag($tag); unset($tag); // form unique id: uniquely identifies the form. $unique_id = mt_rand(1, 16); - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_HIDDEN, 'form_id-unique', array('form-id_unique', 'login_form-id_unique')); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_HIDDEN, 'form_id-unique', ['form-id_unique', 'login_form-id_unique']); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_VALUE, '' . $unique_id); $form->set_tag($tag); unset($tag); @@ -194,7 +194,7 @@ class c_standard_path_user_login extends c_standard_path { // label: username - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LABEL, NULL, array('login_form-label-user_name')); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LABEL, NULL, ['login_form-label-user_name']); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_FOR, 'login_form-user_name'); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, 'field-label-user_name'); $tag->set_text($this->pr_get_text(1)); @@ -203,9 +203,9 @@ class c_standard_path_user_login extends c_standard_path { // field: username - $class = array( + $class = [ 'login_form-input-user_name', - ); + ]; if (array_key_exists('login_form-user_name', $problem_fields)) { $class[] = 'field_has_problem'; } @@ -221,7 +221,7 @@ class c_standard_path_user_login extends c_standard_path { // label: password - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LABEL, NULL, array('login_form-label-password')); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LABEL, NULL, ['login_form-label-password']); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_FOR, 'login_form-password'); $tag->set_text($this->pr_get_text(2)); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, 'field-label-password'); @@ -230,9 +230,9 @@ class c_standard_path_user_login extends c_standard_path { // field: password - $class = array( + $class = [ 'login_form-input-password', - ); + ]; if (array_key_exists('login_form-password', $problem_fields)) { $class[] = 'field_has_problem'; } @@ -248,7 +248,7 @@ class c_standard_path_user_login extends c_standard_path { // button: reset - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_RESET, 'login_form-reset', array('login_form-button-reset')); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_RESET, 'login_form-reset', ['login_form-button-reset']); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_VALUE, $this->pr_get_text(11)); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, 'field-button-reset'); $form->set_tag($tag); @@ -256,7 +256,7 @@ class c_standard_path_user_login extends c_standard_path { // button: submit - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SUBMIT, 'login_form-login', array('login_form-button-login')); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SUBMIT, 'login_form-login', ['login_form-button-login']); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_VALUE, $this->pr_get_text(12)); #$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_ACTION, $settings['base_path'] . 's/u/login'); // custom submit destination, but would require /s/u/login to redirect back to here. $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, 'field-button-submit'); @@ -324,7 +324,7 @@ class c_standard_path_user_login extends c_standard_path { * An array of problems on failure. */ protected function pr_do_login(&$http, &$database, &$session, $settings) { - $problems = array(); + $problems = []; if (empty($_POST['login_form-user_name']) || !is_string($_POST['login_form-user_name'])) { $problems[] = c_base_form_problem::s_create_error('login_form-user_name', self::pr_get_text(10)); } @@ -355,7 +355,7 @@ class c_standard_path_user_login extends c_standard_path { $access_denied = FALSE; - $error_messages = array(); + $error_messages = []; $connected = $database->do_connect(); if (c_base_return::s_has_error($connected)) { @@ -414,7 +414,7 @@ class c_standard_path_user_login extends c_standard_path { c_standard_index::s_do_initialize_database($database); if ($database instanceof c_standard_database) { - $database->do_log_user(c_base_log::TYPE_CREATE, c_base_http_status::OK, array('user_name' => $_POST['login_form-user_name'])); + $database->do_log_user(c_base_log::TYPE_CREATE, c_base_http_status::OK, ['user_name' => $_POST['login_form-user_name']]); } } } @@ -467,7 +467,7 @@ class c_standard_path_user_login extends c_standard_path { if ($connected instanceof c_base_return_true) { c_standard_index::s_do_initialize_database($database); - $result = $database->do_log_user(c_base_log::TYPE_CONNECT, c_base_http_status::FORBIDDEN, array('user_name' => $_POST['login_form-user_name'])); + $result = $database->do_log_user(c_base_log::TYPE_CONNECT, c_base_http_status::FORBIDDEN, ['user_name' => $_POST['login_form-user_name']]); $database->do_disconnect(); $connected = new c_base_return_false(); @@ -583,10 +583,10 @@ class c_standard_path_user_login extends c_standard_path { $cookie_login->set_expires($session_expire); $cookie_login->set_max_age(NULL); - $data = array( + $data = [ 'session_id' => $session->get_session_id()->get_value_exact(), 'expire' => gmdate(static::SESSION_DATE_FORMAT, $session_expire), // unnecessary, but provided for debug purposes. - ); + ]; $cookie_login->set_value($data); $session->set_cookie($cookie_login); @@ -600,7 +600,7 @@ class c_standard_path_user_login extends c_standard_path { // now that any session/cookie information is loaded and processed, log any login connections. if ($connected instanceof c_base_return_true && $database instanceof c_standard_database) { - $database->do_log_user(c_base_log::TYPE_CONNECT, c_base_http_status::OK, array('expires' => $session->get_timeout_expire()->get_value_exact())); + $database->do_log_user(c_base_log::TYPE_CONNECT, c_base_http_status::OK, ['expires' => $session->get_timeout_expire()->get_value_exact()]); } unset($connected); @@ -644,7 +644,7 @@ class c_standard_path_user_login extends c_standard_path { } unset($request_uri); - return array( + return [ 'scheme' => NULL, 'authority' => NULL, 'path' => $this->settings['base_path'] . c_standard_paths::URI_USER_DASHBOARD, @@ -653,7 +653,7 @@ class c_standard_path_user_login extends c_standard_path { 'url' => TRUE, 'current' => $start, 'invalid' => FALSE, - ); + ]; } /** @@ -673,12 +673,12 @@ class c_standard_path_user_login extends c_standard_path { * 'data': Any ldap data found for the given user name. */ protected function pr_load_ldap_data($settings, $user_name) { - $return_data = array( + $return_data = [ 'title' => NULL, 'message' => NULL, 'status' => TRUE, 'data' => NULL, - ); + ]; // ldap support is disabled if ldap_server is set to NULL (or is not a string). @@ -729,13 +729,13 @@ class c_standard_path_user_login extends c_standard_path { $entries = $entries->get_value(); } else { - $entries = array(); + $entries = []; } if ($entries['count'] > 0) { - $return_data['data'] = array( + $return_data['data'] = [ 'uid' => $user_name, - ); + ]; foreach ($settings['ldap_fields'] as $ldap_field) { $return_data['data'][$ldap_field] = $entries[0][$ldap_field][0]; @@ -772,7 +772,7 @@ class c_standard_path_user_login extends c_standard_path { $socket_error = @socket_last_error(); @socket_clear_error(); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_create', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_create', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); unset($socket_error); return c_base_return_error::s_false($error); @@ -788,7 +788,7 @@ class c_standard_path_user_login extends c_standard_path { unset($socket); unset($connected); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_connect', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_connect', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); unset($socket_error); return c_base_return_error::s_false($error); @@ -827,7 +827,7 @@ class c_standard_path_user_login extends c_standard_path { unset($socket); unset($connected); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_write', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_write', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); unset($socket_error); return c_base_return_error::s_false($error); @@ -847,7 +847,7 @@ class c_standard_path_user_login extends c_standard_path { unset($socket); unset($connected); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_read', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_read', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); unset($socket_error); return c_base_return_error::s_false($error); @@ -860,7 +860,7 @@ class c_standard_path_user_login extends c_standard_path { if (!is_string($response) || strlen($response) == 0) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_read', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_read', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -902,7 +902,7 @@ class c_standard_path_user_login extends c_standard_path { $query_result = $database->do_query('select id from v_users_self_exists'); if ($query_result instanceof c_base_database_result) { if (is_array($ldap)) { - $query_arguments = array(); + $query_arguments = []; $email = explode('@', $ldap['data']['mail']); if (count($email) != 2) { @@ -955,14 +955,14 @@ class c_standard_path_user_login extends c_standard_path { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return self::pr_get_text(0, $arguments); } /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_logout.php b/common/standard/paths/u/user_logout.php index 1c924b2..a2d2a90 100644 --- a/common/standard/paths/u/user_logout.php +++ b/common/standard/paths/u/user_logout.php @@ -27,7 +27,7 @@ class c_standard_path_user_logout extends c_standard_path { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -143,14 +143,14 @@ class c_standard_path_user_logout extends c_standard_path { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return $this->pr_get_text(0, $arguments); } /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_refresh.php b/common/standard/paths/u/user_refresh.php index 7ca3c96..0dd0a7b 100644 --- a/common/standard/paths/u/user_refresh.php +++ b/common/standard/paths/u/user_refresh.php @@ -32,7 +32,7 @@ class c_standard_path_user_refresh extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -46,7 +46,7 @@ class c_standard_path_user_refresh extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -58,7 +58,7 @@ class c_standard_path_user_refresh extends c_standard_path_user { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -110,7 +110,7 @@ class c_standard_path_user_refresh extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_session.php b/common/standard/paths/u/user_session.php index ec088d7..8235764 100644 --- a/common/standard/paths/u/user_session.php +++ b/common/standard/paths/u/user_session.php @@ -29,7 +29,7 @@ class c_standard_path_user_session extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -43,7 +43,7 @@ class c_standard_path_user_session extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -55,7 +55,7 @@ class c_standard_path_user_session extends c_standard_path_user { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -65,14 +65,14 @@ class c_standard_path_user_session extends c_standard_path_user { /** * Implements pr_get_text_title(). */ - protected function pr_get_text_title($arguments = array()) { + protected function pr_get_text_title($arguments = []) { return ''; } /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { return ''; } } diff --git a/common/standard/paths/u/user_settings.php b/common/standard/paths/u/user_settings.php index 02c391b..432ef3c 100644 --- a/common/standard/paths/u/user_settings.php +++ b/common/standard/paths/u/user_settings.php @@ -35,7 +35,7 @@ class c_standard_path_user_settings extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -49,7 +49,7 @@ class c_standard_path_user_settings extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -111,7 +111,7 @@ class c_standard_path_user_settings extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: @@ -333,19 +333,19 @@ class c_standard_path_user_settings extends c_standard_path_user { protected function pr_do_execute_settings(&$executed) { $errors = NULL; - $arguments = array(); + $arguments = []; $arguments[':{user_name}'] = $this->path_user->get_name_human()->get_first()->get_value_exact() . ' ' . $this->path_user->get_name_human()->get_last()->get_value_exact(); if (mb_strlen($arguments[':{user_name}']) == 0) { unset($arguments[':{user_name}']); } if (is_int($this->path_user_id)) { - $text_id_user = $this->pr_create_tag_text('[id: ' . $this->path_user_id . ']', array(), NULL, static::CLASS_ID_USER); - $wrapper = $this->pr_create_tag_section(array(1 => array('text' => 0, 'append-inside' => $text_id_user)), $arguments); + $text_id_user = $this->pr_create_tag_text('[id: ' . $this->path_user_id . ']', [], NULL, static::CLASS_ID_USER); + $wrapper = $this->pr_create_tag_section([1 => ['text' => 0, 'append-inside' => $text_id_user]], $arguments); unset($text_id_user); } else { - $wrapper = $this->pr_create_tag_section(array(1 => 0), $arguments); + $wrapper = $this->pr_create_tag_section([1 => 0], $arguments); } $roles_current = $this->session->get_user_current()->get_roles()->get_value_exact(); @@ -368,23 +368,23 @@ class c_standard_path_user_settings extends c_standard_path_user { // account information - $fieldset = $this->pr_create_tag_fieldset(14, array(), static::CLASS_USER_SETTINGS_ACCOUNT, static::CLASS_USER_SETTINGS_ACCOUNT); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(14, [], static::CLASS_USER_SETTINGS_ACCOUNT, static::CLASS_USER_SETTINGS_ACCOUNT); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, [static::CSS_AS_FIELD_SET_CONTENT]); - $content->set_tag($this->pr_create_tag_field_row(18, '' . $this->path_user_id, array(), NULL, c_standard_path::CSS_AS_ROW_EVEN, 0, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(18, '' . $this->path_user_id, [], NULL, c_standard_path::CSS_AS_ROW_EVEN, 0, TRUE)); if ($full_view_access || !$this->path_user->get_address_email()->is_private()->get_value()) { $count = 1; if ($full_view_access) { - $content->set_tag($this->pr_create_tag_field_row(19, '' . $this->path_user->get_id_external()->get_value(), array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(19, '' . $this->path_user->get_id_external()->get_value(), [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; } - $content->set_tag($this->pr_create_tag_field_row(20, '' . $this->path_user->get_name_machine()->get_value(), array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(20, '' . $this->path_user->get_name_machine()->get_value(), [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; - $content->set_tag($this->pr_create_tag_field_row(21, '' . $this->path_user->get_address_email()->get_address()->get_value(), array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(21, '' . $this->path_user->get_address_email()->get_address()->get_value(), [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; if ($this->path_user->is_locked()->get_value_exact()) { @@ -393,7 +393,7 @@ class c_standard_path_user_settings extends c_standard_path_user { else { $tag_text = $this->pr_get_text(34); } - $content->set_tag($this->pr_create_tag_field_row(24, $tag_text, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(24, $tag_text, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; if ($this->path_user->is_private()->get_value_exact()) { @@ -402,7 +402,7 @@ class c_standard_path_user_settings extends c_standard_path_user { else { $tag_text = $this->pr_get_text(34); } - $content->set_tag($this->pr_create_tag_field_row(27, $tag_text, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(27, $tag_text, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; if ($this->path_user->is_roler()->get_value_exact()) { @@ -411,7 +411,7 @@ class c_standard_path_user_settings extends c_standard_path_user { else { $tag_text = $this->pr_get_text(34); } - $content->set_tag($this->pr_create_tag_field_row(23, $tag_text, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(23, $tag_text, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; if (isset($roles_current[c_base_roles::MANAGER]) || isset($roles_current[c_base_roles::ADMINISTER])) { @@ -421,7 +421,7 @@ class c_standard_path_user_settings extends c_standard_path_user { else { $tag_text = $this->pr_get_text(34); } - $content->set_tag($this->pr_create_tag_field_row(25, $tag_text, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(25, $tag_text, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; } @@ -434,7 +434,7 @@ class c_standard_path_user_settings extends c_standard_path_user { $date = c_base_defaults_global::s_get_date(c_base_defaults_global::FORMAT_DATE_TIME_SECONDS_HUMAN, $this->path_user->get_date_created()->get_value())->get_value_exact(); } - $content->set_tag($this->pr_create_tag_field_row(28, $date, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(28, $date, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; @@ -444,7 +444,7 @@ class c_standard_path_user_settings extends c_standard_path_user { $date = c_base_defaults_global::s_get_date(c_base_defaults_global::FORMAT_DATE_TIME_SECONDS_HUMAN, $this->path_user->get_date_changed()->get_value())->get_value_exact(); } - $content->set_tag($this->pr_create_tag_field_row(29, $date, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(29, $date, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; @@ -454,7 +454,7 @@ class c_standard_path_user_settings extends c_standard_path_user { $date = c_base_defaults_global::s_get_date(c_base_defaults_global::FORMAT_DATE_TIME_SECONDS_HUMAN, $this->path_user->get_date_synced()->get_value())->get_value_exact(); } - $content->set_tag($this->pr_create_tag_field_row(30, $date, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(30, $date, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; @@ -464,7 +464,7 @@ class c_standard_path_user_settings extends c_standard_path_user { $date = c_base_defaults_global::s_get_date(c_base_defaults_global::FORMAT_DATE_TIME_SECONDS_HUMAN, $this->path_user->get_date_locked()->get_value())->get_value_exact(); } - $content->set_tag($this->pr_create_tag_field_row(31, '' . $date, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(31, '' . $date, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; @@ -474,7 +474,7 @@ class c_standard_path_user_settings extends c_standard_path_user { $date = c_base_defaults_global::s_get_date(c_base_defaults_global::FORMAT_DATE_TIME_SECONDS_HUMAN, $this->path_user->get_date_deleted()->get_value())->get_value_exact(); } - $content->set_tag($this->pr_create_tag_field_row(32, '' . $date, array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(32, '' . $date, [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; } @@ -482,8 +482,8 @@ class c_standard_path_user_settings extends c_standard_path_user { unset($date); } else { - $content->set_tag($this->pr_create_tag_field_row(20, '' . $this->path_user->get_name_machine()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_ODD, 1, TRUE)); - $content->set_tag($this->pr_create_tag_field_row(21, $this->pr_get_text(43), array(), NULL, c_standard_path::CSS_AS_ROW_EVEN, 2, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(20, '' . $this->path_user->get_name_machine()->get_value(), [], NULL, c_standard_path::CSS_AS_ROW_ODD, 1, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(21, $this->pr_get_text(43), [], NULL, c_standard_path::CSS_AS_ROW_EVEN, 2, TRUE)); } $fieldset->set_tag($content); @@ -495,15 +495,15 @@ class c_standard_path_user_settings extends c_standard_path_user { if ($full_view_access || !$this->path_user->is_private()->get_value()) { // personal information - $fieldset = $this->pr_create_tag_fieldset(15, array(), static::CLASS_USER_SETTINGS_PERSONAL, static::CLASS_USER_SETTINGS_PERSONAL); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(15, [], static::CLASS_USER_SETTINGS_PERSONAL, static::CLASS_USER_SETTINGS_PERSONAL); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, [static::CSS_AS_FIELD_SET_CONTENT]); - $content->set_tag($this->pr_create_tag_field_row(37, '' . $this->path_user->get_name_human()->get_prefix()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_EVEN, 0, TRUE)); - $content->set_tag($this->pr_create_tag_field_row(38, '' . $this->path_user->get_name_human()->get_first()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_ODD, 1, TRUE)); - $content->set_tag($this->pr_create_tag_field_row(39, '' . $this->path_user->get_name_human()->get_middle()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_EVEN, 2, TRUE)); - $content->set_tag($this->pr_create_tag_field_row(40, '' . $this->path_user->get_name_human()->get_last()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_ODD, 3, TRUE)); - $content->set_tag($this->pr_create_tag_field_row(41, '' . $this->path_user->get_name_human()->get_suffix()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_EVEN, 4, TRUE)); - $content->set_tag($this->pr_create_tag_field_row(42, '' . $this->path_user->get_name_human()->get_complete()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_ODD, 5, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(37, '' . $this->path_user->get_name_human()->get_prefix()->get_value(), [], NULL, c_standard_path::CSS_AS_ROW_EVEN, 0, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(38, '' . $this->path_user->get_name_human()->get_first()->get_value(), [], NULL, c_standard_path::CSS_AS_ROW_ODD, 1, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(39, '' . $this->path_user->get_name_human()->get_middle()->get_value(), [], NULL, c_standard_path::CSS_AS_ROW_EVEN, 2, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(40, '' . $this->path_user->get_name_human()->get_last()->get_value(), [], NULL, c_standard_path::CSS_AS_ROW_ODD, 3, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(41, '' . $this->path_user->get_name_human()->get_suffix()->get_value(), [], NULL, c_standard_path::CSS_AS_ROW_EVEN, 4, TRUE)); + $content->set_tag($this->pr_create_tag_field_row(42, '' . $this->path_user->get_name_human()->get_complete()->get_value(), [], NULL, c_standard_path::CSS_AS_ROW_ODD, 5, TRUE)); $fieldset->set_tag($content); unset($content); @@ -513,10 +513,10 @@ class c_standard_path_user_settings extends c_standard_path_user { // access information - $fieldset = $this->pr_create_tag_fieldset(16, array(), static::CLASS_USER_SETTINGS_ACCESS, static::CLASS_USER_SETTINGS_ACCESS); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(16, [], static::CLASS_USER_SETTINGS_ACCESS, static::CLASS_USER_SETTINGS_ACCESS); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, [static::CSS_AS_FIELD_SET_CONTENT]); - $access_to_text_mapping = array( + $access_to_text_mapping = [ c_base_roles::PUBLIC => 1, c_base_roles::SYSTEM => 2, c_base_roles::USER => 3, @@ -530,7 +530,7 @@ class c_standard_path_user_settings extends c_standard_path_user { c_base_roles::AUDITOR => 11, c_base_roles::MANAGER => 12, c_base_roles::ADMINISTER => 13, - ); + ]; $id_text = NULL; $count = 0; @@ -539,7 +539,7 @@ class c_standard_path_user_settings extends c_standard_path_user { continue; } - $content->set_tag($this->pr_create_tag_field_row($access_to_text_mapping[$role], array(), NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); + $content->set_tag($this->pr_create_tag_field_row($access_to_text_mapping[$role], [], NULL, ($count % 2 == 0 ? c_standard_path::CSS_AS_ROW_EVEN : c_standard_path::CSS_AS_ROW_ODD), $count, TRUE)); $count++; } @@ -556,8 +556,8 @@ class c_standard_path_user_settings extends c_standard_path_user { // history information - $fieldset = $this->pr_create_tag_fieldset(17, array(), static::CLASS_USER_SETTINGS_HISTORY, static::CLASS_USER_SETTINGS_HISTORY); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(17, [], static::CLASS_USER_SETTINGS_HISTORY, static::CLASS_USER_SETTINGS_HISTORY); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, [static::CSS_AS_FIELD_SET_CONTENT]); // user history // @todo: implement code for processing and generating a table/list of history, with the ability to navigate additional entries. @@ -565,14 +565,14 @@ class c_standard_path_user_settings extends c_standard_path_user { if (c_base_return::s_has_error($query_result)) { if (is_null($errors)) { - $errors = array(); + $errors = []; } c_base_return::s_copy_errors($query_result->get_error(), $errors); $last_error = $this->database->get_last_error()->get_value_exact(); if (!empty($last_error)) { - $errors[] = c_base_error::s_log(NULL, array('arguments' => array(':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_ERROR); + $errors[] = c_base_error::s_log(NULL, ['arguments' => [':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_ERROR); } unset($last_error); } @@ -634,14 +634,14 @@ class c_standard_path_user_settings extends c_standard_path_user { if (c_base_return::s_has_error($query_result)) { if (is_null($errors)) { - $errors = array(); + $errors = []; } c_base_return::s_copy_errors($query_result->get_error(), $errors); $last_error = $this->database->get_last_error()->get_value_exact(); if (!empty($last_error)) { - $errors[] = c_base_error::s_log(NULL, array('arguments' => array(':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_ERROR); + $errors[] = c_base_error::s_log(NULL, ['arguments' => [':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::POSTGRESQL_ERROR); } unset($last_error); } diff --git a/common/standard/paths/u/user_unlock.php b/common/standard/paths/u/user_unlock.php index 8609b8f..760df6e 100644 --- a/common/standard/paths/u/user_unlock.php +++ b/common/standard/paths/u/user_unlock.php @@ -29,7 +29,7 @@ class c_standard_path_user_unlock extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -43,7 +43,7 @@ class c_standard_path_user_unlock extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -55,7 +55,7 @@ class c_standard_path_user_unlock extends c_standard_path_user { #$roles_current = $user->get_roles()->get_value_exact(); // @todo: this function is currently disabled, so return a path not found. - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -107,7 +107,7 @@ class c_standard_path_user_unlock extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: diff --git a/common/standard/paths/u/user_view.php b/common/standard/paths/u/user_view.php index 1348b2d..d7e7143 100644 --- a/common/standard/paths/u/user_view.php +++ b/common/standard/paths/u/user_view.php @@ -35,7 +35,7 @@ class c_standard_path_user_view extends c_standard_path_user { /** * Implements do_execute(). */ - public function do_execute(&$http, &$database, &$session, $settings = array()) { + public function do_execute(&$http, &$database, &$session, $settings = []) { // the parent function performs validation on the parameters. $executed = parent::do_execute($http, $database, $session, $settings); if (c_base_return::s_has_error($executed)) { @@ -49,7 +49,7 @@ class c_standard_path_user_view extends c_standard_path_user { // only support HTML output unless otherwise needed. // @todo: eventually all HTML output will be expected to support at least print and PDF formats (with print being the string 'print'). if ($this->output_format !== c_base_mime::TYPE_TEXT_HTML) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -86,7 +86,7 @@ class c_standard_path_user_view extends c_standard_path_user { /** * Implements pr_get_text(). */ - protected function pr_get_text($code, $arguments = array()) { + protected function pr_get_text($code, $arguments = []) { $string = ''; switch ($code) { case 0: @@ -131,7 +131,7 @@ class c_standard_path_user_view extends c_standard_path_user { protected function pr_do_execute_view(&$executed) { $errors = NULL; - $arguments = array(); + $arguments = []; $arguments[':{user_name}'] = $this->path_user->get_name_human()->get_first()->get_value_exact() . ' ' . $this->path_user->get_name_human()->get_last()->get_value_exact(); if (mb_strlen($arguments[':{user_name}']) == 0) { unset($arguments[':{user_name}']); @@ -155,7 +155,7 @@ class c_standard_path_user_view extends c_standard_path_user { unset($is_private); unset($full_view_access); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); + $error = c_base_error::s_log(NULL, ['arguments' => [':{path_name}' => static::PATH_SELF . '/' . implode('/', $this->arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::NOT_FOUND_PATH); $executed->set_error($error); unset($error); @@ -167,12 +167,12 @@ class c_standard_path_user_view extends c_standard_path_user { $this->pr_create_html(TRUE, $arguments); if (is_int($this->path_user_id)) { - $text_id_user = $this->pr_create_tag_text('[id: ' . $this->path_user_id . ']', array(), NULL, static::CLASS_ID_USER); - $wrapper = $this->pr_create_tag_section(array(1 => array('text' => 0, 'append-inside' => $text_id_user)), $arguments); + $text_id_user = $this->pr_create_tag_text('[id: ' . $this->path_user_id . ']', [], NULL, static::CLASS_ID_USER); + $wrapper = $this->pr_create_tag_section([1 => ['text' => 0, 'append-inside' => $text_id_user]], $arguments); unset($text_id_user); } else { - $wrapper = $this->pr_create_tag_section(array(1 => 0), $arguments); + $wrapper = $this->pr_create_tag_section([1 => 0], $arguments); } $this->html->set_tag($wrapper); @@ -181,9 +181,9 @@ class c_standard_path_user_view extends c_standard_path_user { // profile picture - $fieldset = $this->pr_create_tag_fieldset(1, array(), static::CLASS_USER_VIEW_IMAGE, static::CLASS_USER_VIEW_IMAGE); + $fieldset = $this->pr_create_tag_fieldset(1, [], static::CLASS_USER_VIEW_IMAGE, static::CLASS_USER_VIEW_IMAGE); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, [static::CSS_AS_FIELD_SET_CONTENT]); $image = $this->path_user->get_image_cropped()->get_value(); if (is_int($image)) { @@ -211,8 +211,8 @@ class c_standard_path_user_view extends c_standard_path_user { // account information - $fieldset = $this->pr_create_tag_fieldset(2, array(), static::CLASS_USER_VIEW_INFORMATION, static::CLASS_USER_VIEW_INFORMATION); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(2, [], static::CLASS_USER_VIEW_INFORMATION, static::CLASS_USER_VIEW_INFORMATION); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, [static::CSS_AS_FIELD_SET_CONTENT]); // @todo: implement basic user profile information. $tag = c_theme_html::s_create_tag_text(c_base_markup_tag::TYPE_SPAN, $this->path_user->get_name_human()->get_first()->get_value() . ' ' . $this->path_user->get_name_human()->get_last()->get_value()); diff --git a/common/theme/classes/theme_dom.php b/common/theme/classes/theme_dom.php index 2f05296..9d0c386 100644 --- a/common/theme/classes/theme_dom.php +++ b/common/theme/classes/theme_dom.php @@ -62,12 +62,12 @@ class c_theme_dom extends DOMDocument { */ public function change_element($element, $type) { if (!($element instanceof DOMNode)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'element', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'element', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($type) || empty($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -91,17 +91,17 @@ class c_theme_dom extends DOMDocument { */ public function change_elements($type_old, $type_new) { if (!is_string($type_old) || strlen($type_old) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type_old', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type_old', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($type_new) || strlen($type_empty) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type_empty', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type_empty', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!($this->content instanceof DOMNode)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -130,12 +130,12 @@ class c_theme_dom extends DOMDocument { */ public function remove_element($element, $preserve_children = TRUE) { if (!($element instanceof DOMNode)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'element', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'element', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($preserve_children)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'preserve_children', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'preserve_children', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -168,17 +168,17 @@ class c_theme_dom extends DOMDocument { */ public function remove_elements($type, $preserve_children = TRUE) { if (!is_string($type) || strlen($type) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($preserve_children)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'preserve_children', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'preserve_children', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!($this->content instanceof DOMNode)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -344,7 +344,7 @@ class c_theme_dom extends DOMDocument { } if ($preserve_children && $element->hasChildNodes()) { - $children = array(); + $children = []; foreach ($element->childNodes as $child) { $children[] = $child; diff --git a/common/theme/classes/theme_form.php b/common/theme/classes/theme_form.php index dea3f44..4e33334 100644 --- a/common/theme/classes/theme_form.php +++ b/common/theme/classes/theme_form.php @@ -104,7 +104,7 @@ class c_theme_form_tag extends c_base_markup_tag { public function __construct() { parent::__construct(); - $this->attributes = array(); + $this->attributes = []; } /** @@ -303,7 +303,7 @@ class c_theme_form_tag extends c_base_markup_tag { */ public function get_attributes() { if (!isset($this->attributes) && !is_array($this->attributes)) { - $this->attributes = array(); + $this->attributes = []; } return new c_base_return_array($this->attributes); @@ -326,7 +326,7 @@ class c_theme_form_tag extends c_base_markup_tag { } if (!isset($this->attributes) && !is_array($this->attributes)) { - $this->attributes = array(); + $this->attributes = []; } if (array_key_exists($attribute, $this->attributes)) { diff --git a/common/theme/classes/theme_html.php b/common/theme/classes/theme_html.php index 08fb676..bc716e6 100644 --- a/common/theme/classes/theme_html.php +++ b/common/theme/classes/theme_html.php @@ -97,22 +97,22 @@ class c_theme_html extends c_base_return { */ public static function s_create_tag($type, $id = NULL, $classes = NULL, $text = NULL) { if (!is_null($id) && !is_string($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($classes) && !is_array($classes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'classes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'classes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($text) && !is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -120,7 +120,7 @@ class c_theme_html extends c_base_return { $result = $tag->set_type($type); if ($result instanceof c_base_return_false) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -173,7 +173,7 @@ class c_theme_html extends c_base_return { */ public function set_html($html) { if (!($html instanceof c_base_html)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'html', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'html', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -222,7 +222,7 @@ class c_theme_html extends c_base_return { */ public function render_markup() { if (!($this->html instanceof c_base_html)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->html', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'this->html', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -246,7 +246,7 @@ class c_theme_html extends c_base_return { */ public function set_http($http) { if (!($http instanceof c_base_http)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -282,7 +282,7 @@ class c_theme_html extends c_base_return { */ public function set_max_recursion_depth($max_recursion_depth) { if (!is_int($max_recursion_depth)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'max_recursion_depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'max_recursion_depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1092,7 +1092,7 @@ class c_theme_html extends c_base_return { // attribute: aria-tags - $attributes = array( + $attributes = [ // global tags c_base_markup_attributes::ATTRIBUTE_ARIA_ATOMIC => 'aria-atomic', c_base_markup_attributes::ATTRIBUTE_ARIA_BUSY => 'aria-busy', @@ -1132,7 +1132,7 @@ class c_theme_html extends c_base_return { c_base_markup_attributes::ATTRIBUTE_ARIA_VALUE_MINIMIM => 'aria-valuemin', c_base_markup_attributes::ATTRIBUTE_ARIA_VALUE_NOW => 'aria-valuenow', c_base_markup_attributes::ATTRIBUTE_ARIA_VALUE_TEXT => 'aria-valuetext', - ); + ]; if (is_null($tag)) { foreach ($attributes as $attribute_id => $attribute_name) { @@ -1174,7 +1174,7 @@ class c_theme_html extends c_base_return { private function p_render_markup_attributes_event_handler($tag = NULL) { $markup = ''; - $attributes = array( + $attributes = [ c_base_markup_attributes::ATTRIBUTE_ON_ABORT => 'onabort', c_base_markup_attributes::ATTRIBUTE_ON_BLUR => 'onblur', c_base_markup_attributes::ATTRIBUTE_ON_CANCEL => 'oncancel', @@ -1225,7 +1225,7 @@ class c_theme_html extends c_base_return { c_base_markup_attributes::ATTRIBUTE_ON_TOGGLE => 'ontoggle', c_base_markup_attributes::ATTRIBUTE_ON_VOLUME_CHANGE => 'onvolumechange', c_base_markup_attributes::ATTRIBUTE_ON_WAITING => 'onwaiting', - ); + ]; if (is_null($tag)) { foreach ($attributes as $attribute_id => $attribute_name) { @@ -1385,7 +1385,7 @@ class c_theme_html extends c_base_return { } unset($attribute); - $attributes = array( + $attributes = [ c_base_markup_attributes::ATTRIBUTE_ON_ABORT => 'onabort', c_base_markup_attributes::ATTRIBUTE_ON_BLUR => 'onblur', c_base_markup_attributes::ATTRIBUTE_ON_CANCEL => 'oncancel', @@ -1436,7 +1436,7 @@ class c_theme_html extends c_base_return { c_base_markup_attributes::ATTRIBUTE_ON_TOGGLE => 'ontoggle', c_base_markup_attributes::ATTRIBUTE_ON_VOLUME_CHANGE => 'onvolumechange', c_base_markup_attributes::ATTRIBUTE_ON_WAITING => 'onwaiting', - ); + ]; foreach ($attributes as $attribute_id => $attribute_name) { $attribute = $this->html->get_attribute_body($attribute_id)->get_value_exact(); diff --git a/common/theme/classes/theme_markup.php b/common/theme/classes/theme_markup.php index de847a2..673b922 100644 --- a/common/theme/classes/theme_markup.php +++ b/common/theme/classes/theme_markup.php @@ -115,10 +115,10 @@ class c_theme_tag { */ public function __construct() { $this->text = NULL; - $this->attributes = array(); + $this->attributes = []; $this->attributes_length = 0; - $this->tags = array(); + $this->tags = []; $this->tags_length = NULL; $this->type = static::TYPE_NONE; @@ -192,17 +192,17 @@ class c_theme_tag { return new c_base_return_true(); } elseif ($type === static::TYPE_NONE) { - $new_attributes = array(); + $new_attributes = []; } elseif ($type === static::TYPE_TITLE) { - $new_attributes = array(); + $new_attributes = []; if (array_key_exists('id', $this->attributes)) { $new_attributes['id'] = $this->attributes['id']; } } elseif ($type === static::TYPE_HEADING) { - $new_attributes = array(); + $new_attributes = []; if (array_key_exists('id', $this->attributes)) { $new_attributes['id'] = $this->attributes['id']; @@ -217,7 +217,7 @@ class c_theme_tag { } } elseif ($type === static::TYPE_FILES) { - $new_attributes = array(); + $new_attributes = []; if (array_key_exists('id', $this->attributes)) { $new_attributes['id'] = $this->attributes['id']; @@ -228,14 +228,14 @@ class c_theme_tag { } } elseif ($type === static::TYPE_CONTEXT) { - $new_attributes = array(); + $new_attributes = []; if (array_key_exists('id', $this->attributes)) { $new_attributes['id'] = $this->attributes['id']; } } elseif ($type === static::TYPE_PRESENTATION) { - $new_attributes = array(); + $new_attributes = []; if (array_key_exists('id', $this->attributes)) { $new_attributes['id'] = $this->attributes['id']; @@ -262,7 +262,7 @@ class c_theme_tag { } } elseif ($type === static::TYPE_CONTENT) { - $new_attributes = array(); + $new_attributes = []; if (array_key_exists('id', $this->attributes)) { $new_attributes['id'] = $this->attributes['id']; @@ -682,7 +682,7 @@ class c_theme_tag { */ public function delete_attributes() { unset($this->attributes); - $this->attributes = array(); + $this->attributes = []; $this->attributes_length = 0; return new c_base_return_true(); @@ -784,7 +784,7 @@ class c_theme_tag { unset($count); if ($deleted == $total) { - $this->tags = array(); + $this->tags = []; $this->tags_length = 0; } @@ -1329,7 +1329,7 @@ class c_theme_tag { $this->tags_length = 0; } else { - $tags = array(); + $tags = []; $total = 0; foreach ($tags as $tag) { if (is_null($tag)) { diff --git a/common/view/classes/view_log_users_self.php b/common/view/classes/view_log_users_self.php index e299e21..cba668c 100644 --- a/common/view/classes/view_log_users_self.php +++ b/common/view/classes/view_log_users_self.php @@ -93,7 +93,7 @@ class c_view_log_users_self extends c_base_view { * FALSE without error bit set is returned if nothing was done. * FALSE with error bit set is returned on error. */ - public function pull(&$database, $query = NULL, $arguments = array(), $conditions = NULL, $limit = NULL, $offset = NULL, $group_by = NULL, $order_by = NULL) { + public function pull(&$database, $query = NULL, $arguments = [], $conditions = NULL, $limit = NULL, $offset = NULL, $group_by = NULL, $order_by = NULL) { $result = parent::pull($database, $query, $arguments, $conditions, $limit, $offset, $group_by, $order_by); if (c_base_return::s_has_error($result)) { return $result; @@ -203,7 +203,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_id($id) { if (!is_int($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -223,7 +223,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_id_user($id_user) { if (!is_int($id_user)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'id_user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -243,7 +243,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_title($title) { if (!is_string($title)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'title', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'title', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -263,7 +263,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_type($type) { if (!is_string($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -283,7 +283,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_type_sub($type_sub) { if (!is_string($type_sub)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type_sub', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'type_sub', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -303,7 +303,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_log_severity($log_severity) { if (!is_int($log_severity)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'log_severity', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'log_severity', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -323,7 +323,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_log_facility($log_facility) { if (!is_string($log_facility)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'log_facility', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'log_facility', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -348,7 +348,7 @@ class c_view_log_users_self extends c_base_return { if (!is_array($log_details_decoded)) { unset($log_details_decoded); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'log_details', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'log_details', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -359,7 +359,7 @@ class c_view_log_users_self extends c_base_return { } if (!is_array($log_details)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'log_details', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'log_details', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -385,7 +385,7 @@ class c_view_log_users_self extends c_base_return { } if (!is_int($date) && !is_float($date)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -405,7 +405,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_request_client($request_client) { if (!is_string($request_client)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'request_client', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'request_client', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -425,7 +425,7 @@ class c_view_log_users_self extends c_base_return { */ public function set_response_code($response_code) { if (!is_string($response_code)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'response_code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'response_code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -547,7 +547,7 @@ class c_view_log_users_self extends c_base_return { */ public function get_log_details() { if (!is_array($this->log_details)) { - $this->log_details = array(); + $this->log_details = []; } return c_base_return_array::s_new($this->log_details); diff --git a/examples/test.php b/examples/test.php index 941aef2..39e340b 100755 --- a/examples/test.php +++ b/examples/test.php @@ -31,11 +31,11 @@ $stuff['http']->set_response_content_language(); // test error message handling using english or japanese. - $supported_languages = array( + $supported_languages = [ i_base_languages::ENGLISH_US => '\n_koopa\c_base_error_messages_english', i_base_languages::ENGLISH => '\n_koopa\c_base_error_messages_english', i_base_languages::JAPANESE => '\n_koopa\c_base_error_messages_japanese', - ); + ]; $stuff['http']->set_response_content_language(i_base_languages::ENGLISH_US); $stuff['http']->set_response_content_language(i_base_languages::ENGLISH); @@ -73,11 +73,11 @@ unset($language_chosen); } - $stuff = array( - 'resources' => array( + $stuff = [ + 'resources' => [ 'time' => microtime(TRUE), - ), - ); + ], + ]; function send_prepared_headers($stuff) { // add headers @@ -173,13 +173,13 @@ print("3) Language Test:
"); // disclaimer: I used translate.google.com to generate the languages and provided only the default translation (expect translation errors). - $test_strings = array( + $test_strings = [ i_base_languages::ENGLISH_US => 'This is a test using your browser default language. Currently english (default), spanish, japanese, and russian are tested.', i_base_languages::ENGLISH => 'This is a test using your browser default language. Currently english (default), spanish, japanese, and russian are tested.', i_base_languages::JAPANESE => 'これは、ブラウザのデフォルト言語を使用したテストです。 現在、英語(デフォルト)、スペイン語、日本語、ロシア語がテストされています。', i_base_languages::RUSSIAN => 'Это тест с помощью браузера по умолчанию язык. В настоящее время английский (по умолчанию), испанский, японский и русский тестируются.', i_base_languages::SPANISH => 'Se trata de una prueba que utiliza el idioma predeterminado de su navegador. Actualmente se ponen a prueba el inglés (predeterminado), el español, el japonés y el ruso.', - ); + ]; $language_chosen = i_base_languages::ENGLISH; $languages_accepted = $stuff['http']->get_request(c_base_http::REQUEST_ACCEPT_LANGUAGE)->get_value(); @@ -474,7 +474,7 @@ $session->set_password($_POST['login_password']); $is_public = FALSE; - $user_data = array(); + $user_data = []; // allow direct login as u_reservation_public and assume/require that the u_reservation_public account already exists. if ($_POST['login_name'] == 'u_reservation_public') { @@ -557,10 +557,10 @@ set_log_user($database, 'login', NULL, $session_expire); if ($result instanceof c_base_return_true) { - $data = array( + $data = [ 'session_id' => $session->get_session_id()->get_value_exact(), 'expire' => gmdate("D, d-M-Y H:i:s T", $session_expire), // unnecessary, but provided for debug purposes. - ); + ]; $cookie->set_value($data); $stuff['cookie_login']['cookie'] = $cookie; } @@ -725,7 +725,7 @@ } // directly check to see if the current user exists in ldap (this is technically not necessary because postgresql will also do this). - $stuff_stub = array(); + $stuff_stub = []; $found_username = ldap_get_user($stuff_stub, $username); unset($stuff_stub); @@ -806,7 +806,7 @@ $query_string .= 'insert into v_log_users_self_insert (log_title, log_type, log_severity, request_client, response_code, log_details)'; $query_string .= ' values ($1, $2, $3, ($4, $5, $6), $7, $8); '; - $query_parameters = array(); + $query_parameters = []; $query_parameters[3] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0'; $query_parameters[4] = isset($_SERVER['REMOTE_PORT']) ? $_SERVER['REMOTE_PORT'] : 0; $query_parameters[5] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '' ; @@ -876,7 +876,7 @@ $query_string = ''; $query_string .= 'insert into v_log_user_activity_self_insert (request_path, request_arguments, request_client, response_code) values ($1, $2, ($3, $4, $5), $6); '; - $query_parameters = array(); + $query_parameters = []; $query_parameters[] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'; $query_parameters[] = is_array($_GET) && !empty($_GET) ? print_r(array_keys($_GET), TRUE) : ''; $query_parameters[] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0'; @@ -913,7 +913,7 @@ } function get_user_data(&$database, &$stuff, $user_name, $ldap_data = NULL) { - $user_data = array(); + $user_data = []; $query_result = $database->do_query('select id, id_external, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, date_created, date_changed, date_synced, date_locked, settings from v_users_self'); @@ -1024,14 +1024,14 @@ } else { $email = explode('@', $ldap_data['mail']); - $parameters = array( + $parameters = [ $ldap_data['givenname'], $ldap_data['sn'], $ldap_data['cn'], $email[0], $email[1], $ldap_data['employeenumber'], - ); + ]; $query_result = $database->do_query('insert into v_users_self_insert (name_human.first, name_human.last, name_human.complete, address_email, id_external) values ($1, $2, $3, ($4, $5, TRUE), $6)', $parameters); if ($query_result instanceof c_base_return_false) { @@ -1103,7 +1103,7 @@ } function get_log_activity(&$database) { - $values = array(); + $values = []; $query_result = $database->do_query('select id, request_path, request_date, request_client, response_code from v_log_user_activity_self order by request_date desc limit 20;'); if ($query_result instanceof c_base_database_result) { @@ -1131,7 +1131,7 @@ } function get_log_users(&$database) { - $values = array(); + $values = []; $query_result = $database->do_query('select id, log_title, log_type, log_date, request_client, response_code from v_log_users_self order by log_date desc limit 10;'); if ($query_result instanceof c_base_database_result) { @@ -1255,7 +1255,7 @@ @socket_clear_error(); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_create', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_create', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); unset($socket_error); return c_base_return_error::s_false($error); @@ -1271,7 +1271,7 @@ @socket_close($socket); unset($socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_connect', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_connect', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); unset($socket_error); return c_base_return_error::s_false($error); @@ -1299,7 +1299,7 @@ @socket_close($socket); unset($socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_write', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_write', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); unset($socket_error); return c_base_return_error::s_false($error); @@ -1316,7 +1316,7 @@ @socket_close($socket); unset($socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_read', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, ['arguments' => [':{operation_name}' => 'socket_read', ':{socket_error}' => $socket_error, ':{socket_error_message}' => @socket_strerror($socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::SOCKET_FAILURE); unset($socket_error); return c_base_return_error::s_false($error); @@ -1352,7 +1352,7 @@ function ldap_get_user(&$stuff, $username) { $stuff['ldap']['markup'] = ''; - $stuff['ldap']['data'] = array(); + $stuff['ldap']['data'] = []; $ldap = new c_base_ldap_get_user(); $ldap->set_name('ldaps://127.0.0.1:1636/'); @@ -1377,7 +1377,7 @@ $base_dn = 'ou=users,ou=People'; $filter = '(uid=' . $username . ')'; - $read = $ldap->do_search($base_dn, $filter, array('mail', 'gecos', 'givenname', 'cn', 'sn', 'employeenumber')); + $read = $ldap->do_search($base_dn, $filter, ['mail', 'gecos', 'givenname', 'cn', 'sn', 'employeenumber']); if (c_base_return::s_has_error($read)) { $message = $ldap->get_error_message(); if ($message instanceof c_base_return_string) { @@ -1399,11 +1399,11 @@ $entries = $entries->get_value(); } else { - $entries = array(); + $entries = []; } if ($entries['count'] > 0) { - $entry = array( + $entry = [ 'uid' => $username, 'mail' => $entries[0]['mail'][0], 'gecos' => $entries[0]['gecos'][0], @@ -1411,7 +1411,7 @@ 'cn' => $entries[0]['cn'][0], 'sn' => $entries[0]['sn'][0], 'employeenumber' => $entries[0]['employeenumber'][0], - ); + ]; $stuff['ldap']['data'] = $entry; $stuff['ldap']['markup'] .= "