@@ -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 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function switchPayload(&$payload):void |
| 94 | 94 | {
|
| 95 | - $this->payload =& $payload; |
|
| 95 | + $this->payload = & $payload; |
|
| 96 | 96 | } |
| 97 | 97 | /** |
| 98 | 98 | * [toArray description] |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | * @date 2020-04-10 |
| 27 | 27 | * @param [type] $params [description] |
| 28 | 28 | */ |
| 29 | - public function __construct($params=null) |
|
| 29 | + public function __construct($params = null) |
|
| 30 | 30 | {
|
| 31 | - $this->ci =& get_instance(); |
|
| 31 | + $this->ci = & get_instance(); |
|
| 32 | 32 | $this->ci->load->config("refactor", false, true);
|
| 33 | 33 | $this->ci->load->splint('francis94c/jsonp', '+JSONP', null, 'jsonp');
|
| 34 | 34 | |
@@ -36,17 +36,17 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | spl_autoload_register(function($name) {
|
| 38 | 38 | if ($name == 'RefactorPayload') {
|
| 39 | - require(APPPATH . 'splints/' . self::PACKAGE . '/libraries/RefactorPayload.php'); |
|
| 39 | + require(APPPATH.'splints/'.self::PACKAGE.'/libraries/RefactorPayload.php'); |
|
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (file_exists(APPPATH . "payloads/$name.php")) {
|
|
| 44 | - require(APPPATH . "payloads/$name.php"); |
|
| 43 | + if (file_exists(APPPATH."payloads/$name.php")) {
|
|
| 44 | + require(APPPATH."payloads/$name.php"); |
|
| 45 | 45 | return; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if (file_exists(APPPATH . "libraries/refactor/$name.php")) {
|
|
| 49 | - require(APPPATH . "libraries/refactor/$name.php"); // @deprecated |
|
| 48 | + if (file_exists(APPPATH."libraries/refactor/$name.php")) {
|
|
| 49 | + require(APPPATH."libraries/refactor/$name.php"); // @deprecated |
|
| 50 | 50 | } |
| 51 | 51 | }); |
| 52 | 52 | } |
@@ -135,24 +135,24 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | // Bools |
| 137 | 137 | if (isset($rule['bools'])) {
|
| 138 | - foreach($rule['bools'] as $boolKey) {
|
|
| 138 | + foreach ($rule['bools'] as $boolKey) {
|
|
| 139 | 139 | $object[$boolKey] = $object[$boolKey] == 1 || $object[$boolKey] == 'true'; |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | // Cast |
| 143 | - if (isset($rule['cast'])) {
|
|
| 143 | + if (isset($rule['cast'])) {
|
|
| 144 | 144 | $this->cast_fields($object, $rule); |
| 145 | 145 | } |
| 146 | 146 | // Inflate |
| 147 | 147 | if (isset($rule['inflate'])) {
|
| 148 | - foreach($rule['inflate'] as $field => $data) {
|
|
| 148 | + foreach ($rule['inflate'] as $field => $data) {
|
|
| 149 | 149 | $ids = json_decode($object[$field], true); |
| 150 | 150 | if (is_scalar($ids)) {
|
| 151 | 151 | // JSON Array wasn't supplied. Let's treat it as a scaler ID. |
| 152 | 152 | $this->ci->db->where($this->primaryKey, $ids); |
| 153 | 153 | $query = $this->ci->db->get($data['table']); |
| 154 | 154 | if ($query->num_rows() == 0) {
|
| 155 | - $object[$field] = json_encode (json_decode ("{}"));
|
|
| 155 | + $object[$field] = json_encode(json_decode("{}"));
|
|
| 156 | 156 | continue; |
| 157 | 157 | } |
| 158 | 158 | $object[$field] = $query->result_array()[0]; |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | $object[$field] = []; |
| 181 | 181 | if ($ids == null) return; |
| 182 | - foreach($ids as $id) {
|
|
| 182 | + foreach ($ids as $id) {
|
|
| 183 | 183 | $this->ci->db->where($this->primaryKey, $id); |
| 184 | 184 | $query = $this->ci->db->get($data['table']); |
| 185 | 185 | if ($query->num_rows() == 0) {
|
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | * associative array. |
| 206 | 206 | */ |
| 207 | 207 | private function unset_values(array &$object, &$rule):void {
|
| 208 | - foreach($rule['unset'] as $key) {
|
|
| 208 | + foreach ($rule['unset'] as $key) {
|
|
| 209 | 209 | unset($object[$key]); |
| 210 | 210 | } |
| 211 | 211 | } |
@@ -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] |