Download the PHP package devmcc/package-dev without Composer
On this page you can find all versions of the php package devmcc/package-dev. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devmcc/package-dev
More information about devmcc/package-dev
Files in devmcc/package-dev
Package package-dev
Short Description A simple tool for developing Composer packages.
License MIT
Informations about the package package-dev
PackageDev
A simple tool for developing Composer packages.
PackageDev makes use of symlinks to make it seem as if the package you are developing is run in vendor. Thanks to this, you can make changes to your package and immediately check the results.
Installation
It is recommended to install PackageDev globally:
After you have installed PackageDev, go to the root directory of the project that needs to use your package and run:
Next, open up your project's composer.json
file and add the following:
Linking packages
After running init
, a new directory called packages
was created, you need to add your packages to this directory.
If your package is called devmcc/testing
, you need to add your package in the following folder structure:
Link your package with the following command:
Unlink your package with the following command:
Using a phar archive
PackageDev can be run through a phar archive. This can be very usefull for when you are using things like Docker containers.
You can create an archive with:
Next, make the following changes to your project's composer.json
file:
NOTE: In order to be able to create phar archives, you need to add the following to your php.ini
file:
Upgrading from version 1
For anyone who was using version 1, here is how you can upgrade to version 2: Unlink all your packages, do the upgrade and link them again
Testing
After you have cloned the repo and installed all dependencies you can do the following:
- Run unit tests with -
vendor/bin/phpunit
- Run code analysis with -
vendor/bin/phpstan analyse src tests --level max
- Run code coverage analysis with -
vendor/bin/phpunit --coverage-html tmp/code-coverage
- Then open tmp/code-coverage/index.html in your browser
- Run phpcs with -
vendor/bin/phpcs --standard=PSR12 src tests