Skip to content

v4.4.1

Latest

Choose a tag to compare

@GianfriAur GianfriAur released this 23 Jun 12:41
da8f90c

[4.4.1] - 2026-06-23

Fixed

  • Events now reach Laravel listeners out of the box. OpcuaServiceProvider now binds a default Psr\EventDispatcher\EventDispatcherInterface when none is registered. Previously nothing bound that interface, so OpcuaManager received a null dispatcher and OPC UA events (DataChangeReceived, ClientConnected, …) were silently never dispatched — despite the docs stating they "flow through Event::listen() natively". They now do.
  • php artisan opcua:session no longer aborts with auto_publish enabled. SessionCommand resolves EventDispatcherInterface from the container in auto-publish mode; with no binding present this threw BindingResolutionException: Target [Psr\EventDispatcher\EventDispatcherInterface] is not instantiable on daemon startup. The default binding resolves it.

Added

  • PhpOpcua\LaravelOpcua\Events\LaravelPsr14Dispatcher — a thin PSR-14 adapter over Laravel's event dispatcher. Laravel's Illuminate\Events\Dispatcher is shaped like PSR-14 (dispatches an object by class name) but does not formally implement Psr\EventDispatcher\EventDispatcherInterface, so passing it directly fails the type check. The adapter wraps it and is bound as the container default.

Compatibility

  • No application-side changes required, but listener behaviour changes. Apps that registered Event::listen(...) for PhpOpcua\Client\Event\* and saw nothing fire will now start receiving events. If you do not want OPC UA events delivered, do not register listeners for them.
  • Overridable. The default is bound via singletonIf — an application (or another package) that binds its own Psr\EventDispatcher\EventDispatcherInterface first keeps it untouched.
  • Guarded. The default is only registered when Laravel's event system is present ($app->bound('events')); in a bare container with no events binding, OpcuaManager still receives null as before.
  • No config changes. config/opcua.php and the OPCUA_* env keys are unchanged.