Download the PHP package viavario/compsyclient without Composer
On this page you can find all versions of the php package viavario/compsyclient. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download viavario/compsyclient
More information about viavario/compsyclient
Files in viavario/compsyclient
Package compsyclient
Short Description A PHP client for searching psychologists on compsy.be by registration number.
License MIT
Informations about the package compsyclient
viavario/compsyclient
A lightweight PHP client for looking up psychologists on compsy.be by their Compsy registration number.
Requirements
- PHP
^7.4 | ^8.0 - Extensions:
ext-curl,ext-dom
Installation
Usage
API
CompsyClient
searchByRegistrationNumber(string $registrationNumber): ?CompsyResult
Searches compsy.be for a psychologist by their registration number. Returns a CompsyResult on success, or null if no match was found. Throws a \RuntimeException if the HTTP request fails.
fetchDetail(CompsyResult $result): CompsyResult
Fetches the detail page for a result and populates its registration periods. Returns the same result object, enriched with registration data. Throws a \RuntimeException if the HTTP request fails.
CompsyResult
The result object returned by a successful search.
| Property | Type | Description |
|---|---|---|
$registration_number |
string |
The Compsy registration number |
$name |
string |
The psychologist's full name |
$detailUrl |
string |
Absolute URL to the psychologist's detail page on compsy.be |
$status |
string |
Registration status as returned by the Compsy website |
isActive(): bool
Returns true if $status equals "active" (case-insensitive).
getRegistrationPeriods(): \DatePeriod[]
Returns all registration periods for the psychologist. These are only populated after calling CompsyClient::fetchDetail(). Each \DatePeriod represents a date range during which the person was a registered counselor.
getLastRegistrationEndDate(): ?\DateTimeImmutable
Returns the end date of the most recent registration period, or null if no periods are available. Only populated after calling CompsyClient::fetchDetail().
toArray(): array
Returns the result as an associative array:
Development
Install dependencies:
Run the test suite:
License
MIT — see LICENSE for details.
All versions of compsyclient with dependencies
ext-curl Version *
ext-dom Version *