Completed
Pull Request — master (#70)
by
unknown
04:44 queued 02:04
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'] . ':' . $this->escape($property['value']) . "\r\n");
382
+            $string .= $this->fold($property['key'].':'.$this->escape($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());
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
     {
537 537
         $charsetString = '';
538 538
         if ($this->charset == 'utf-8') {
539
-            $charsetString = ';CHARSET=' . $this->charset;
539
+            $charsetString = ';CHARSET='.$this->charset;
540 540
         }
541 541
         return $charsetString;
542 542
     }
@@ -581,8 +581,8 @@  discard block
 block discarded – undo
581 581
      */
582 582
     public function getHeaders($asAssociative)
583 583
     {
584
-        $contentType        = $this->getContentType() . '; charset=' . $this->getCharset();
585
-        $contentDisposition = 'attachment; filename=' . $this->getFilename() . '.' . $this->getFileExtension();
584
+        $contentType        = $this->getContentType().'; charset='.$this->getCharset();
585
+        $contentDisposition = 'attachment; filename='.$this->getFilename().'.'.$this->getFileExtension();
586 586
         $contentLength      = strlen($this->getOutput());
587 587
         $connection         = 'close';
588 588
 
@@ -596,10 +596,10 @@  discard block
 block discarded – undo
596 596
         }
597 597
 
598 598
         return array(
599
-            'Content-type: ' . $contentType,
600
-            'Content-Disposition: ' . $contentDisposition,
601
-            'Content-Length: ' . $contentLength,
602
-            'Connection: ' . $connection,
599
+            'Content-type: '.$contentType,
600
+            'Content-Disposition: '.$contentDisposition,
601
+            'Content-Length: '.$contentLength,
602
+            'Connection: '.$connection,
603 603
         );
604 604
     }
605 605
 
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
      */
678 678
     public function save()
679 679
     {
680
-        $file = $this->getFilename() . '.' . $this->getFileExtension();
680
+        $file = $this->getFilename().'.'.$this->getFileExtension();
681 681
 
682 682
         file_put_contents(
683 683
             $file,
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 
731 731
         // overwrite filename or add to filename using a prefix in between
732 732
         $this->filename = ($overwrite) ?
733
-            $value : $this->filename . $separator . $value;
733
+            $value : $this->filename.$separator.$value;
734 734
     }
735 735
 
736 736
     /**
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
         if (!in_array($element, $this->multiplePropertiesForElementAllowed)
747 747
             && isset($this->definedElements[$element])
748 748
         ) {
749
-            throw new Exception('You can only set "' . $element . '" once.');
749
+            throw new Exception('You can only set "'.$element.'" once.');
750 750
         }
751 751
 
752 752
         // we define that we set this element
Please login to merge, or discard this patch.