Package Development & Publishing
Prerequisites: Static analysis & code quality
Publishing a reusable Composer package follows PSR-4 (from Level
2) plus a public composer.json and a version tag on GitHub —
Packagist is the public package registry Composer pulls from
by default.
{
"name": "yourname/text-utils",
"type": "library",
"autoload": {
"psr-4": { "YourName\\TextUtils\\": "src/" }
},
"require": {
"php": "^8.2"
}
}
Tagging a Git release (v1.0.0) and submitting the repository to
packagist.org is all that's needed for
anyone to composer require yourname/text-utils.