phalcon/ide-stubs generate Phalcon\Events\ManagerInterface.php stub with no priority parameter for attach method, that is why static analyzers like Phpstan register a code quality issue when Phalcon\Events\Manager is used:
message: '#^Method Phalcon\Events\ManagerInterface::attach() invoked with 3 parameters, 2 required.$#'
identifier: arguments.count