@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param int $uid User id. |
68 | 68 | */ |
69 | - public function __construct( $uid = null ) { |
|
70 | - $this->ID = $this->verify_id( $uid ); |
|
69 | + public function __construct($uid = null) { |
|
70 | + $this->ID = $this->verify_id($uid); |
|
71 | 71 | |
72 | 72 | $this->init(); |
73 | 73 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * |
80 | 80 | * @return int |
81 | 81 | */ |
82 | - private function verify_id( $uid ) { |
|
82 | + private function verify_id($uid) { |
|
83 | 83 | // @todo: Realize this method. |
84 | 84 | return $uid; |
85 | 85 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | private function init() { |
91 | 91 | $this->object = $this->get_object(); |
92 | 92 | |
93 | - $this->import( $this->object ); |
|
93 | + $this->import($this->object); |
|
94 | 94 | |
95 | 95 | $this->setup_user_name(); |
96 | 96 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return object |
102 | 102 | */ |
103 | 103 | private function get_object() { |
104 | - return get_user_by( 'id', $this->ID ); |
|
104 | + return get_user_by('id', $this->ID); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | * @return string |
156 | 156 | */ |
157 | 157 | public function link() { |
158 | - if ( ! $this->link ) { |
|
159 | - $this->link = get_author_posts_url( $this->ID ); |
|
158 | + if (!$this->link) { |
|
159 | + $this->link = get_author_posts_url($this->ID); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | return $this->link; |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | */ |
168 | 168 | private function setup_user_name() { |
169 | 169 | $this->name = 'Anonymous'; |
170 | - if ( isset( $this->object->first_name ) && isset( $this->object->last_name ) ) { |
|
171 | - $this->name = $this->object->first_name . ' ' . $this->object->last_name; |
|
170 | + if (isset($this->object->first_name) && isset($this->object->last_name)) { |
|
171 | + $this->name = $this->object->first_name.' '.$this->object->last_name; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $this->display_name = $this->object->display_name; |
@@ -12,28 +12,28 @@ |
||
12 | 12 | * @param object|array $data |
13 | 13 | * @return void |
14 | 14 | */ |
15 | - protected function import( $data ) { |
|
15 | + protected function import($data) { |
|
16 | 16 | |
17 | - if ( is_object( $data ) ) { |
|
17 | + if (is_object($data)) { |
|
18 | 18 | |
19 | - $data = get_object_vars( $data ); |
|
19 | + $data = get_object_vars($data); |
|
20 | 20 | |
21 | 21 | } |
22 | 22 | |
23 | - if ( is_array( $data ) ) { |
|
23 | + if (is_array($data)) { |
|
24 | 24 | |
25 | 25 | // In case if we import WP_User object. |
26 | - if ( isset( $data['data'] ) ) { |
|
26 | + if (isset($data['data'])) { |
|
27 | 27 | $data = $data['data']; |
28 | 28 | } |
29 | 29 | |
30 | - foreach ( $data as $key => $value ) { |
|
30 | + foreach ($data as $key => $value) { |
|
31 | 31 | |
32 | - if ( ! empty( $key ) ) { |
|
32 | + if (!empty($key)) { |
|
33 | 33 | |
34 | 34 | $this->$key = $value; |
35 | 35 | |
36 | - } else if ( ! empty( $key ) && ! method_exists( $this, $key ) ) { |
|
36 | + } else if (!empty($key) && !method_exists($this, $key)) { |
|
37 | 37 | |
38 | 38 | $this->$key = $value; |
39 | 39 |