Using the composer init command, we can kick off the interactive composer.json generator that we will use later on to distribute our package. The interactive generator raises several questions, as per the following output:
We used foggyline as our vendor name here, whereas mp7 (short for Mastering PHP 7) was used for the package name. Upon completion, the composer.json file is generated with the following content:
{
"name": "foggyline/mp7",
"description": "Just a test package.",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Branko Ajzele",
"email": "[email protected]"
}
],
"require": {}
}
Now, let's go ahead and create the src/Foggyline/MP7/Greeting/Goodbye.php...