Chapter 11: Creating Your Own Composer Package

In this chapter, we are going to continue looking at Composer. This time, we are going to try to create a small but useful package that we can reuse across all of our projects.

The first thing, of course, is to create the actual library that you want to publish. I would encourage you to think twice before publishing an empty "hello world" type package, as Packagist is a real system and there is no benefit in clogging it up with useless libraries.

That being said, let's just make a "hello world" Composer package and try to show some common scenarios. If you decide to upload your version to Packagist, please make sure to remove it once you are done!

You can see the simple "hello world" project that ...

Get The Art of Modern PHP 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.