Completed
Branch master (c301cc)
by Tõnis
05:49
created
src/Respondent.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                         $this->addError($attribute, Yii::t('app', 'Duplicate email in alternative email addresses'));
147 147
                     }
148 148
 
149
-                    if ($i > static::MAX_ALTERNATIVE_CONTACTS) {
149
+                    if ($i>static::MAX_ALTERNATIVE_CONTACTS) {
150 150
                         $this->addError($attribute, Yii::t('app', 'Maximum alternative addresses limit ({0}) reached for {1}', [static::MAX_ALTERNATIVE_CONTACTS, $this->email_address]));
151 151
                     }
152 152
                     $address = strtolower(trim($address));
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 $item = strtolower(trim($item));
188 188
                 $this->validateAlternativePhoneNumberInternalDuplicates($attribute, $item, $key);
189 189
 
190
-                if ($i > static::MAX_ALTERNATIVE_CONTACTS) {
190
+                if ($i>static::MAX_ALTERNATIVE_CONTACTS) {
191 191
                     $this->addError($attribute, Yii::t('app', 'Maximum alternative phone numbers limit ({0}) reached for {1}', [static::MAX_ALTERNATIVE_CONTACTS, $this->phone_number]));
192 192
                 }
193 193
                $this->validatePhoneNumber($attribute, $item);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
         $query->andWhere($condition, [':phone_number' => $phone_number, ':phone_number2' => '%\"' . $phone_number . '\"%']);
254 254
 
255
-        if ($query->count() > 0) {
255
+        if ($query->count()>0) {
256 256
             $this->addError($attribute,
257 257
                 Yii::t('app',
258 258
                     'Invalid phone number "{0}"', [$phone_number]
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
         $query->andWhere($email_condition, [':email_address' => $email_address, ':email_address2' => '%\"' . $email_address . '\"%']);
287 287
 
288
-        if ($query->count() > 0) {
288
+        if ($query->count()>0) {
289 289
             $this->addError($attribute,
290 290
                 Yii::t('app',
291 291
                     'Invalid email address "{0}"', [$email_address]
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             ->andWhere(['respondent_id'=>$this->primaryKey])
364 364
             // only rejections, not bounces
365 365
             ->andWhere(['is', 'bounce', null]);
366
-        return $rejections->count() > 0;
366
+        return $rejections->count()>0;
367 367
     }
368 368
 
369 369
     /**
@@ -405,14 +405,14 @@  discard block
 block discarded – undo
405 405
         return $query->createCommand()
406 406
             ->update(self::tableName(),
407 407
                 [$field=> $dateHelper->getDatetime6()],
408
-                ['in','token',$tokens]
408
+                ['in', 'token', $tokens]
409 409
             )->execute();
410 410
     }
411 411
 
412 412
     /**
413 413
      * @return array
414 414
      */
415
-    public function getParticipantData(){
415
+    public function getParticipantData() {
416 416
         return [];
417 417
     }
418 418
 
Please login to merge, or discard this patch.
src/Rejection.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             [['type'], 'string', 'max' => 45],
57 57
             [['respondent_id'], 'exist', 'skipOnError' => true, 'targetClass' => Respondent::class, 'targetAttribute' => ['respondent_id' => 'respondent_id']],
58 58
             [['survey_id'], 'exist', 'skipOnError' => true, 'targetClass' => Survey::class, 'targetAttribute' => ['survey_id' => 'survey_id']],
59
-        ],  parent::rules());
59
+        ], parent::rules());
60 60
     }
61 61
 
62 62
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param string $email_address
65 65
      * @return bool
66 66
      */
67
-    public static function hasBouncedHard($email_address){
67
+    public static function hasBouncedHard($email_address) {
68 68
         return (!empty(self::findHardBounces($email_address)));
69 69
     }
70 70
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * @param string $email_address
75 75
      * @return Rejection[]
76 76
      */
77
-    public static function findHardBounces($email_address){
77
+    public static function findHardBounces($email_address) {
78 78
         return Rejection::find()
79 79
             ->andWhere(['email_address'=>$email_address, 'type' => self::BOUNCE_TYPE_HARD])
80 80
             ->all();
@@ -86,18 +86,18 @@  discard block
 block discarded – undo
86 86
      * @param string $type
87 87
      * @return bool
88 88
      */
89
-    public static function bouncedByEmailAddress($email_address,$type = self::BOUNCE_TYPE_HARD){
89
+    public static function bouncedByEmailAddress($email_address, $type = self::BOUNCE_TYPE_HARD) {
90 90
         $rejections = self::find()
91 91
             ->andWhere('email_address=:email_address', [':email_address' => $email_address])
92 92
             ->andWhere('type=:type', [':type' => $type]);
93
-        return $rejections->count() > 0;
93
+        return $rejections->count()>0;
94 94
     }
95 95
 
96 96
     /**
97 97
      * @param string $email_address
98 98
      * @return Rejection
99 99
      */
100
-    public static function findByEmail($email_address){
100
+    public static function findByEmail($email_address) {
101 101
         return Rejection::findOne(['email_address'=>$email_address]);
102 102
     }
103 103
 
@@ -117,13 +117,13 @@  discard block
 block discarded – undo
117 117
         return $this->hasOne($this->respondentClass, ['respondent_id' => 'respondent_id']);
118 118
     }
119 119
 
120
-    public static function getBounceTypes(){
120
+    public static function getBounceTypes() {
121 121
         return [
122
-            self::BOUNCE_TYPE_COMPLAINT => Yii::t('app','Complaint'),
123
-            self::BOUNCE_TYPE_SOFT => Yii::t('app','Soft bounce'),
124
-            self::BOUNCE_TYPE_HARD => Yii::t('app','Hard bounce'),
125
-            self::BOUNCE_TYPE_ANSWERED => Yii::t('app','Respondent has answered already'),
126
-            self::BOUNCE_TYPE_OTHER => Yii::t('app','Other'),
122
+            self::BOUNCE_TYPE_COMPLAINT => Yii::t('app', 'Complaint'),
123
+            self::BOUNCE_TYPE_SOFT => Yii::t('app', 'Soft bounce'),
124
+            self::BOUNCE_TYPE_HARD => Yii::t('app', 'Hard bounce'),
125
+            self::BOUNCE_TYPE_ANSWERED => Yii::t('app', 'Respondent has answered already'),
126
+            self::BOUNCE_TYPE_OTHER => Yii::t('app', 'Other'),
127 127
         ];
128 128
     }
129 129
 
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
             return null;
146 146
         }
147 147
 
148
-        if(isset($this->bounceObject->diagnosticcode)) {
148
+        if (isset($this->bounceObject->diagnosticcode)) {
149 149
             return $this->bounceObject->diagnosticcode;
150 150
         }
151
-        if(isset($this->bounceObject->reason)) {
151
+        if (isset($this->bounceObject->reason)) {
152 152
             return $this->bounceObject->reason;
153 153
         }
154 154
         return null;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             return null;
164 164
         }
165 165
 
166
-        if(isset($this->bounceObject->deliverystatus)) {
166
+        if (isset($this->bounceObject->deliverystatus)) {
167 167
             return $this->bounceObject->deliverystatus;
168 168
         }
169 169
 
Please login to merge, or discard this patch.