1 | <?php |
||
2 | |||
3 | /** |
||
4 | * VCard generator test - can save to file or output as a download |
||
5 | */ |
||
6 | |||
7 | require_once __DIR__ . '/../vendor/autoload.php'; |
||
8 | require_once __DIR__ . '/../src/VCard.php'; |
||
9 | |||
10 | use JeroenDesloovere\VCard\VCard; |
||
11 | |||
12 | // define vcard |
||
13 | $vcard = new VCard(); |
||
14 | |||
15 | // define variables |
||
16 | $firstname = 'Jeroen'; |
||
17 | $lastname = 'Desloovere'; |
||
18 | $additional = ''; |
||
19 | $prefix = ''; |
||
20 | $suffix = ''; |
||
21 | |||
22 | // add personal data |
||
23 | $vcard->addName($lastname, $firstname, $additional, $prefix, $suffix); |
||
24 | |||
25 | // add work data |
||
26 | $vcard->addCompany('Siesqo'); |
||
27 | $vcard->addJobtitle('Web Developer'); |
||
28 | $vcard->addEmail('[email protected]'); |
||
29 | $vcard->addPhoneNumber(1234121212, 'PREF;WORK'); |
||
30 | $vcard->addPhoneNumber(123456789, 'WORK'); |
||
31 | $vcard->addAddress(null, null, 'street', 'worktown', null, 'workpostcode', 'Belgium'); |
||
32 | $vcard->addURL('http://www.jeroendesloovere.be'); |
||
33 | |||
34 | $vcard->addPhoto(__DIR__ . '/assets/landscape.jpeg'); |
||
35 | //$vcard->addPhoto('https://raw.githubusercontent.com/jeroendesloovere/vcard/master/tests/image.jpg'); |
||
36 | |||
37 | // return vcard as a string |
||
38 | //return $vcard->getOutput(); |
||
39 | |||
40 | // return vcard as a download |
||
41 | return $vcard->download(); |
||
42 | |||
43 | // echo message |
||
44 | echo 'A personal vCard is saved in this folder: ' . __DIR__; |
||
45 | |||
46 | // or |
||
47 | |||
48 | // save the card in file in the current folder |
||
49 | // return $vcard->save(); |
||
50 | |||
51 | // echo message |
||
0 ignored issues
–
show
|
|||
52 | // echo 'A personal vCard is saved in this folder: ' . __DIR__; |
||
53 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.