Skip to content
Discussion options

You must be logged in to vote

<plugin filename> and <pluginClass> work differently.

<plugin filename> loads the PHP file and registers its first declared class directly through registerHooksFromClass(). It does not invoke PluginEntryPointInterface::__invoke().

If your Plugin.php implements PluginEntryPointInterface and registers its handlers inside __invoke(), that would explain why nothing happens and no error is reported.

You have two options:

  1. Point <plugin filename> directly to a class implementing one or more Psalm\Plugin\EventHandler\* interfaces.
  2. Keep <pluginClass> and use Psalm's autoloader configuration attribute to load your plugin class without adding it to Composer's autoload.

For example, set autoloader=…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@WinterSilence
Comment options

@orklah
Comment options

orklah Nov 7, 2026
Collaborator

@WinterSilence
Comment options

@orklah
Comment options

orklah Nov 7, 2026
Collaborator

Answer selected by WinterSilence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants