Skip to content

PHP Warning: Undefined array key "metadata-url" #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marty-macfly opened this issue Nov 17, 2022 · 1 comment
Closed

PHP Warning: Undefined array key "metadata-url" #47

marty-macfly opened this issue Nov 17, 2022 · 1 comment

Comments

@marty-macfly
Copy link

marty-macfly commented Nov 17, 2022

With libyear version 2.1.1 and PHP 8.1 I've got the following error:

PHP Warning:  Undefined array key "metadata-url" in ~/.config/composer/vendor/ecoapm/libyear/src/RepositoryAPI.php on line 31
PHP Fatal error:  Uncaught TypeError: LibYear\Repository::__construct(): Argument #2 ($metadata_pattern) must be of type string, null given, called in ~/.config/composer/vendor/ecoapm/libyear/src/RepositoryAPI.php on line 31 and defined in ~/.config/composer/vendor/ecoapm/libyear/src/Repository.php:10
Stack trace:
#0 ~/.config/composer/vendor/ecoapm/libyear/src/RepositoryAPI.php(31): LibYear\Repository->__construct()
#1 ~/.config/composer/vendor/ecoapm/libyear/src/Calculator.php(27): LibYear\RepositoryAPI->getInfo()
#2 [internal function]: LibYear\Calculator->LibYear\{closure}()
#3 ~/.config/composer/vendor/ecoapm/libyear/src/Calculator.php(27): array_map()
#4 ~/.config/composer/vendor/ecoapm/libyear/src/App.php(70): LibYear\Calculator->getDependencyInfo()
#5 ~/.config/composer/vendor/ecoapm/libyear/src/App.php(35): LibYear\App->getDependencies()
#6 ~/.config/composer/vendor/ecoapm/libyear/libyear(11): LibYear\App->run()
#7 ~/.config/composer/vendor/bin/libyear(120): include('...')
#8 {main}
  thrown in ~/.config/composer/vendor/ecoapm/libyear/src/Repository.php on line 10

The url that doesn't have the metadata url is https://asset-packagist.org/packages.json

Was working ok in libyear 2.0.3

@SteveDesmond-ca
Copy link
Member

Hi @marty-macfly, thanks for this bug report.

Indeed, the app was no longer silently handling when a repository did not provide metadata. This has been fixed in the just-released v2.2.0!

Proper handling of "provider-only" repositories (see #48) is forthcoming in a future version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants