Skip to content

Releases: solutionforest/ocpp-php

0.0.4

30 Jan 07:54

Choose a tag to compare

Version 0.0.4


Two updates have been implemented in this version:

1. Optional WebSocket dependencies

  • Moved react/socket and phrity/websocket to suggest in 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 $payload array

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

0.0.3

09 Jan 05:29

Choose a tag to compare

allow int message id

update response format

09 Jan 02:55

Choose a tag to compare

0.0.2

update response format

0.0.1

08 Dec 17:45

Choose a tag to compare