Skip to content

A tool to check if you are accessing dependencies you should not have access to

License

Notifications You must be signed in to change notification settings

marcosh/phriendly-dependencies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phriendly-dependencies

A tool to check if you are accessing dependencies you should not have access to.

At the moment it checks that you are using, in the use clauses at the beginning of your files, only classes which are contained in a namespace exposed by your own library or by a dependency explicitely declared in your composer.json.

In other words, this tool notifies you if you are using directly classes belonging to packages that are not first dependencies of your own library.

This is to avoid that changes in the dependencies of your dependencies could generate errors in your library.

install

Install the library using

composer require marcosh/phriendly-dependencies

composer

Install dependencies using

composer install

If you are using Docker you could use

docker run --rm -ti -v $(pwd):/app -u $(id -u):$(id -g) -e "COMPOSER_HOME=/tmp/composer" composer install

run

Run the program with

php bin/phd.php -p $PATH_YOU_WANT_TO_ANALYZE

If you are using Docker you could use

docker run --rm -ti -v $(pwd):/app php:7.1 php /app/bin/phd.php -p $PATH_YOU_WANT_TO_ANALYZE

test

Run the tests with

php vendor/bin/phpunit

If you are using Docker you could use

docker run --rm -ti -v $(pwd):/app php:7.1 php /app/vendor/bin/phpunit -c /app/phpunit.xml

About

A tool to check if you are accessing dependencies you should not have access to

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages