Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@eliashaeussler
Copy link
Contributor

All Submissions:


Since symfony/symfony#43534 (released with symfony/serializer 6.2.0), Symfony's ObjectNormalizer has a hard dependency to the symfony/property-access package. As we're using the ObjectNormalizer, we must ensure to meet this requirement by explicitly adding the package as requirement in composer.json.

Otherwise, the following error occurs when running composer-unused:

PHP Fatal error:  Uncaught Error: Class "Symfony\Component\PropertyAccess\PropertyAccess" not found in composer-unused/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:328
Stack trace:
#0 composer-unused/vendor/symfony/serializer/Serializer.php(227): Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->denormalize(Array, 'ComposerUnused\\...', 'json', Array)
#1 composer-unused/vendor/symfony/serializer/Serializer.php(145): Symfony\Component\Serializer\Serializer->denormalize(Array, 'ComposerUnused\\...', 'json', Array)
#2 composer-unused/src/Composer/ConfigFactory.php(36): Symfony\Component\Serializer\Serializer->deserialize(Array, 'ComposerUnused\\...', 'json')
#3 composer-unused/src/Console/Command/UnusedCommand.php(136): ComposerUnused\ComposerUnused\Composer\ConfigFactory->fromPath('/Users/e.haeuss...')
#4 composer-unused/vendor/symfony/console/Command/Command.php(312): ComposerUnused\ComposerUnused\Console\Command\UnusedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 composer-unused/vendor/symfony/console/Application.php(1020): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 composer-unused/vendor/symfony/console/Application.php(312): Symfony\Component\Console\Application->doRunCommand(Object(ComposerUnused\ComposerUnused\Console\Command\UnusedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 composer-unused/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 composer-unused/bin/composer-unused(45): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#9 composer-unused/bin/composer-unused(46): {closure}(Array)
#10 {main}
  thrown in composer-unused/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php on line 328

Since symfony/symfony#43534 (released with `symfony/serializer` 6.2.0),
Symfony's ObjectNormalizer has a hard dependency to the
`symfony/property-access` package. As we're using the ObjectNormalizer,
we must ensure to meet this requirement by explicitly adding the
package as requirement in `composer.json`.
@icanhazstring
Copy link
Member

icanhazstring commented Dec 1, 2022

Hi, thanks.
But that will break composer-unused in itself as property-access is not directly used.
So that the tests are failing and the command itself.

Edit:
Seems like the suggested-by marking is not correctly working.
Also symfony/serializer does suggest symfony/property-access. So it should be marked as used.

@eliashaeussler
Copy link
Contributor Author

Okay, I see. Is there something I can/should do?

@eliashaeussler
Copy link
Contributor Author

@icanhazstring It seems like the problem with suggests is because the property Config::$suggests is not properly hydrated on deserialization of composer.json files. I renamed it to suggest to match the composer.json schema (see 935dedd). Can you have a look at it?

@icanhazstring
Copy link
Member

Nice works. Thanks for the fixes 🙏

@icanhazstring icanhazstring merged commit 2a42337 into composer-unused:main Dec 1, 2022
@eliashaeussler eliashaeussler deleted the fix/require-property-access branch December 1, 2022 11:01
@eliashaeussler
Copy link
Contributor Author

@icanhazstring Thanks for merging! Do you have a released planned in the next time?

@icanhazstring
Copy link
Member

Yes. Will probably do one in the next couple days. Might still want to adjust some minor stuff 😉

@ruscon
Copy link

ruscon commented Dec 27, 2022

@icanhazstring Could you please create a git tag already? :)

@icanhazstring
Copy link
Member

0.8.5 is already there including this fix.

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

Successfully merging this pull request may close these issues.

3 participants