@@ -16,45 +16,45 @@ |
||
16 | 16 | */ |
17 | 17 | class CurrentUser extends JsonDataNode |
18 | 18 | { |
19 | - const NODE_NAME = 'currentUser'; |
|
19 | + const NODE_NAME = 'currentUser'; |
|
20 | 20 | |
21 | 21 | |
22 | - /** |
|
23 | - * @param JsonDataNodeValidator $validator |
|
24 | - */ |
|
25 | - public function __construct(JsonDataNodeValidator $validator) |
|
26 | - { |
|
27 | - if (PHP_VERSION_ID > 70000 && ! class_exists('WPGraphQL')) { |
|
28 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
29 | - } |
|
30 | - parent::__construct($validator); |
|
31 | - $this->setNodeName(CurrentUser::NODE_NAME); |
|
32 | - } |
|
22 | + /** |
|
23 | + * @param JsonDataNodeValidator $validator |
|
24 | + */ |
|
25 | + public function __construct(JsonDataNodeValidator $validator) |
|
26 | + { |
|
27 | + if (PHP_VERSION_ID > 70000 && ! class_exists('WPGraphQL')) { |
|
28 | + require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
29 | + } |
|
30 | + parent::__construct($validator); |
|
31 | + $this->setNodeName(CurrentUser::NODE_NAME); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * @inheritDoc |
|
36 | - */ |
|
37 | - public function initialize() |
|
38 | - { |
|
39 | - $current_user = wp_get_current_user(); |
|
40 | - if (! $current_user instanceof WP_User) { |
|
41 | - $current_user = new WP_User(); |
|
42 | - } |
|
34 | + /** |
|
35 | + * @inheritDoc |
|
36 | + */ |
|
37 | + public function initialize() |
|
38 | + { |
|
39 | + $current_user = wp_get_current_user(); |
|
40 | + if (! $current_user instanceof WP_User) { |
|
41 | + $current_user = new WP_User(); |
|
42 | + } |
|
43 | 43 | |
44 | - if (class_exists(Relay::class)) { |
|
45 | - $this->addData('id', Relay::toGlobalId('user', $current_user->ID)); |
|
46 | - } |
|
47 | - $this->addData('databaseId', $current_user->ID); |
|
48 | - $this->addData('description', $current_user->description); |
|
49 | - $this->addData('email', $current_user->user_email); |
|
50 | - $this->addData('firstName', $current_user->first_name); |
|
51 | - $this->addData('lastName', $current_user->last_name); |
|
52 | - $this->addData('locale', get_user_locale($current_user->ID)); |
|
53 | - $this->addData('name', $current_user->display_name); |
|
54 | - $this->addData('nicename', $current_user->user_nicename); |
|
55 | - $this->addData('nickname', $current_user->nickname); |
|
56 | - $this->addData('username', $current_user->user_login); |
|
57 | - $this->addData('__typename', 'User'); |
|
58 | - $this->setInitialized(true); |
|
59 | - } |
|
44 | + if (class_exists(Relay::class)) { |
|
45 | + $this->addData('id', Relay::toGlobalId('user', $current_user->ID)); |
|
46 | + } |
|
47 | + $this->addData('databaseId', $current_user->ID); |
|
48 | + $this->addData('description', $current_user->description); |
|
49 | + $this->addData('email', $current_user->user_email); |
|
50 | + $this->addData('firstName', $current_user->first_name); |
|
51 | + $this->addData('lastName', $current_user->last_name); |
|
52 | + $this->addData('locale', get_user_locale($current_user->ID)); |
|
53 | + $this->addData('name', $current_user->display_name); |
|
54 | + $this->addData('nicename', $current_user->user_nicename); |
|
55 | + $this->addData('nickname', $current_user->nickname); |
|
56 | + $this->addData('username', $current_user->user_login); |
|
57 | + $this->addData('__typename', 'User'); |
|
58 | + $this->setInitialized(true); |
|
59 | + } |
|
60 | 60 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function __construct(JsonDataNodeValidator $validator) |
26 | 26 | { |
27 | 27 | if (PHP_VERSION_ID > 70000 && ! class_exists('WPGraphQL')) { |
28 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
28 | + require_once EE_THIRD_PARTY.'wp-graphql/wp-graphql.php'; |
|
29 | 29 | } |
30 | 30 | parent::__construct($validator); |
31 | 31 | $this->setNodeName(CurrentUser::NODE_NAME); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function initialize() |
38 | 38 | { |
39 | 39 | $current_user = wp_get_current_user(); |
40 | - if (! $current_user instanceof WP_User) { |
|
40 | + if ( ! $current_user instanceof WP_User) { |
|
41 | 41 | $current_user = new WP_User(); |
42 | 42 | } |
43 | 43 |