PHPackages                             stillat/php-package - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. stillat/php-package

ActiveLibrary[Testing &amp; Quality](/categories/testing)

stillat/php-package
===================

A starting point for basic PHP packages. Allows configuration of PHPUnit and TravisCI

1.1.1(10y ago)015MITPHP

Since Nov 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Stillat/php-package)[ Packagist](https://packagist.org/packages/stillat/php-package)[ RSS](/packages/stillat-php-package/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

PHP Package
===========

[](#php-package)

PHP Package is a template for the [NewUp](https://github.com/newup/newup) package generator. The NewUp generator is a general-purpose tool for creating things from templates; PHP Package is a template that provides you with a starting point for your PHP projects.

- [Installation](#installation)
- [General Usage](#usage)
- [Specifying a PHP Version](#phpv)
- [PSR-0 / PSR-4](#psr)
- [PHPUnit Integration](#phpunit)
- [TravisCI Integration](#travis)
- [License](#license)

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

[](#installation)

First, make sure you have [NewUp](https://github.com/newup/newup) installed and configured. Afterwards, you can run this command:

`newup template:install stillat/php-package`

NewUp will then install and configure everything it needs to internally for the `php-package` template.

General Usage
-------------

[](#general-usage)

After you have installed the `php-package` template, we are ready to create a new PHP Package:

`newup a stillat/php-package vendor/package `

In the above example, replace `vendor/package` with the vendor and package name of your new package (for example `stillat/php-package`) and replace `` with the directory you want the package to be created in.

Used with no options, PHP Package will create a directory/file structure similar to the following:

```
src/
.gitignore
composer.json

```

The `src/` directory is where you will create your new package/library. It is empty so you have a fresh starting point. This directory will be autoloaded by Composer using the `psr-0` autoloader.

The `.gitignore` file contains quite a few options set for you by default, with instructions on how to remove configured options and where to find more.

The `composer.json` file is your standard `composer.json` file. If you configured NewUp with your name and email address, the authors field will already be filled in for you.

Specifying a PHP version
------------------------

[](#specifying-a-php-version)

You can specify a PHP version that your package requires by providing an extra parameter when generating your package:

`newup a stillat/php-package vendor/package  `

By default, the PHP version is set to `>=5.5.9`.

For example, we could easily state that our package needs at least PHP 5.6 when creating our package (pay special attention to the quotes!):

`newup a stillat/php-package vendor/package  ">=5.6"`

PSR-0 / PSR-4
-------------

[](#psr-0--psr-4)

You can choose which autoloader to use by supplying a value for the `--psr` option. The following table lists the valid values you can use:

AutoloaderValueExamplePSR-0`psr0``newup a stillat/php-package  vendor/package --psr=psr0`PSR-4`psr4``newup a stillat/php-package  vendor/package --psr=psr4`The PSR-4 autoloader is selected by default.

When choosing to use the PSR-0 autoloader, directory scaffolding will automatically be created for you. For example, if the package name was `stillat/test`, the following directory structure would be created when using the PSR-0 autoloader:

```
/
│── src/
│   ├── Stillat/
│   │   ├────── Test/
├── composer.json
├── .gitignore

```

This is different that when using the PSR-4 autoloader, as the `src/` directory would just be empty.

PHPUnit Integration
-------------------

[](#phpunit-integration)

To enable PHPUnit support on your generated package, just add the "--phpunit" switch to the end of the command:

`newup a stillat/php-package vendor/package  --phpunit`

The following additional directories/files will be created for you:

```
tests/
tests/ExampleTest.php
phpunit.xml

```

The `tests/` directory will be where your tests will live. An example test (`tests/ExampleTest.php` is already included in this directory (this can be safely deleted).

The `phpunit.xml` file contains the configuration for PHPUnit. It is already configured with sensible defaults and features a customized test suite name.

In addition to creating new directories and files for you, opting in to PHPUnit integration will also update your generated `composer.json` file to include `mockery/mockery` and `phpunit/phpunit` automatically.

TravisCI Integration
--------------------

[](#travisci-integration)

If you would like to rapidly configure TravisCI for your project, just add the `--travis` switch to the end of the command:

`newup a stillat/php-package vendor/package  --travis`

You will see interactive prompts that will guide you through the configuration process. An example session might look something like this:

```
Would you like to add a PHP version to test? [Y/n] Y
Which PHP version would you like to test? 5.5.9
Do you want to allow failures for PHP version 5.5.9? [y/N] N

Would you like to add a PHP version to test? [Y/n] Y
Which PHP version would you like to test? 5.6
Do you want to allow failures for PHP version 5.6? [y/N] N

Would you like to add a PHP version to test? [Y/n] Y
Which PHP version would you like to test? 7.0
Do you want to allow failures for PHP version 7.0? [y/N] Y

Would you like to add a PHP version to test? [Y/n] Y
Which PHP version would you like to test? hhvm
Do you want to allow failures for PHP version hhvm? [y/N] N

Would you like to add a PHP version to test? [Y/n] N

```

This would generate a `.travis.yml` file similar to the following:

```
language: php

php:
  - 5.5.9
  - 5.6
  - 7.0
  - hhvm

matrix:
    allow_failures:
        - php: 7.0

sudo: false

install: travis_retry composer install --no-interaction --prefer-source

```

### TravisCI and PHPUnit

[](#travisci-and-phpunit)

If you specify both the `--travis` and the `--phpunit` flags, the following script will be added to the end of your `.travis.yml` file automatically for you:

`script: vendor/bin/phpunit`

License
-------

[](#license)

Licensed under the MIT License. Enjoy!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~0 days

Total

3

Last Release

3820d ago

### Community

Maintainers

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

---

Top Contributors

[![JohnathonKoster](https://avatars.githubusercontent.com/u/5232890?v=4)](https://github.com/JohnathonKoster "JohnathonKoster (3 commits)")

### Embed Badge

![Health badge](/badges/stillat-php-package/health.svg)

```
[![Health](https://phpackages.com/badges/stillat-php-package/health.svg)](https://phpackages.com/packages/stillat-php-package)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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