| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | public function getOrCreateCustomerByEmail($email) |
||
| 48 | { |
||
| 49 | /** @var CustomerInterface $customer */ |
||
| 50 | $customer = $this->customerRepository->findOneBy(['email' => $email]); |
||
| 51 | if (null === $customer) { |
||
| 52 | $customer = $this->customerFactory->createNew(); |
||
| 53 | $customer->setEmail($email); |
||
| 54 | |||
| 55 | $this->customerRepository->add($customer); |
||
| 56 | } |
||
| 57 | |||
| 58 | return $customer; |
||
| 59 | } |
||
| 60 | } |
||
| 61 |