PHPackages                             onramplab/composer-package-template - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. onramplab/composer-package-template

ActiveLibrary[Templating &amp; Views](/categories/templating)

onramplab/composer-package-template
===================================

An composer template

v1.0.1(3y ago)06MITPHPPHP &gt;=7.4

Since Jan 9Pushed 3y ago2 watchersCompare

[ Source](https://github.com/OnrampLab/composer-package-template)[ Packagist](https://packagist.org/packages/onramplab/composer-package-template)[ RSS](/packages/onramplab-composer-package-template/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (10)Versions (3)Used By (0)

composer-package-template
=========================

[](#composer-package-template)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![CircleCI](https://camo.githubusercontent.com/74be66edccf0cc700201edb9190f4431325221237392b19e8cb81418e5a3dfb1/68747470733a2f2f636972636c6563692e636f6d2f67682f4f6e72616d704c61622f636f6d706f7365722d7061636b6167652d74656d706c6174652e7376673f7374796c653d736869656c64)](https://circleci.com/gh/OnrampLab/composer-package-template)[![Total Downloads](https://camo.githubusercontent.com/9118eed9195a22556e531d2c8aa07cdc8a7fbd23c4f4553992ea32f424151913/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6e72616d706c61622f636f6d706f7365722d7061636b6167652d74656d706c6174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/onramplab/composer-package-template)

If you are trying to create a new PHP Composer package, whether it is going to be submitted to packagist.org or just to exist in your Github account, this template package of files will surely help you make the process a lot easier and faster.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4;
- composer.

Features
--------

[](#features)

- PSR-4 autoloading compliant structure;
- PSR-2 compliant code style;
- Unit-Testing with PHPUnit 6;
- Comprehensive guide and tutorial;
- Easy to use with any framework or even a plain php file;
- Useful tools for better code included.

Installation
------------

[](#installation)

```
composer create-project onramplab/composer-package-template yourproject
```

This will create a basic project structure for you:

- **/build** is used to store code coverage output by default;
- **/src** is where your codes will live in, each class will need to reside in its own file inside this folder;
- **/tests** each class that you write in src folder needs to be tested before it was even "included" into somewhere else. So basically we have tests classes there to test other classes;
- **.gitignore** there are certain files that we don't want to publish in Git, so we just add them to this fle for them to "get ignored by git";
- **CHANGELOG.md** to keep track of package updates;
- **CONTRIBUTION.md** Contributor Covenant Code of Conduct;
- **LICENSE** terms of how much freedom other programmers is allowed to use this library;
- **README.md** it is a mini documentation of the library, this is usually the "home page" of your repo if you published it on GitHub and Packagist;
- **composer.json** is where the information about your library is stored, like package name, author and dependencies;
- **phpunit.xml** It is a configuration file of PHPUnit, so that tests classes will be able to test the classes you've written;
- **.travis.yml** basic configuration for Travis CI with configured test coverage reporting for code climate.

Please refer to original [article](http://www.darwinbiler.com/creating-composer-package-library/) for more information.

Useful Tools
------------

[](#useful-tools)

Running Tests:
--------------

[](#running-tests)

```
php vendor/bin/phpunit

```

or

```
composer test

```

Code Sniffer Tool:
------------------

[](#code-sniffer-tool)

```
php vendor/bin/phpcs --standard=PSR2 src/

```

or

```
composer psr2check

```

Code Auto-fixer:
----------------

[](#code-auto-fixer)

```
composer psr2autofix
composer insights:fix
rector:fix

```

Building Docs:
--------------

[](#building-docs)

```
php vendor/bin/phpdoc -d "src" -t "docs"

```

or

```
composer docs

```

Changelog
---------

[](#changelog)

To keep track, please refer to [CHANGELOG.md](https://github.com/Onramplab/composer-package-template/blob/master/CHANGELOG.md).

Contributing
------------

[](#contributing)

1. Fork it.
2. Create your feature branch (git checkout -b my-new-feature).
3. Make your changes.
4. Run the tests, adding new ones for your own code if necessary (phpunit).
5. Commit your changes (git commit -am 'Added some feature').
6. Push to the branch (git push origin my-new-feature).
7. Create new pull request.

Also please refer to [CONTRIBUTION.md](https://github.com/Onramplab/composer-package-template/blob/master/CONTRIBUTION.md).

License
-------

[](#license)

Please refer to [LICENSE](https://github.com/Onramplab/composer-package-template/blob/master/LICENSE).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

1214d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bbca07d652fcb7978dab39dde32df72ff90e7645cd4e51be87f7454853d510a7?d=identicon)[onramplab](/maintainers/onramplab)

---

Top Contributors

[![koshuang](https://avatars.githubusercontent.com/u/1978357?v=4)](https://github.com/koshuang "koshuang (5 commits)")

---

Tags

composerpackagetemplateboilerplateSkeletonpackage templatecomposer templatecomposer package template

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/onramplab-composer-package-template/health.svg)

```
[![Health](https://phpackages.com/badges/onramplab-composer-package-template/health.svg)](https://phpackages.com/packages/onramplab-composer-package-template)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
