@@ -34,13 +34,13 @@ |
||
34 | 34 | if (isset($visitorData['version'])) { |
35 | 35 | $this->version = (int) $visitorData['version']; |
36 | 36 | } |
37 | - if (!empty($visitorData['fingerprint'])) { |
|
37 | + if ( ! empty($visitorData['fingerprint'])) { |
|
38 | 38 | $this->fingerprint = $visitorData['fingerprint']; |
39 | 39 | } |
40 | - if (!empty($visitorData['browser'])) { |
|
40 | + if ( ! empty($visitorData['browser'])) { |
|
41 | 41 | $this->browser = $visitorData['browser']; |
42 | 42 | } |
43 | - if (!empty($visitorData['ip'])) { |
|
43 | + if ( ! empty($visitorData['ip'])) { |
|
44 | 44 | $this->ip = $visitorData['ip']; |
45 | 45 | } |
46 | 46 | } |
@@ -58,22 +58,22 @@ discard block |
||
58 | 58 | |
59 | 59 | public function __construct(array $leadData = []) |
60 | 60 | { |
61 | - if (!empty($leadData['id'])) { |
|
61 | + if ( ! empty($leadData['id'])) { |
|
62 | 62 | $this->id = (int) $leadData['id']; |
63 | 63 | } |
64 | - if (!empty($leadData['contact_id'])) { |
|
64 | + if ( ! empty($leadData['contact_id'])) { |
|
65 | 65 | $this->contactId = (int) $leadData['contact_id']; |
66 | 66 | } |
67 | - if (!empty($leadData['name'])) { |
|
67 | + if ( ! empty($leadData['name'])) { |
|
68 | 68 | $this->name = $leadData['name']; |
69 | 69 | } |
70 | - if (!empty($leadData['funnel'])) { |
|
70 | + if ( ! empty($leadData['funnel'])) { |
|
71 | 71 | $this->funnelId = (int) $leadData['funnel']; |
72 | 72 | } |
73 | - if (!empty($leadData['stage_id'])) { |
|
73 | + if ( ! empty($leadData['stage_id'])) { |
|
74 | 74 | $this->funnelId = (int) $leadData['stage_id']; |
75 | 75 | } |
76 | - if (!empty($leadData['view'])) { |
|
76 | + if ( ! empty($leadData['view'])) { |
|
77 | 77 | $this->view = new View($leadData['view']); |
78 | 78 | } |
79 | 79 | if (isset($leadData['owner'])) { |
@@ -82,30 +82,30 @@ discard block |
||
82 | 82 | if (isset($leadData['owner_id'])) { |
83 | 83 | $this->ownerId = (int) $leadData['owner_id']; |
84 | 84 | } |
85 | - if (!empty($leadData['payments']) && is_array($leadData['payments'])) { |
|
85 | + if ( ! empty($leadData['payments']) && is_array($leadData['payments'])) { |
|
86 | 86 | foreach ($leadData['payments'] as $paymentData) { |
87 | 87 | $paymentModel = new Payment($paymentData); |
88 | 88 | $this->addPayment($paymentModel); |
89 | 89 | } |
90 | 90 | } |
91 | - if (!empty($leadData['custom']) && is_array($leadData['custom'])) { |
|
91 | + if ( ! empty($leadData['custom']) && is_array($leadData['custom'])) { |
|
92 | 92 | foreach ($leadData['custom'] as $customData) { |
93 | 93 | $customModel = new Custom($customData, $this->id); |
94 | 94 | $this->addCustom($customModel); |
95 | 95 | } |
96 | 96 | } |
97 | - if (!empty($leadData['lead_date'])) { |
|
97 | + if ( ! empty($leadData['lead_date'])) { |
|
98 | 98 | $date = \DateTime::createFromFormat('d.m.Y H:i', $leadData['lead_date']); |
99 | 99 | $this->setCreatedAt($date); |
100 | 100 | } |
101 | - if (!empty($leadData['created_at'])) { |
|
101 | + if ( ! empty($leadData['created_at'])) { |
|
102 | 102 | $date = \DateTime::createFromFormat('d.m.Y H:i', $leadData['created_at']); |
103 | 103 | $this->setCreatedAt($date); |
104 | 104 | } |
105 | - if (!empty($leadData['deal_date'])) { |
|
105 | + if ( ! empty($leadData['deal_date'])) { |
|
106 | 106 | $this->options['deal_date'] = $leadData['deal_date']; |
107 | 107 | } |
108 | - if (!empty($leadData['params']) && is_array($leadData['params'])) { |
|
108 | + if ( ! empty($leadData['params']) && is_array($leadData['params'])) { |
|
109 | 109 | $this->options['params'] = $leadData['params']; |
110 | 110 | } |
111 | 111 | } |
@@ -119,24 +119,24 @@ discard block |
||
119 | 119 | $result = [ |
120 | 120 | 'contact_id' => $this->contactId, |
121 | 121 | ]; |
122 | - if (!empty($this->id)) { |
|
122 | + if ( ! empty($this->id)) { |
|
123 | 123 | $result['id'] = $this->getId(); |
124 | 124 | } |
125 | - if (!empty($this->name)) { |
|
125 | + if ( ! empty($this->name)) { |
|
126 | 126 | $result['name'] = $this->getName(); |
127 | 127 | } |
128 | - if (!empty($this->funnelId)) { |
|
128 | + if ( ! empty($this->funnelId)) { |
|
129 | 129 | $result['funnel'] = $this->getFunnelId(); |
130 | 130 | $result['stage_id'] = $this->getFunnelId(); |
131 | 131 | } |
132 | - if (!empty($this->ownerId)) { |
|
132 | + if ( ! empty($this->ownerId)) { |
|
133 | 133 | $result['owner'] = $this->getOwnerId(); |
134 | 134 | $result['owner_id'] = $this->getOwnerId(); |
135 | 135 | } |
136 | - if (!empty($this->createdAt)) { |
|
136 | + if ( ! empty($this->createdAt)) { |
|
137 | 137 | $result['lead_date'] = $this->getCreatedAt()->format('d.m.Y H:i'); |
138 | 138 | } |
139 | - if (!empty($this->view)) { |
|
139 | + if ( ! empty($this->view)) { |
|
140 | 140 | $result['view'] = $this->view->toArray(); |
141 | 141 | } |
142 | 142 | foreach ($this->getPayments() as $payment) { |
@@ -169,11 +169,11 @@ discard block |
||
169 | 169 | throw new LPTrackerSDKException('Invalid contact id'); |
170 | 170 | } |
171 | 171 | |
172 | - if (!empty($this->funnelId) && (int) $this->funnelId <= 0) { |
|
172 | + if ( ! empty($this->funnelId) && (int) $this->funnelId <= 0) { |
|
173 | 173 | throw new LPTrackerSDKException('Invalid funnel ID'); |
174 | 174 | } |
175 | 175 | |
176 | - if (!empty($this->ownerId) && (int) $this->ownerId < 0) { |
|
176 | + if ( ! empty($this->ownerId) && (int) $this->ownerId < 0) { |
|
177 | 177 | throw new LPTrackerSDKException('Invalid owner ID'); |
178 | 178 | } |
179 | 179 |