szepeviktor / composer-envato

Composer plugin for Envato 💚 Install WordPress themes and plugins from ThemeForest‎‎ and CodeCanyon
https://packagist.org/packages/szepeviktor/composer-envato
MIT License
32 stars 3 forks source link

Fix config validation for subscribed event #17

Closed mcaskill closed 1 year ago

mcaskill commented 1 year ago

Amends #16

As mentioned in a comment of that pull request, the EnvatoPlugin::getSubscribedEvents() method is static preventing us from checking the instance property $config.

I've moved the config validation check to handlePreDownloadEvent().

Testing

I've tested the code in practice and I've run PHPStan which reports only the existing issues with EnvatoConfig.