I have a laravel package for logging. It's used like this.
activity()
->performedOn($model)
->causedBy($user)
->log('Look, I logged something');
The activity() helper returns the vendor class ActivityLogger which is take from the container by class name.
I have to add additional method to vendor logger, so code will look like:
activity()
->performedOn($model)
->causedBy($user)
->relates('#123') // new decorator
->log('Look, I logged something');
I've created a child class and replaced in container the vendor class by new one. Everything works ok, except phpstan complaints about relates method not found in ActivityLogger.
Can I say phpstan that for my application, ActivityLogger is replaced by MyActivityLogger ?