Unused PHP Composer Packages Scanner: Detect packages in a composer project that unused

Recommend this page to a friend!
  Info   Example   View files (27)   Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-10-05 (10 months ago) Not yet rated by the usersTotal: 40 All time: 9,891 This week: 332
Version License PHP version Categories
unused-scanner 1.0.0MIT/X Consortium ...7Utilities and Tools, Console, PHP 7
Description Author

This package can be used to detect packages in a composer project that unused.

It reads a configuration script that returns options that determine how Composer based projects are scanned.

The package outputs to the command line console screen the scan progress steps and in the end it shows the list of unused packages that were found.

Innovation Award
PHP Programming Innovation award nominee
October 2019
Number 4


Prize: 1 Year Subscription to NomadPHP Advanced PHP Learning
This package can be used to detect packages in a composer project that unused.

It reads a configuration script that returns options that determine how Composer based projects are scanned.

The package outputs to the command line console screen the scan progress steps and in the end it shows the list of unused packages that were found.

Manuel Lemos
Picture of Insolita
  Performance   Level  
Name: Insolita <contact>
Classes: 5 packages by
Country: Russian Federation Russian Federation
Age: 34
All time rank: 3913112 in Russian Federation Russian Federation
Week rank: 243 11 in Russian Federation Russian Federation
Innovation award
Innovation award
Nominee: 4x

Details

Project scanner for detect unused composer dependencies

Build Status

Versions

Use 1.3.x@dev versions for projects with php 5.6, 7.0

Use 2.x versions for projects with php >= 7.1

ChangeLog

see CHANGELOG.md

Installation

composer global require insolita/unused-scanner

Ensure that your ~/.composer/vendor/bin directory declared in $PATH

echo $PATH

if not - you should add it in ~/.bashrc or ~/.profile

Update

composer global update

Usage

prepare configuration file, see scanner_config.example.php

put it in project root (or other place)

run composer dumpautoload in your project directory

run unused_scanner /path/to/configuration/file/scanner_config.php

since 1.1 you can run it without argument, if scanner_config.php existed in current working directory, it will be used by default

For auto-testing:

Add --silent option for skip progress output and return exit code = 16, when unused packages detected

run unused_scanner /path/to/configuration/file/scanner_config.php --silent

Docker:

run `docker run -v pwd:/app tico/unused-scanner /app/path/to/configuration/file/scanner_config.php`

wait for result..

Demo screenshot

  Files  
File Role Description
Exceptions (1 file)
Lib (5 files)
tests (9 files, 1 directory)
.travis.yml Data Auxiliary data
CHANGELOG.md Data Auxiliary data
composer.json Data Auxiliary data
issue_template.md Data Auxiliary data
phpunit.xml Data Auxiliary data
README.md Doc. Documentation
scanner_config.example.php Aux. Auxiliary script
unused.png Icon Icon image
unused_scanner Example Example script

  Files  /  Exceptions  
File Role Description
   InvalidConfigException.php Class Class source

  Files  /  Lib  
File Role Description
   ComposerReader.php Class Class source
   Config.php Class Class source
   DependencyMapper.php Class Class source
   Runner.php Class Class source
   Scanner.php Class Class source

  Files  /  tests  
File Role Description
stubs (3 files)
   bootstrap.php Aux. Auxiliary script
   ComposerReaderTest.php Class Class source
   RunnerTest.php Class Class source
   ScannerTest.php Class Class source
   scanner_test_config_dev.php Aux. Auxiliary script
   scanner_test_config_nodev.php Aux. Auxiliary script
   scanner_test_config_reported.php Aux. Auxiliary script
   scanner_test_config_reported_custom.php Aux. Auxiliary script
   stub_composer.json Data Auxiliary data

  Files  /  tests  /  stubs  
File Role Description
   dummy.php Class Class source
   dummy.yml Data Auxiliary data
   foo.twig Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:40
This week:0
All time:9,891
This week:332

For more information send a message to info at phpclasses dot org.