Where should PHP file of custom widget be in? I would like to develop my custom widget as this document in Craft 3.
https://docs.craftcms.com/v3/extend/widget-types.html#registering-custom-widget-types

However, it does not tell me where the PHP file should be in. I suppose it is not under vender/craftcms, because it would be deleted by Craft update. I wonder if you could tell where.
If it were my project, I would probably put the PHP file in modules

Here's some more info https://docs.craftcms.com/v3/extend/ and here: https://docs.craftcms.com/v3/extend/module-guide.html