TramService
in package
Read onlyYes
PEKA e-monitor API wrapper
Tags
Table of Contents
Properties
- $httpClient : HttpClientInterface
- $logger : LoggerInterface
- $ztmUrl : string
Methods
- __construct() : mixed
- getLines() : array<string|int, mixed>
- Get line information
- getMessageForBollard() : array<string|int, mixed>
- Get messages for a specific bollard (stop)
- getRoutes() : array<string|int, mixed>
- Get routes for a specific line
- getStops() : array<string|int, mixed>
- Get stops near specified GPS coordinates
- getTimes() : array{times: array{line: string, minutes: int, direction: string}[]}
- Get departure times for a specific stop
- makeApiRequest() : array<string|int, mixed>
- isValidCoordinates() : bool
Properties
$httpClient
private
HttpClientInterface
$httpClient
$logger
private
LoggerInterface
$logger
$ztmUrl
private
string
$ztmUrl
Methods
__construct()
public
__construct(LoggerInterface $logger, HttpClientInterface $httpClient, string $ztmUrl) : mixed
Parameters
- $logger : LoggerInterface
- $httpClient : HttpClientInterface
- $ztmUrl : string
getLines()
Get line information
public
getLines(int $lineNumber) : array<string|int, mixed>
Parameters
- $lineNumber : int
Tags
Return values
array<string|int, mixed>getMessageForBollard()
Get messages for a specific bollard (stop)
public
getMessageForBollard(string $bollardSymbol) : array<string|int, mixed>
Parameters
- $bollardSymbol : string
Tags
Return values
array<string|int, mixed>getRoutes()
Get routes for a specific line
public
getRoutes(int $lineNumber) : array<string|int, mixed>
Parameters
- $lineNumber : int
Tags
Return values
array<string|int, mixed>getStops()
Get stops near specified GPS coordinates
public
getStops(float $lat, float $lon) : array<string|int, mixed>
Parameters
- $lat : float
-
Latitude (-90 to 90)
- $lon : float
-
Longitude (-180 to 180)
Tags
Return values
array<string|int, mixed>getTimes()
Get departure times for a specific stop
public
getTimes(string $stopId) : array{times: array{line: string, minutes: int, direction: string}[]}
Parameters
- $stopId : string
-
Stop symbol (e.g., "DLA01")
Tags
Return values
array{times: array{line: string, minutes: int, direction: string}[]}makeApiRequest()
protected
makeApiRequest(string $method, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $method : string
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>isValidCoordinates()
private
isValidCoordinates(float $lat, float $lon) : bool
Parameters
- $lat : float
- $lon : float