@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function toMap($objArray = null): ?array |
55 | 55 | { |
56 | - $data = $objArray??$this; |
|
56 | + $data = $objArray ?? $this; |
|
57 | 57 | if (is_array($data) || is_object($data)) |
58 | 58 | { |
59 | 59 | $result = []; |
@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | $re_2 = new ReflectionObject($data); |
84 | 84 | $classname = get_class($this); |
85 | 85 | if ($pos = strrpos($classname, '\\')) $classname = substr($classname, $pos + 1); |
86 | - return $classname .' {' . implode(', ', array_map( |
|
86 | + return $classname . ' {' . implode(', ', array_map( |
|
87 | 87 | function($p_0) use ($data) |
88 | 88 | { |
89 | 89 | $p_0->setAccessible(true); |
90 | - return $p_0->getName() .': '. $p_0->getValue($data); |
|
91 | - }, $re_2->getProperties())) .'}'; |
|
90 | + return $p_0->getName() . ': ' . $p_0->getValue($data); |
|
91 | + }, $re_2->getProperties())) . '}'; |
|
92 | 92 | |
93 | 93 | } |
94 | 94 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @return string |
98 | 98 | */ |
99 | 99 | public function __get($attribute) { |
100 | - return $this->{$attribute}??""; |
|
100 | + return $this->{$attribute} ?? ""; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -22,8 +22,9 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function __construct(array $params = null) |
24 | 24 | { |
25 | - if (!empty($params)) |
|
26 | - $this->fromMapToModel($params); |
|
25 | + if (!empty($params)) { |
|
26 | + $this->fromMapToModel($params); |
|
27 | + } |
|
27 | 28 | } |
28 | 29 | |
29 | 30 | /** |
@@ -82,7 +83,9 @@ discard block |
||
82 | 83 | $data = (object) $this->toMap(); |
83 | 84 | $re_2 = new ReflectionObject($data); |
84 | 85 | $classname = get_class($this); |
85 | - if ($pos = strrpos($classname, '\\')) $classname = substr($classname, $pos + 1); |
|
86 | + if ($pos = strrpos($classname, '\\')) { |
|
87 | + $classname = substr($classname, $pos + 1); |
|
88 | + } |
|
86 | 89 | return $classname .' {' . implode(', ', array_map( |
87 | 90 | function($p_0) use ($data) |
88 | 91 | { |