PHPackages                             sh4ka/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. sh4ka/composer-package-template

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

sh4ka/composer-package-template
===============================

Basic composer package template for creating other packages.

v1.2.5(8y ago)06MITPHPPHP ^7.0

Since Feb 28Pushed 6y agoCompare

[ Source](https://github.com/sh4ka/composer-package-template)[ Packagist](https://packagist.org/packages/sh4ka/composer-package-template)[ Docs](http://github.com/GinoPane/composer-package-template)[ RSS](/packages/sh4ka-composer-package-template/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (20)Used By (0)

Composer Package Template
=========================

[](#composer-package-template)

[![Latest Stable Version](https://camo.githubusercontent.com/9ea7a942d17130c58c5bcc08f5a2cf84e539462f77874e1b96fc812c1926a2d9/68747470733a2f2f706f7365722e707567782e6f72672f67696e6f2d70616e652f636f6d706f7365722d7061636b6167652d74656d706c6174652f762f737461626c65)](https://packagist.org/packages/gino-pane/composer-package-template)[![License](https://camo.githubusercontent.com/d9ef92ef50401c3351fce7279eb2feefd780801eb3b742dd76a4685ee194b102/68747470733a2f2f706f7365722e707567782e6f72672f67696e6f2d70616e652f636f6d706f7365722d7061636b6167652d74656d706c6174652f6c6963656e7365)](https://packagist.org/packages/gino-pane/composer-package-template)[![composer.lock](https://camo.githubusercontent.com/94826da4c1d419a30a361195fca82c6bb6be36d90c92e57431711a2dcd7f62fc/68747470733a2f2f706f7365722e707567782e6f72672f67696e6f2d70616e652f636f6d706f7365722d7061636b6167652d74656d706c6174652f636f6d706f7365726c6f636b)](https://packagist.org/packages/gino-pane/composer-package-template)[![Total Downloads](https://camo.githubusercontent.com/78bc50aae29dffbec36ec486252131af0aa84b426d3827653e56bb7a814e12c8/68747470733a2f2f706f7365722e707567782e6f72672f67696e6f2d70616e652f636f6d706f7365722d7061636b6167652d74656d706c6174652f646f776e6c6f616473)](https://packagist.org/packages/gino-pane/composer-package-template)

If you are trying to create a new PHP Composer package, whether it is going to be submitted to [packagist.org](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.0;
- 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 gino-pane/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;

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)

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

```

or

```
composer psr2autofix

```

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/GinoPane/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/GinoPane/composer-package-template/blob/master/CONTRIBUTION.md).

License
=======

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 63% 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 ~36 days

Recently: every ~0 days

Total

19

Last Release

3070d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4

v1.1.0PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/21e5912a7606b549c83bb6211dec37214a4782dd5b6d4170e9d05377852e4e08?d=identicon)[Sh4ka](/maintainers/Sh4ka)

---

Top Contributors

[![GinoPane](https://avatars.githubusercontent.com/u/3897579?v=4)](https://github.com/GinoPane "GinoPane (17 commits)")[![buonzz](https://avatars.githubusercontent.com/u/946233?v=4)](https://github.com/buonzz "buonzz (5 commits)")[![sh4ka](https://avatars.githubusercontent.com/u/1188509?v=4)](https://github.com/sh4ka "sh4ka (3 commits)")[![paperdarwin](https://avatars.githubusercontent.com/u/5999388?v=4)](https://github.com/paperdarwin "paperdarwin (2 commits)")

---

Tags

composerpackagetemplateboilerplateSkeletonpackage templatecomposer templatecomposer package template

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

PHPackages © 2026

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