Completed
Push — master ( 4726ae...4c43f2 )
by Jeroen
03:21 queued 01:01
created
src/VCard.php 1 patch
Spacing   +33 added lines, -33 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
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             $value = base64_encode($value);
193 193
 
194 194
             $finfo = finfo_open(FILEINFO_MIME_TYPE);
195
-            $mimetype = finfo_file($finfo, 'data://application/octet-stream;base64,' . $value);
195
+            $mimetype = finfo_file($finfo, 'data://application/octet-stream;base64,'.$value);
196 196
             finfo_close($finfo);
197 197
 
198 198
             if (preg_match('/^image\//', $mimetype) !== 1) {
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
             $type = strtoupper(str_replace('image/', '', $mimetype));
203 203
 
204
-            $property .= ";ENCODING=b;TYPE=" . $type;
204
+            $property .= ";ENCODING=b;TYPE=".$type;
205 205
         } else {
206 206
             if (filter_var($url, FILTER_VALIDATE_URL) !== FALSE) {
207 207
                 $propertySuffix = ';VALUE=URL';
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
                     throw new VCardMediaException('Returned data isn\'t an image.');
223 223
                 }
224 224
 
225
-                $propertySuffix .= ';TYPE=' . strtoupper($fileType);
225
+                $propertySuffix .= ';TYPE='.strtoupper($fileType);
226 226
 
227
-                $property = $property . $propertySuffix;
227
+                $property = $property.$propertySuffix;
228 228
                 $value = $url;
229 229
             } else {
230 230
                 $value = $url;
@@ -268,10 +268,10 @@  discard block
 block discarded – undo
268 268
         $this->setFilename($values);
269 269
 
270 270
         // set property
271
-        $property = $lastName . ';' . $firstName . ';' . $additional . ';' . $prefix . ';' . $suffix;
271
+        $property = $lastName.';'.$firstName.';'.$additional.';'.$prefix.';'.$suffix;
272 272
         $this->setProperty(
273 273
             'name',
274
-            'N' . $this->getCharsetString(),
274
+            'N'.$this->getCharsetString(),
275 275
             $property
276 276
         );
277 277
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             // set property
281 281
             $this->setProperty(
282 282
                 'fullname',
283
-                'FN' . $this->getCharsetString(),
283
+                'FN'.$this->getCharsetString(),
284 284
                 trim(implode(' ', $values))
285 285
             );
286 286
         }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     {
299 299
         $this->setProperty(
300 300
             'note',
301
-            'NOTE' . $this->getCharsetString(),
301
+            'NOTE'.$this->getCharsetString(),
302 302
             $note
303 303
         );
304 304
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     {
320 320
         $this->setProperty(
321 321
             'phoneNumber',
322
-            'TEL' . (($type != '') ? ';' . $type : ''),
322
+            'TEL'.(($type != '') ? ';'.$type : ''),
323 323
             $number
324 324
         );
325 325
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     {
357 357
         $this->setProperty(
358 358
             'url',
359
-            'URL' . (($type != '') ? ';' . $type : ''),
359
+            'URL'.(($type != '') ? ';'.$type : ''),
360 360
             $url
361 361
         );
362 362
 
@@ -373,13 +373,13 @@  discard block
 block discarded – undo
373 373
         // init string
374 374
         $string = "BEGIN:VCARD\r\n";
375 375
         $string .= "VERSION:3.0\r\n";
376
-        $string .= "REV:" . date("Y-m-d") . "T" . date("H:i:s") . "Z\r\n";
376
+        $string .= "REV:".date("Y-m-d")."T".date("H:i:s")."Z\r\n";
377 377
 
378 378
         // loop all properties
379 379
         $properties = $this->getProperties();
380 380
         foreach ($properties as $property) {
381 381
             // add to string
382
-            $string .= $this->fold($property['key'] . ':' . $property['value'] . "\r\n");
382
+            $string .= $this->fold($property['key'].':'.$property['value']."\r\n");
383 383
         }
384 384
 
385 385
         // add to string
@@ -397,19 +397,19 @@  discard block
 block discarded – undo
397 397
     public function buildVCalendar()
398 398
     {
399 399
         // init dates
400
-        $dtstart = date("Ymd") . "T" . date("Hi") . "00";
401
-        $dtend = date("Ymd") . "T" . date("Hi") . "01";
400
+        $dtstart = date("Ymd")."T".date("Hi")."00";
401
+        $dtend = date("Ymd")."T".date("Hi")."01";
402 402
 
403 403
         // init string
404 404
         $string = "BEGIN:VCALENDAR\n";
405 405
         $string .= "VERSION:2.0\n";
406 406
         $string .= "BEGIN:VEVENT\n";
407
-        $string .= "DTSTART;TZID=Europe/London:" . $dtstart . "\n";
408
-        $string .= "DTEND;TZID=Europe/London:" . $dtend . "\n";
407
+        $string .= "DTSTART;TZID=Europe/London:".$dtstart."\n";
408
+        $string .= "DTEND;TZID=Europe/London:".$dtend."\n";
409 409
         $string .= "SUMMARY:Click attached contact below to save to your contacts\n";
410
-        $string .= "DTSTAMP:" . $dtstart . "Z\n";
410
+        $string .= "DTSTAMP:".$dtstart."Z\n";
411 411
         $string .= "ATTACH;VALUE=BINARY;ENCODING=BASE64;FMTTYPE=text/directory;\n";
412
-        $string .= " X-APPLE-FILENAME=" . $this->getFilename() . "." . $this->getFileExtension() . ":\n";
412
+        $string .= " X-APPLE-FILENAME=".$this->getFilename().".".$this->getFileExtension().":\n";
413 413
 
414 414
         // base64 encode it so that it can be used as an attachemnt to the "dummy" calendar appointment
415 415
         $b64vcard = base64_encode($this->buildVCard());
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
     {
522 522
         $charsetString = '';
523 523
         if ($this->charset == 'utf-8') {
524
-            $charsetString = ';CHARSET=' . $this->charset;
524
+            $charsetString = ';CHARSET='.$this->charset;
525 525
         }
526 526
         return $charsetString;
527 527
     }
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
      */
567 567
     public function getHeaders($asAssociative)
568 568
     {
569
-        $contentType        = $this->getContentType() . '; charset=' . $this->getCharset();
570
-        $contentDisposition = 'attachment; filename=' . $this->getFilename() . '.' . $this->getFileExtension();
569
+        $contentType        = $this->getContentType().'; charset='.$this->getCharset();
570
+        $contentDisposition = 'attachment; filename='.$this->getFilename().'.'.$this->getFileExtension();
571 571
         $contentLength      = strlen($this->getOutput());
572 572
         $connection         = 'close';
573 573
 
@@ -581,10 +581,10 @@  discard block
 block discarded – undo
581 581
         }
582 582
 
583 583
         return array(
584
-            'Content-type: ' . $contentType,
585
-            'Content-Disposition: ' . $contentDisposition,
586
-            'Content-Length: ' . $contentLength,
587
-            'Connection: ' . $connection,
584
+            'Content-type: '.$contentType,
585
+            'Content-Disposition: '.$contentDisposition,
586
+            'Content-Length: '.$contentLength,
587
+            'Connection: '.$connection,
588 588
         );
589 589
     }
590 590
 
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
      */
663 663
     public function save()
664 664
     {
665
-        $file = $this->getFilename() . '.' . $this->getFileExtension();
665
+        $file = $this->getFilename().'.'.$this->getFileExtension();
666 666
 
667 667
         file_put_contents(
668 668
             $file,
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 
716 716
         // overwrite filename or add to filename using a prefix in between
717 717
         $this->filename = ($overwrite) ?
718
-            $value : $this->filename . $separator . $value;
718
+            $value : $this->filename.$separator.$value;
719 719
     }
720 720
 
721 721
     /**
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
         if (!in_array($element, $this->multiplePropertiesForElementAllowed)
732 732
             && isset($this->definedElements[$element])
733 733
         ) {
734
-            throw new Exception('You can only set "' . $element . '" once.');
734
+            throw new Exception('You can only set "'.$element.'" once.');
735 735
         }
736 736
 
737 737
         // we define that we set this element
Please login to merge, or discard this patch.