@@ -7,10 +7,10 @@ |
||
7 | 7 | if ($lastNsPos = strrpos($className, '\\')) { |
8 | 8 | $namespace = substr($className, 0, $lastNsPos); |
9 | 9 | $className = substr($className, $lastNsPos + 1); |
10 | - $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; |
|
10 | + $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR; |
|
11 | 11 | } |
12 | - $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; |
|
12 | + $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php'; |
|
13 | 13 | |
14 | - require './../src/' . $fileName; |
|
14 | + require './../src/'.$fileName; |
|
15 | 15 | } |
16 | 16 | spl_autoload_register('autoload'); |
17 | 17 | \ No newline at end of file |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | ?> |
9 | 9 | <ul> |
10 | - <?php foreach($data['data'] as $contactlist): ?> |
|
10 | + <?php foreach ($data['data'] as $contactlist): ?> |
|
11 | 11 | <li><?php echo $contactlist['name']; ?><?php if ($contactlist['default']): ?> *<?php endif; ?></li> |
12 | 12 | <?php endforeach; ?> |
13 | 13 | </ul> |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $mailxpert->setAccessToken($_SESSION['access_token']); |
24 | 24 | } |
25 | 25 | |
26 | -$page = isset($_GET['p'])?$_GET['p']:''; |
|
26 | +$page = isset($_GET['p']) ? $_GET['p'] : ''; |
|
27 | 27 | |
28 | 28 | switch ($page) { |
29 | 29 | case 'contactlists': |
@@ -22,19 +22,14 @@ |
||
22 | 22 | $endpoint = static::cleanEndpoint($endpoint); |
23 | 23 | |
24 | 24 | switch ($endpoint) { |
25 | - case (preg_match('/^(\/|)contact_lists(\/{1}[\w\{\}]*|)$/', $endpoint) ? $endpoint : !$endpoint): |
|
26 | - return '\\Mailxpert\\Model\\ContactListFactory'; |
|
27 | - case (preg_match('/^(\/|)contacts(\/{1}[\w\{\}]*|)$/', $endpoint) ? $endpoint : !$endpoint): |
|
28 | - return '\\Mailxpert\\Model\\ContactFactory'; |
|
29 | - case (preg_match('/^(\/|)segments(\/{1}[\w\{\}]*|)$/', $endpoint) ? $endpoint : !$endpoint): |
|
30 | - return '\\Mailxpert\\Model\\SegmentFactory'; |
|
31 | - case (preg_match('/^(\/|)custom_fields(\/{1}[\w\{\}]*|)$/', $endpoint) ? $endpoint : !$endpoint): |
|
32 | - return '\\Mailxpert\\Model\\CustomFieldFactory'; |
|
25 | + case (preg_match('/^(\/|)contact_lists(\/{1}[\w\{\}]*|)$/', $endpoint) ? $endpoint : !$endpoint) : return '\\Mailxpert\\Model\\ContactListFactory'; |
|
26 | + case (preg_match('/^(\/|)contacts(\/{1}[\w\{\}]*|)$/', $endpoint) ? $endpoint : !$endpoint) : return '\\Mailxpert\\Model\\ContactFactory'; |
|
27 | + case (preg_match('/^(\/|)segments(\/{1}[\w\{\}]*|)$/', $endpoint) ? $endpoint : !$endpoint) : return '\\Mailxpert\\Model\\SegmentFactory'; |
|
28 | + case (preg_match('/^(\/|)custom_fields(\/{1}[\w\{\}]*|)$/', $endpoint) ? $endpoint : !$endpoint) : return '\\Mailxpert\\Model\\CustomFieldFactory'; |
|
33 | 29 | case (preg_match( |
34 | 30 | '/^(\/|)custom_fields(\/{1}[\w\{\}]*|)\/choices(\/{1}[\w\{\}]*|)$/', |
35 | 31 | $endpoint |
36 | - ) ? $endpoint : !$endpoint): |
|
37 | - return '\\Mailxpert\\Model\\CustomFieldChoiceFactory'; |
|
32 | + ) ? $endpoint : !$endpoint) : return '\\Mailxpert\\Model\\CustomFieldChoiceFactory'; |
|
38 | 33 | default: |
39 | 34 | throw new MailxpertSDKException(sprintf('No model found for endpoint %s', $endpoint)); |
40 | 35 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | public function findByAlias($alias) |
30 | 30 | { |
31 | 31 | return $this->filter( |
32 | - function (CustomField $element) use ($alias) { |
|
32 | + function(CustomField $element) use ($alias) { |
|
33 | 33 | return $element->getAlias() == $alias; |
34 | 34 | } |
35 | 35 | ); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function add($contact) |
30 | 30 | { |
31 | 31 | if (!$this->exists( |
32 | - function ($key, Contact $element) use ($contact) { |
|
32 | + function($key, Contact $element) use ($contact) { |
|
33 | 33 | return $contact->getEmail() == $element->getEmail(); |
34 | 34 | } |
35 | 35 | ) |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function findByEmail($email) |
47 | 47 | { |
48 | - $contacts = $this->filter(function (Contact $element) use ($email) { |
|
48 | + $contacts = $this->filter(function(Contact $element) use ($email) { |
|
49 | 49 | return $element->getEmail() == strtolower($email); |
50 | 50 | }); |
51 | 51 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function add($contactList) |
26 | 26 | { |
27 | 27 | if (!$this->exists( |
28 | - function ($key, ContactList $element) use ($contactList) { |
|
28 | + function($key, ContactList $element) use ($contactList) { |
|
29 | 29 | return $contactList->getId() == $element->getId(); |
30 | 30 | } |
31 | 31 | ) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function findByName($name) |
43 | 43 | { |
44 | 44 | return $this->filter( |
45 | - function (ContactList $element) use ($name) { |
|
45 | + function(ContactList $element) use ($name) { |
|
46 | 46 | return $element->getName() == $name; |
47 | 47 | } |
48 | 48 | ); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $contactList = static::buildElement($contactListData); |
34 | 34 | |
35 | 35 | if (!$contactLists->exists( |
36 | - function ($key, ContactList $element) use ($contactList) { |
|
36 | + function($key, ContactList $element) use ($contactList) { |
|
37 | 37 | return $contactList->getId() == $element->getId(); |
38 | 38 | } |
39 | 39 | ) |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function add($segment) |
27 | 27 | { |
28 | 28 | if (!$this->exists( |
29 | - function ($key, Segment $element) use ($segment) { |
|
29 | + function($key, Segment $element) use ($segment) { |
|
30 | 30 | return $segment->getId() == $element->getId(); |
31 | 31 | } |
32 | 32 | ) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function findById($id) |
44 | 44 | { |
45 | - $contacts = $this->filter(function (Segment $element) use ($id) { |
|
45 | + $contacts = $this->filter(function(Segment $element) use ($id) { |
|
46 | 46 | return $element->getId() == $id; |
47 | 47 | }); |
48 | 48 |