generated from spatie/package-skeleton-php
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7df1400
commit edd590c
Showing
12 changed files
with
588 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,5 @@ phpunit.xml | |
phpstan.neon | ||
psalm.xml | ||
testbench.yaml | ||
/docs | ||
#/docs | ||
/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"name": "pleb/vcardio", | ||
"description": "Parse & write vCard (vcf) files", | ||
"description": "Parse vCards from files (.vcf) or raw data. Build vCards from scratch. Export vCards as string or file.", | ||
"keywords": [ | ||
"vcard", | ||
"vcf" | ||
], | ||
"homepage": "https://github.com/pleb/vcardio", | ||
"homepage": "https://github.com/PierreLebedel/vCardIO", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Pierre Lebedel", | ||
"email": "[email protected]", | ||
"homepage": "https://www.pierrelebedel.fr", | ||
"role": "Developer" | ||
} | ||
], | ||
|
@@ -45,6 +46,6 @@ | |
"phpstan/extension-installer": true | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"minimum-stability": "stable", | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[Documentation homepage](index.md) | ||
|
||
# vCard's `AGENT` property | ||
|
||
The old school `AGENT` property is not longer supported by the vCard specification, but if you parse old data, you can see something like this, with imbricated vCards: | ||
|
||
```txt | ||
BEGIN:VCARD | ||
VERSION:3.0 | ||
FN:Jeffrey Lebowski | ||
AGENT:BEGIN:VCARD | ||
VERSION:3.0 | ||
FN:Walter Sobchak | ||
END:VCARD | ||
END:VCARD | ||
``` | ||
|
||
This package will parse it as a VCard's `agent` property: | ||
|
||
```php | ||
Pleb\VCardIO\Models\VCardV30 { | ||
version: '3.0' | ||
fn: [...], | ||
agent: Pleb\VCardIO\Models\VCardV30 { | ||
version: "3.0" | ||
fn: [...], | ||
... | ||
}, | ||
... | ||
} | ||
``` | ||
|
||
## The vCard object | ||
|
||
View the [vCard object documentation](vcard.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
[Documentation homepage](index.md) | ||
|
||
# Builder | ||
|
||
## Build a vCard | ||
|
||
Each `VCardBuilder` setter returns the builder instance so you can chain them. | ||
|
||
```php | ||
$vCard = Pleb\VCardIO\VCardBuilder::make() | ||
->fullName('Jeffrey Lebowski') | ||
->nickName('The Dude') | ||
->birthday(new DateTime('1942-12-04')) | ||
->x('main-hobby', 'Bowling') | ||
->get(); | ||
``` | ||
|
||
## Available setters | ||
|
||
<!-- | ||
Method | Params | Description | ||
--- | --- | --- | ||
`version` | `string\|VCardVersionEnum` | Set the vCard version. | ||
`agent` | `string\|AbstractVCard` | Set the agent. | ||
`fullName` | `string` | Set the full name. | ||
--> | ||
|
||
```php | ||
$vCardBuilder->version(string|VCardVersionEnum $version); | ||
|
||
$vCardBuilder->agent(string|AbstractVCard $agent); | ||
|
||
$vCardBuilder->fullName(?string $fullName); | ||
|
||
$vCardBuilder->name( | ||
?string $lastName = null, | ||
?string $firstName = null, | ||
?string $middleName = null, | ||
?string $namePrefix = null, | ||
?string $nameSuffix = null | ||
); | ||
|
||
$vCardBuilder->lastName(string $lastName); | ||
|
||
$vCardBuilder->firstName(string $firstName); | ||
|
||
$vCardBuilder->middleName(string $middleName); | ||
|
||
$vCardBuilder->namePrefix(string $namePrefix); | ||
|
||
$vCardBuilder->nameSuffix(string $nameSuffix); | ||
|
||
$vCardBuilder->email(string $email, array $types = []); | ||
|
||
$vCardBuilder->phone(string $number, array $types = ['voice']); | ||
|
||
$vCardBuilder->url(string $url); | ||
|
||
$vCardBuilder->photo(string $photo); | ||
|
||
$vCardBuilder->bday(DateTimeInterface $bday); | ||
$vCardBuilder->birthday(DateTimeInterface $bday); | ||
|
||
$vCardBuilder->anniversary(DateTimeInterface $anniversary); | ||
|
||
$vCardBuilder->kind(string $kind); | ||
|
||
$vCardBuilder->gender(string $gender); | ||
|
||
$vCardBuilder->organization(string $company, ?string $unit1, ?string $unit2); | ||
|
||
$vCardBuilder->title(string $title); | ||
|
||
$vCardBuilder->role(string $role); | ||
|
||
$vCardBuilder->member(string $uid); | ||
|
||
$vCardBuilder->address( | ||
?string $postOfficeAddress, | ||
?string $extendedAddress, | ||
?string $street, | ||
?string $locality, | ||
?string $region, | ||
?string $postalCode, | ||
?string $country, | ||
array $types = [] | ||
); | ||
|
||
$vCardBuilder->geo(float $latitude, float $longitude); | ||
|
||
$vCardBuilder->categories(array $categories); | ||
|
||
$vCardBuilder->category(string $category); | ||
|
||
$vCardBuilder->nickNames(array $nickNames); | ||
|
||
$vCardBuilder->nickName(string $nickName); | ||
|
||
$vCardBuilder->timeZone(DateTimeZone $timeZone); | ||
|
||
$vCardBuilder->uid(string $uid); | ||
$vCardBuilder->uuid(string $uuid); | ||
|
||
$vCardBuilder->calendarAddressUri(string $uri); | ||
|
||
$vCardBuilder->calendarUri(string $uri); | ||
|
||
$vCardBuilder->clientPidMap(int $pid, string $uri); | ||
|
||
$vCardBuilder->fbUrl(string $url); | ||
|
||
$vCardBuilder->impp(string $number, array $types = []); | ||
|
||
$vCardBuilder->key(string $key); | ||
|
||
$vCardBuilder->lang(string $lang, int $pref = 1); | ||
|
||
$vCardBuilder->langs(array $langs); | ||
|
||
$vCardBuilder->logo(string $logo); | ||
|
||
$vCardBuilder->note(string $note); | ||
|
||
$vCardBuilder->prodid(string $prodid); | ||
|
||
$vCardBuilder->related(string $related); | ||
|
||
$vCardBuilder->rev(DateTimeInterface $dateTime); | ||
$vCardBuilder->revision(DateTimeInterface $dateTime); | ||
|
||
$vCardBuilder->sound(string $sound); | ||
|
||
$vCardBuilder->source(string $source); | ||
|
||
$vCardBuilder->xml(string $xml); | ||
|
||
$vCardBuilder->x(string $name, string $value); | ||
|
||
``` | ||
|
||
## Get the vCard object | ||
|
||
```php | ||
$vCard = Pleb\VCardIO\VCardBuilder::make() | ||
// ... | ||
->get(); | ||
``` | ||
|
||
View the [vCard object documentation](vcard.md) for more information. |
Oops, something went wrong.