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
33 stars 4 forks source link

Add support for composer/installers v2 #12

Closed mcaskill closed 1 year ago

mcaskill commented 1 year ago

This preserves support for v1 while adding support for v2.

szepeviktor commented 1 year ago

Thank you! What does PHPStan tell you when installing v2?

https://github.com/composer/installers/releases/tag/v2.0.0

mcaskill commented 1 year ago

No difference in errors found by PHPStan between Installers v1 and v2:

------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Line   EnvatoConfig.php
------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------
 44     Method SzepeViktor\Composer\Envato\EnvatoConfig::getToken() should return string but returns mixed.
 54     Method SzepeViktor\Composer\Envato\EnvatoConfig::getPackageList() should return array<int, array{name: string, itemId: int, type: string}> but returns array<int,
        array{name: string, itemId: mixed, type: mixed}>.
        💡 Offset 'itemId' (int) does not accept type mixed.
        💡 Offset 'type' (string) does not accept type mixed.

 58     Cannot access offset 'item-id' on mixed.
 59     Cannot access offset 'type' on mixed.
 62     Parameter #1 $array of function array_keys expects array, mixed given.
 63     Parameter #3 ...$arrays of function array_map expects array, mixed given.
------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------
szepeviktor commented 1 year ago

All right. If it blows up we call 🚒 🧯