From ef7f5792bd5e05b27e7648f5d67cde10fb47110a Mon Sep 17 00:00:00 2001 From: Lyzun Oleksandr Date: Tue, 28 Aug 2018 08:35:23 +0200 Subject: [PATCH] Code alignments, formatting --- .../Model/Resolver/CustomerUpdate.php | 14 +------------- .../Magento/CustomerGraphQl/etc/schema.graphqls | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/CustomerUpdate.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/CustomerUpdate.php index 96fe852f700cf..5bce9dfa1d581 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Resolver/CustomerUpdate.php +++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/CustomerUpdate.php @@ -20,7 +20,6 @@ use Magento\Framework\Encryption\EncryptorInterface as Encryptor; use Magento\Customer\Model\CustomerRegistry; - /** * Customers field resolver, used for GraphQL request processing. */ @@ -46,11 +45,6 @@ class CustomerUpdate implements ResolverInterface */ protected $subscriberFactory; - /** - * @var AuthenticationInterface - */ - private $authentication; - /** * @var CustomerRegistry */ @@ -118,7 +112,7 @@ public function resolve( if (isset($args['firstname'])) { $customer->setFirstname($args['firstname']); } - if (isset($args['lastname'])){ + if (isset($args['lastname'])) { $customer->setLastname($args['lastname']); } @@ -126,9 +120,7 @@ public function resolve( $this->customerRepository->save($customer); if (isset($args['is_subscribed'])) { - $checkSubscriber = $this->subscriberFactory->create()->loadByCustomerId($context->getUserId()); - if ($args['is_subscribed'] === true && !$checkSubscriber->isSubscribed()) { $this->subscriberFactory->create()->subscribeCustomerById($context->getUserId()); } elseif ($args['is_subscribed'] === false && $checkSubscriber->isSubscribed()) { @@ -136,15 +128,11 @@ public function resolve( } } - $data = $args; $result = function () use ($data) { return !empty($data) ? $data : []; }; return $this->valueFactory->create($result); - - } - } diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls index f74b4f82f77f8..6683a511010b1 100644 --- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls @@ -59,6 +59,5 @@ type customerItem { firstname: String lastname: String email: String - password: String is_subscribed: Boolean }