@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function setDetail($detail) |
129 | 129 | { |
130 | - $this->detail = array_merge($detail,$this->detail); |
|
130 | + $this->detail = array_merge($detail, $this->detail); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | /** |
174 | 174 | * @return array |
175 | 175 | */ |
176 | - public function getData(){ |
|
177 | - return (isset($this->getDetail()['data']) && is_array($this->getDetail()['data']))?$this->getDetail()['data']:[]; |
|
176 | + public function getData() { |
|
177 | + return (isset($this->getDetail()['data']) && is_array($this->getDetail()['data'])) ? $this->getDetail()['data'] : []; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -52,10 +52,18 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function set($args = []) |
54 | 54 | { |
55 | - if (isset($args['name'])) $this->name = $args['name']; |
|
56 | - if (isset($args['callback'])) $this->callback = $args['callback']; |
|
57 | - if (isset($args['target'])) $this->target = $args['target']; |
|
58 | - if (isset($args['detail'])) $this->detail = $args['detail']; |
|
55 | + if (isset($args['name'])) { |
|
56 | + $this->name = $args['name']; |
|
57 | + } |
|
58 | + if (isset($args['callback'])) { |
|
59 | + $this->callback = $args['callback']; |
|
60 | + } |
|
61 | + if (isset($args['target'])) { |
|
62 | + $this->target = $args['target']; |
|
63 | + } |
|
64 | + if (isset($args['detail'])) { |
|
65 | + $this->detail = $args['detail']; |
|
66 | + } |
|
59 | 67 | } |
60 | 68 | |
61 | 69 | /** |
@@ -145,8 +153,9 @@ discard block |
||
145 | 153 | */ |
146 | 154 | public function getTarget($key = null) |
147 | 155 | { |
148 | - if (!is_null($key)) |
|
149 | - return isset($this->target[$key]) ? $this->target[$key] : ''; |
|
156 | + if (!is_null($key)) { |
|
157 | + return isset($this->target[$key]) ? $this->target[$key] : ''; |
|
158 | + } |
|
150 | 159 | return empty($this->target) ? '' : $this->target; |
151 | 160 | } |
152 | 161 | |
@@ -165,8 +174,9 @@ discard block |
||
165 | 174 | */ |
166 | 175 | public function hasTarget($key = null) |
167 | 176 | { |
168 | - if (!is_null($key)) |
|
169 | - return isset($this->target[$key]) ? true : false; |
|
177 | + if (!is_null($key)) { |
|
178 | + return isset($this->target[$key]) ? true : false; |
|
179 | + } |
|
170 | 180 | return empty($this->target) ? false : true; |
171 | 181 | } |
172 | 182 |