This is a dev dependency for PHP repositories in the Laminas and Mezzio ecosystems.
It is not intended for external use.
composer require laminas/internal-toolingNext, copy the shipped Makefile template to the root of the project with:
cp vendor/laminas/internal-tooling/templates/MakefileTemplate.mk ./MakefileThe template will need some adjustment depending on the project.
Pretty much everything runs in Docker, so you will need docker installed and running on the host machine for the make targets to work.
Other host machine dependencies include:
xpathSome targets shell out toxpathto inspect XML configuration filesfindUsed in some situations to discover files in the working treegitUsed to fetch the documentation theme when building docs
Create a Makefile in the project root with the following contents, after installing this dependency via composer:
# ./Makefile
include vendor/laminas/internal-tooling/MakefileNow, running make should list a number of useful targets for general QA work on Laminas and Mezzio libraries.
Most tools that perform QA checks that can be detected as being installed are added to the qa target, so issuing make qa will run everything in series.
With the provided Makefile, running make docs-lint will check all Markdown files in the root directory, and in the ./docs subdirectory against the markdownlint rules used in CI.
This target is also appended to the qa make target.
When a ./docs directory exists, make qa will automatically invoke the target docs-check-links, which will in turn run a link checker over all the Markdown files in ./docs
The docs-build target will fetch the documentation theme repository, build a mkdocs image and build the static docs directory as per Laminas conventions so that you can eyeball the built docs locally before pushing.
Provides a default configuration for Mago which projects should extend for consistent coding standards via mago fmt and sane defaults for static analysis.
To make use of Mago, create a mago.toml in the root directory that extends the configuration shipped here:
#:schema https://mago.carthage.software/1.51.0/schema.json
extends = "vendor/laminas/internal-tooling/mago/defaults.toml"
# ... customised per-project rules and configuration followsThere are a number of make targets available for running Mago's suite of tools.
make qa will run the formatter in check mode, the linter and the analyser.
make phpcsRuns PHP_CodeSniffer coding standards checksmake phpcbfRuns PHP_CodeSniffer's fixers
make psalmRun Psalm SA checksmake psalm-update-baselineUpdate the Psalm baselinemake psalm-set-baselineExpand the Psalm baseline with new issuesmake psalm-clear-cacheClears the Psalm cache
make test
When rector is installed to ./tools/rector
make rector(Run rector with --dry-run)make rector-fix
Migrations represent small units of automation for common or one-off maintenance tasks for Laminas Repos.
make migrate-to-php86For more information about this migration see the README.
Install rector into ./tools/rector
make install-rectorFor more information about this migration see the README.