@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * @covers JWT::__construct |
| 21 | 21 | */ |
| 22 | 22 | public static function setUpBeforeClass(): void { |
| 23 | - self::$ci =& get_instance(); |
|
| 23 | + self::$ci = & get_instance(); |
|
| 24 | 24 | } |
| 25 | 25 | /** |
| 26 | 26 | * [testLoadPackage description] |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | private $primaryKey; |
| 17 | 17 | |
| 18 | - function __construct($params=null) |
|
| 18 | + function __construct($params = null) |
|
| 19 | 19 | { |
| 20 | - $this->ci =& get_instance(); |
|
| 20 | + $this->ci = & get_instance(); |
|
| 21 | 21 | $this->ci->load->config("refactor", false, true); |
| 22 | 22 | $this->ci->load->splint('francis94c/jsonp', '+JSONP', null, 'jsonp'); |
| 23 | 23 | require_once('RefactorPayload.php'); |
@@ -108,24 +108,24 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | // Bools |
| 110 | 110 | if (isset($rule['bools'])) { |
| 111 | - foreach($rule['bools'] as $boolKey) { |
|
| 111 | + foreach ($rule['bools'] as $boolKey) { |
|
| 112 | 112 | $object[$boolKey] = $object[$boolKey] == 1 || $object[$boolKey] == 'true'; |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | // Cast |
| 116 | - if (isset($rule['cast'])) { |
|
| 116 | + if (isset($rule['cast'])) { |
|
| 117 | 117 | $this->cast_fields($object, $rule); |
| 118 | 118 | } |
| 119 | 119 | // Inflate |
| 120 | 120 | if (isset($rule['inflate'])) { |
| 121 | - foreach($rule['inflate'] as $field => $data) { |
|
| 121 | + foreach ($rule['inflate'] as $field => $data) { |
|
| 122 | 122 | $ids = json_decode($object[$field], true); |
| 123 | 123 | if (is_scalar($ids)) { |
| 124 | 124 | // JSON Array wasn't supplied. Let's treat it as a scaler ID. |
| 125 | 125 | $this->ci->db->where($this->primaryKey, $ids); |
| 126 | 126 | $query = $this->ci->db->get($data['table']); |
| 127 | 127 | if ($query->num_rows() == 0) { |
| 128 | - $object[$field] = json_encode (json_decode ("{}")); |
|
| 128 | + $object[$field] = json_encode(json_decode("{}")); |
|
| 129 | 129 | continue; |
| 130 | 130 | } |
| 131 | 131 | $object[$field] = $query->result_array()[0]; |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | $object[$field] = []; |
| 154 | 154 | if ($ids == null) return; |
| 155 | - foreach($ids as $id) { |
|
| 155 | + foreach ($ids as $id) { |
|
| 156 | 156 | $this->ci->db->where($this->primaryKey, $id); |
| 157 | 157 | $query = $this->ci->db->get($data['table']); |
| 158 | 158 | if ($query->num_rows() == 0) { |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * associative array. |
| 179 | 179 | */ |
| 180 | 180 | private function unset_values(array &$object, &$rule):void { |
| 181 | - foreach($rule['unset'] as $key) { |
|
| 181 | + foreach ($rule['unset'] as $key) { |
|
| 182 | 182 | unset($object[$key]); |
| 183 | 183 | } |
| 184 | 184 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @date 2019-11-02 |
| 12 | 12 | * @param array $payload [description] |
| 13 | 13 | */ |
| 14 | - public function __construct($payload=[]) |
|
| 14 | + public function __construct($payload = []) |
|
| 15 | 15 | { |
| 16 | 16 | $this->payload = $payload; |
| 17 | 17 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function switchPayload(&$payload):void |
| 71 | 71 | { |
| 72 | - $this->payload =& $payload; |
|
| 72 | + $this->payload = & $payload; |
|
| 73 | 73 | } |
| 74 | 74 | /** |
| 75 | 75 | * [toArray description] |