0.0.4
Version 0.0.4
Two updates have been implemented in this version:
1. Optional WebSocket dependencies
- Moved
react/socketandphrity/websockettosuggestin composer.json - Added runtime class existence checks in examples with installation hints
2. Factory methods for raw OCPP arrays
Call::fromArray(array $message, string $version)- create typed Call from[2, messageId, action, payload]CallResult::fromArray(array $message, string $action, string $version)- create typed CallResult from[3, messageId, payload]JsonSchemaRegistry::createFromArray()- unified method that handles both- Constructors now also accept an optional
$payloadarray
Example usage:
$raw = [2, "msg-001", "BootNotification", ["chargePointVendor" => "X", "chargePointModel" => "Y"]];
$call = Call::fromArray($raw, 'v1.6');
// or
$call = (new JsonSchemaRegistry())->createFromArray($raw, 'v1.6');Full Changelog: 0.0.3...0.0.4