Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 126
0.00% covered (danger)
0.00%
0 / 26
CRAP
0.00% covered (danger)
0.00%
0 / 1
CustomerSurvey
0.00% covered (danger)
0.00%
0 / 126
0.00% covered (danger)
0.00%
0 / 26
2970
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 createFromRow
0.00% covered (danger)
0.00%
0 / 24
0.00% covered (danger)
0.00%
0 / 1
12
 getPlainTextResults
0.00% covered (danger)
0.00%
0 / 78
0.00% covered (danger)
0.00%
0 / 1
756
 setBuy
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStep1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStep1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStep2
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStep2
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStep3
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStep3
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStep4
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStep4
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStep5
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStep5
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStep6
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStep6
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStep6Comments
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStep6Comments
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDateSubmitted
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setDateSubmitted
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getUserAgent
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setUserAgent
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getType
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setType
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getComments
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setComments
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2namespace BuyerKiosk\CustomerSurvey;
3
4class CustomerSurvey  {
5
6    private $_store;
7    public $step1;
8    //Step 1 Result in Plaintext
9    public $ptStep1;
10    public $step2;
11    //Step 2 Result in Plaintext
12    public $ptStep2;
13    public $step3;
14    //Step 3 Result in Plaintext
15    public $ptStep3;
16    public $step4;
17    public $step5;
18    public $step6;
19    //Step 6 Result in Plaintext
20    public $ptStep6;
21    public $step6Comments;
22    public $dateSubmitted;
23    public $userAgent;
24    public $type;
25    public $comments;
26    public $buyID;
27    public $customerID;
28    public $firstName;
29    public $lastName;
30    public $buyerFirstName;
31    public $buyerLastName;
32    public $buyerID;
33    public $sorterFirstName;
34    public $sorterLastName;
35    public $sorterID;
36
37    public function __construct(\Store $store)
38    {
39        $this->_store = $store;
40    }
41
42    public function createFromRow($row) {
43        $this->step1 = $row['step1'];
44        $this->step2 = $row['step2'];
45        $this->step3 = $row['step3'];
46        $this->step4 = $row['step4'];
47        $this->step5 = $row['step5'];
48        $this->step6 = isset($row['step6']) ? $row['step6'] : 0;
49        $this->step6Comments = isset($row['step6Comment']) ? $row['step6Comment'] : '';
50        $dateSubmitted = new \DateTime($row['dateSubmitted'], new \DateTimeZone('UTC'));
51        $dateSubmitted->setTimezone(new \DateTimeZone($this->_store->getTimeZone()));
52        $this->dateSubmitted = $dateSubmitted->format("Y-m-d H:i:s");
53        $this->userAgent = $row['userAgent'];
54        $this->type = $row['type'];
55        $this->comments = $row['comments'];
56        $this->buyID = $row['buyID'];
57        $this->customerID = $row['customerID'];
58        $this->firstName = $row['firstName'];
59        $this->lastName = $row['lastName'];
60        $this->buyerFirstName = $row['buyerFirstName'];
61        $this->buyerLastName = $row['buyerLastName'];
62        $this->sorterLastName = $row['sorterLastName'];
63        $this->sorterFirstName = $row['sorterFirstName'];
64        $this->buyerID = $row['buyerID'];
65        $this->sorterID = $row['sorterID'];
66        $this->getPlainTextResults();
67    }
68    public function getPlainTextResults() {
69        switch ($this->step1) {
70            case 0:
71                $this->ptStep1 = "No, I was not greeted";
72                break;
73            case 1:
74                $this->ptStep1 = "Yes, after a few minutes";
75                break;
76            case 2:
77                $this->ptStep1 = "Yes, immediately";
78                break;
79            default:
80                $this->ptStep1 = "No Answer";
81                break;
82        }
83        switch ($this->step2) {
84            case -1:
85                $this->ptStep2 = "I already know the process";
86                break;
87            case 0:
88                $this->ptStep2 = "No";
89                break;
90            case 1:
91                $this->ptStep2 = "Yes, but very vaguely";
92                break;
93            case 2:
94                $this->ptStep2 = "Yes, but could do better";
95                break;
96            case 3:
97                $this->ptStep2 = "Yes, clearly";
98                break;
99            default:
100                $this->ptStep2 = "No Answer";
101                break;
102        }
103        switch ($this->step3) {
104            case -1:
105                $this->ptStep3 = "All of my items were accepted";
106                break;
107            case 0:
108                $this->ptStep3 = "No";
109                break;
110            case 1:
111                $this->ptStep3 = "Yes, but very vaguely";
112                break;
113            case 2:
114                $this->ptStep3 = "Yes, but could do better";
115                break;
116            case 3:
117                $this->ptStep3 = "Yes, clearly";
118                break;
119            default:
120                $this->ptStep3 = "No Answer";
121                break;
122        }
123        switch ($this->step6) {
124            case 0:
125                $this->ptStep6 = "None";
126                break;
127            case 1:
128                $this->ptStep6 = "Other: " . $this->step6Comments;
129                break;
130            case 2:
131                $this->ptStep6 = "Word of Mouth";
132                break;
133            case 3:
134                $this->ptStep6 = "TikTok";
135                break;
136            case 4:
137                $this->ptStep6 = "Instagram";
138                break;
139            case 5:
140                $this->ptStep6 = "Facebook";
141                break;
142            case 6:
143                $this->ptStep6 = "Google";
144                break;
145            case 7:
146                $this->ptStep6 = "Snapchat";
147                break;
148            case 8:
149                $this->ptStep6 = "Radio";
150                break;
151            default:
152                $this->ptStep6 = "No Answer";
153                break;
154        }
155    }
156
157    /**
158     * @param mixed $buy
159     */
160    public function setBuy($buy)
161    {
162        $this->buy = $buy;
163    }
164
165    /**
166     * @return mixed
167     */
168    public function getStep1()
169    {
170        return $this->step1;
171    }
172
173    /**
174     * @param mixed $step1
175     */
176    public function setStep1($step1)
177    {
178        $this->step1 = $step1;
179    }
180
181    /**
182     * @return mixed
183     */
184    public function getStep2()
185    {
186        return $this->step2;
187    }
188
189    /**
190     * @param mixed $step2
191     */
192    public function setStep2($step2)
193    {
194        $this->step2 = $step2;
195    }
196
197    /**
198     * @return mixed
199     */
200    public function getStep3()
201    {
202        return $this->step3;
203    }
204
205    /**
206     * @param mixed $step3
207     */
208    public function setStep3($step3)
209    {
210        $this->step3 = $step3;
211    }
212
213    /**
214     * @return mixed
215     */
216    public function getStep4()
217    {
218        return $this->step4;
219    }
220
221    /**
222     * @param mixed $step4
223     */
224    public function setStep4($step4)
225    {
226        $this->step4 = $step4;
227    }
228
229    /**
230     * @return mixed
231     */
232    public function getStep5()
233    {
234        return $this->step5;
235    }
236
237    /**
238     * @param mixed $step5
239     */
240    public function setStep5($step5)
241    {
242        $this->step5 = $step5;
243    }
244
245    /**
246     * @return mixed
247     */
248    public function getStep6()
249    {
250        return $this->step6;
251    }
252
253    /**
254     * @param mixed $step6
255     */
256    public function setStep6($step6)
257    {
258        $this->step6 = $step6;
259    }
260
261    /**
262     * @return mixed
263     */
264    public function getStep6Comments()
265    {
266        return $this->step6Comments;
267    }
268
269    /**
270     * @param mixed $step6Comments
271     */
272    public function setStep6Comments($step6Comments)
273    {
274        $this->step6Comments = $step6Comments;
275    }
276
277    /**
278     * @return mixed
279     */
280    public function getDateSubmitted()
281    {
282        return $this->dateSubmitted;
283    }
284
285    /**
286     * @param mixed $dateSubmitted
287     */
288    public function setDateSubmitted($dateSubmitted)
289    {
290        $this->dateSubmitted = $dateSubmitted;
291    }
292
293    /**
294     * @return mixed
295     */
296    public function getUserAgent()
297    {
298        return $this->userAgent;
299    }
300
301    /**
302     * @param mixed $userAgent
303     */
304    public function setUserAgent($userAgent)
305    {
306        $this->userAgent = $userAgent;
307    }
308
309    /**
310     * @return mixed
311     */
312    public function getType()
313    {
314        return $this->type;
315    }
316
317    /**
318     * @param mixed $type
319     */
320    public function setType($type)
321    {
322        $this->type = $type;
323    }
324
325    /**
326     * @return mixed
327     */
328    public function getComments()
329    {
330        return $this->comments;
331    }
332
333    /**
334     * @param mixed $comments
335     */
336    public function setComments($comments)
337    {
338        $this->comments = $comments;
339    }
340
341
342
343}