Skip to content

Extension points

phil/contact

The library is plain PHP: it declares no service and no port, and its classes are final. What an application extends lives in the libraries a card is made of.

PointHow
The kinds of web addressesA card's urls are TypedUrls of phil/url: an application adds a kind by writing an enum that implements Phil\Url\UrlType
The messaging servicesA card's handles are Handles of phil/instant-messenger: an application adds a service by writing an enum that implements Phil\InstantMessenger\MessengerType
The country of a phone numberGiven when the PhoneNumber of a PhoneLine is parsed, by phil/phone
How a culture writes and sorts namesA NameConvention of the application's, given to the methods of PersonName
The messaging services and kinds of address JSContact is read asThe messengers and urlTypes arguments of JSContactReader
The bounds of a JSContact card readThe maxBytes, maxDepth and maxEntries arguments of JSContactReader
What JSContact carries beyond the cardJSContactCard::$unmapped, kept and written back; JSContactCard::$notices, what was read but not kept
Where a card is keptContactCardArray::from() gives an array for one JSON column, ContactCardArray::to() reads it back
How a card is publishedVCard::of() for a vCard 4.0 download, SchemaOrg::of() for JSON-LD, JSContactWriter for JSContact; another format is written over the card's public properties
Catching the library's errorsEvery exception implements Phil\Contact\Exception\ContactException

A stored card names each kind and service by its enum class and case, App\Url\Kind::Forum: renaming or removing a case the data still names makes ContactCardArray::to() throw UnreadableContact, so a case is migrated in the data before it leaves the code.