Completed
Pull Request — master (#74)
by
unknown
05:12
created
src/VCard.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
         $type = 'WORK;POSTAL'
85 85
     ) {
86 86
         // init value
87
-        $value = $name . ';' . $extended . ';' . $street . ';' . $city . ';' . $region . ';' . $zip . ';' . $country;
87
+        $value = $name.';'.$extended.';'.$street.';'.$city.';'.$region.';'.$zip.';'.$country;
88 88
 
89 89
         // set property
90 90
         $this->setProperty(
91 91
             'address',
92
-            'ADR' . (($type != '') ? ';' . $type : '') . $this->getCharsetString(),
92
+            'ADR'.(($type != '') ? ';'.$type : '').$this->getCharsetString(),
93 93
             $value
94 94
         );
95 95
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     {
124 124
         $this->setProperty(
125 125
             'company',
126
-            'ORG' . $this->getCharsetString(),
126
+            'ORG'.$this->getCharsetString(),
127 127
             $company
128 128
         );
129 129
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     {
149 149
         $this->setProperty(
150 150
             'email',
151
-            'EMAIL;INTERNET' . (($type != '') ? ';' . $type : ''),
151
+            'EMAIL;INTERNET'.(($type != '') ? ';'.$type : ''),
152 152
             $address
153 153
         );
154 154
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     {
166 166
         $this->setProperty(
167 167
             'jobtitle',
168
-            'TITLE' . $this->getCharsetString(),
168
+            'TITLE'.$this->getCharsetString(),
169 169
             $jobtitle
170 170
         );
171 171
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     {
183 183
         $this->setProperty(
184 184
             'role',
185
-            'ROLE' . $this->getCharsetString(),
185
+            'ROLE'.$this->getCharsetString(),
186 186
             $role
187 187
         );
188 188
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             $value = base64_encode($value);
210 210
 
211 211
             $finfo = finfo_open(FILEINFO_MIME_TYPE);
212
-            $mimetype = finfo_file($finfo, 'data://application/octet-stream;base64,' . $value);
212
+            $mimetype = finfo_file($finfo, 'data://application/octet-stream;base64,'.$value);
213 213
             finfo_close($finfo);
214 214
 
215 215
             if (preg_match('/^image\//', $mimetype) !== 1) {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
             $type = strtoupper(str_replace('image/', '', $mimetype));
220 220
 
221
-            $property .= ";ENCODING=b;TYPE=" . $type;
221
+            $property .= ";ENCODING=b;TYPE=".$type;
222 222
         } else {
223 223
             if (filter_var($url, FILTER_VALIDATE_URL) !== FALSE) {
224 224
                 $propertySuffix = ';VALUE=URL';
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
                     throw new VCardMediaException('Returned data isn\'t an image.');
240 240
                 }
241 241
 
242
-                $propertySuffix .= ';TYPE=' . strtoupper($fileType);
242
+                $propertySuffix .= ';TYPE='.strtoupper($fileType);
243 243
 
244
-                $property = $property . $propertySuffix;
244
+                $property = $property.$propertySuffix;
245 245
                 $value = $url;
246 246
             } else {
247 247
                 $value = $url;
@@ -285,10 +285,10 @@  discard block
 block discarded – undo
285 285
         $this->setFilename($values);
286 286
 
287 287
         // set property
288
-        $property = $lastName . ';' . $firstName . ';' . $additional . ';' . $prefix . ';' . $suffix;
288
+        $property = $lastName.';'.$firstName.';'.$additional.';'.$prefix.';'.$suffix;
289 289
         $this->setProperty(
290 290
             'name',
291
-            'N' . $this->getCharsetString(),
291
+            'N'.$this->getCharsetString(),
292 292
             $property
293 293
         );
294 294
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             // set property
298 298
             $this->setProperty(
299 299
                 'fullname',
300
-                'FN' . $this->getCharsetString(),
300
+                'FN'.$this->getCharsetString(),
301 301
                 trim(implode(' ', $values))
302 302
             );
303 303
         }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     {
316 316
         $this->setProperty(
317 317
             'note',
318
-            'NOTE' . $this->getCharsetString(),
318
+            'NOTE'.$this->getCharsetString(),
319 319
             $note
320 320
         );
321 321
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     {
337 337
         $this->setProperty(
338 338
             'phoneNumber',
339
-            'TEL' . (($type != '') ? ';' . $type : ''),
339
+            'TEL'.(($type != '') ? ';'.$type : ''),
340 340
             $number
341 341
         );
342 342
 
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
     {
374 374
         $this->setProperty(
375 375
             'url',
376
-            'URL' . (($type != '') ? ';' . $type : ''),
376
+            'URL'.(($type != '') ? ';'.$type : ''),
377 377
             $url
378 378
         );
379 379
 
@@ -390,13 +390,13 @@  discard block
 block discarded – undo
390 390
         // init string
391 391
         $string = "BEGIN:VCARD\r\n";
392 392
         $string .= "VERSION:3.0\r\n";
393
-        $string .= "REV:" . date("Y-m-d") . "T" . date("H:i:s") . "Z\r\n";
393
+        $string .= "REV:".date("Y-m-d")."T".date("H:i:s")."Z\r\n";
394 394
 
395 395
         // loop all properties
396 396
         $properties = $this->getProperties();
397 397
         foreach ($properties as $property) {
398 398
             // add to string
399
-            $string .= $this->fold($property['key'] . ':' . $this->escape($property['value']) . "\r\n");
399
+            $string .= $this->fold($property['key'].':'.$this->escape($property['value'])."\r\n");
400 400
         }
401 401
 
402 402
         // add to string
@@ -414,19 +414,19 @@  discard block
 block discarded – undo
414 414
     public function buildVCalendar()
415 415
     {
416 416
         // init dates
417
-        $dtstart = date("Ymd") . "T" . date("Hi") . "00";
418
-        $dtend = date("Ymd") . "T" . date("Hi") . "01";
417
+        $dtstart = date("Ymd")."T".date("Hi")."00";
418
+        $dtend = date("Ymd")."T".date("Hi")."01";
419 419
 
420 420
         // init string
421 421
         $string = "BEGIN:VCALENDAR\n";
422 422
         $string .= "VERSION:2.0\n";
423 423
         $string .= "BEGIN:VEVENT\n";
424
-        $string .= "DTSTART;TZID=Europe/London:" . $dtstart . "\n";
425
-        $string .= "DTEND;TZID=Europe/London:" . $dtend . "\n";
424
+        $string .= "DTSTART;TZID=Europe/London:".$dtstart."\n";
425
+        $string .= "DTEND;TZID=Europe/London:".$dtend."\n";
426 426
         $string .= "SUMMARY:Click attached contact below to save to your contacts\n";
427
-        $string .= "DTSTAMP:" . $dtstart . "Z\n";
427
+        $string .= "DTSTAMP:".$dtstart."Z\n";
428 428
         $string .= "ATTACH;VALUE=BINARY;ENCODING=BASE64;FMTTYPE=text/directory;\n";
429
-        $string .= " X-APPLE-FILENAME=" . $this->getFilename() . "." . $this->getFileExtension() . ":\n";
429
+        $string .= " X-APPLE-FILENAME=".$this->getFilename().".".$this->getFileExtension().":\n";
430 430
 
431 431
         // base64 encode it so that it can be used as an attachemnt to the "dummy" calendar appointment
432 432
         $b64vcard = base64_encode($this->buildVCard());
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
     {
554 554
         $charsetString = '';
555 555
         if ($this->charset == 'utf-8') {
556
-            $charsetString = ';CHARSET=' . $this->charset;
556
+            $charsetString = ';CHARSET='.$this->charset;
557 557
         }
558 558
         return $charsetString;
559 559
     }
@@ -598,8 +598,8 @@  discard block
 block discarded – undo
598 598
      */
599 599
     public function getHeaders($asAssociative)
600 600
     {
601
-        $contentType        = $this->getContentType() . '; charset=' . $this->getCharset();
602
-        $contentDisposition = 'attachment; filename=' . $this->getFilename() . '.' . $this->getFileExtension();
601
+        $contentType        = $this->getContentType().'; charset='.$this->getCharset();
602
+        $contentDisposition = 'attachment; filename='.$this->getFilename().'.'.$this->getFileExtension();
603 603
         $contentLength      = strlen($this->getOutput());
604 604
         $connection         = 'close';
605 605
 
@@ -613,10 +613,10 @@  discard block
 block discarded – undo
613 613
         }
614 614
 
615 615
         return array(
616
-            'Content-type: ' . $contentType,
617
-            'Content-Disposition: ' . $contentDisposition,
618
-            'Content-Length: ' . $contentLength,
619
-            'Connection: ' . $connection,
616
+            'Content-type: '.$contentType,
617
+            'Content-Disposition: '.$contentDisposition,
618
+            'Content-Length: '.$contentLength,
619
+            'Connection: '.$connection,
620 620
         );
621 621
     }
622 622
 
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
      */
695 695
     public function save()
696 696
     {
697
-        $file = $this->getFilename() . '.' . $this->getFileExtension();
697
+        $file = $this->getFilename().'.'.$this->getFileExtension();
698 698
 
699 699
         file_put_contents(
700 700
             $file,
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 
748 748
         // overwrite filename or add to filename using a prefix in between
749 749
         $this->filename = ($overwrite) ?
750
-            $value : $this->filename . $separator . $value;
750
+            $value : $this->filename.$separator.$value;
751 751
     }
752 752
 
753 753
     /**
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
         if (!in_array($element, $this->multiplePropertiesForElementAllowed)
764 764
             && isset($this->definedElements[$element])
765 765
         ) {
766
-            throw new Exception('You can only set "' . $element . '" once.');
766
+            throw new Exception('You can only set "'.$element.'" once.');
767 767
         }
768 768
 
769 769
         // we define that we set this element
Please login to merge, or discard this patch.