Conditions | 4 |
Paths | 3 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function createCustomer(array $customerData) |
||
44 | { |
||
45 | $requiredFieldKeys = ['firstName', 'lastName', 'email', 'company', 'website', 'phone']; |
||
46 | foreach ($requiredFieldKeys as $key) { |
||
47 | if (!array_key_exists($key, $customerData) || empty($customerData[$key])) { |
||
48 | return new Exception('Unable to create customer, missing key: ' . $key); |
||
49 | } |
||
50 | } |
||
51 | return $this->gateway->customer()->create($customerData); |
||
52 | } |
||
53 | } |
||
54 |