PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, January 11, 2022

[FIXED] How to check if libraries are unused in Symfony?

 January 11, 2022     dependencies, libraries, symfony, yarnpkg     No comments   

Issue

I have a lot of libraries listed in my package.json and I know that most of them are unused. How could I know the ones I use and the other one I do not use ?

I am using Symfony 3.4 and Yarn as Dependency Manager

Thanks !


Solution

If you want to know why a packages is installed, you can run the command why. As example, see this list:

>composer show
doctrine/instantiator             1.0.5   A small, lightweight utility to instantiate objects in PHP without invoking their constructors
phpdocumentor/reflection-common   1.0.1   Common reflection classes used by 
.....
input/output with nice error messages.

See the instantiator package

>composer why doctrine/instantiator
phpspec/prophecy              1.8.0  requires  doctrine/instantiator (^1.0.2)
phpunit/phpunit-mock-objects  2.3.8  requires  doctrine/instantiator (^1.0.2)

You can also try the tree version:

>composer why -t doctrine/instantiator
doctrine/instantiator 1.0.5 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
├──phpspec/prophecy 1.8.0 (requires doctrine/instantiator ^1.0.2)
│  └──phpunit/phpunit 4.8.36 (requires phpspec/prophecy ^1.3.1)
│     └──XXXXXXXX dev-master (requires (for development) phpunit/phpunit ~4.6)
└──phpunit/phpunit-mock-objects 2.3.8 (requires doctrine/instantiator ^1.0.2)
   └──phpunit/phpunit 4.8.36 (requires phpunit/phpunit-mock-objects ~2.3)
      └──XXXXXXXX dev-master (requires (for development) phpunit/phpunit ~4.6)


Answered By - Matteo
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing