Repository navigation
Config: why plugin added by via <plugin filename> not load?
#13411
|
If I add plugin via filename, then it's not loaded (and not displayed any errors).
|
Replies: 1 comment 4 replies
|
If your You have two options:
For example, set <?php
require_once __DIR__ . '/my/psalm-plugin/src/Plugin.php';Then keep Does your |
<plugin filename>and<pluginClass>work differently.<plugin filename>loads the PHP file and registers its first declared class directly throughregisterHooksFromClass(). It does not invokePluginEntryPointInterface::__invoke().If your
Plugin.phpimplementsPluginEntryPointInterfaceand registers its handlers inside__invoke(), that would explain why nothing happens and no error is reported.You have two options:
<plugin filename>directly to a class implementing one or morePsalm\Plugin\EventHandler\*interfaces.<pluginClass>and use Psalm'sautoloaderconfiguration attribute to load your plugin class without adding it to Composer's autoload.For example, set
autoloader=…