PHPackages                             createopen/traits - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. createopen/traits

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

createopen/traits
=================

v0.1.1(13y ago)201072[2 issues](https://github.com/dave1010/php-traits/issues)MITPHPPHP &gt;=5.4.0

Since Sep 7Pushed 12y ago5 watchersCompare

[ Source](https://github.com/dave1010/php-traits)[ Packagist](https://packagist.org/packages/createopen/traits)[ Docs](https://github.com/dave1010/php-traits)[ RSS](/packages/createopen-traits/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

This is a collection of handy PHP traits. These are all stand alone components, without any dependencies, that can be dropped into any project. Requires &gt;= PHP 5.4.0 as it uses traits. Collaborators / pull requests welcome.

[![Build Status](https://camo.githubusercontent.com/97e10b56efd4cac6c0e6a84204edf096bc3573b7506e340df3764a0b2f050947/68747470733a2f2f7472617669732d63692e6f72672f64617665313031302f7068702d7472616974732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/dave1010/php-traits)

Traits
------

[](#traits)

- **ClassExtras** - add utility methods to a class
- **Decorator** - decorator design pattern: add behaviour to an object dynamically
- **Logging** - log messages to 1 or more logs
- **Options** - get and set an object's options
- **Singleton** - design anti-pattern
- **ToString** - safely convert an object to a string

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

[](#installation)

Use [packagist](http://packagist.org/packages/createopen/traits) - put this in your `composer.json`

```
{
    "require": {
        "createopen/traits": "dev-master",
    }
}

```

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';

class Foo {
    use CreateOpen\Traits\Decorator;
}

```

Traits to make
--------------

[](#traits-to-make)

- Event
- Commandline
- Publicize (use the magic `__call()` to make all methodds pseudo-public, for debugging)
- Benchmarking
- ArrayAccessible / Iterator / Countable / Traversable / Filter
- ORM / DataMapper / ActiveRecord
- Cache
- Template
- Foldl
- Monads: Maybe, Collection

License (MIT)
-------------

[](#license-mit)

Copyright (C) 2012 Dave Hulbert

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

4997d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e1e120165e05ab9c78464d0a5e005a28b325df4d071adc4210be27912a2c4a9?d=identicon)[dave1010](/maintainers/dave1010)

---

Top Contributors

[![dave1010](https://avatars.githubusercontent.com/u/50682?v=4)](https://github.com/dave1010 "dave1010 (18 commits)")

### Embed Badge

![Health badge](/badges/createopen-traits/health.svg)

```
[![Health](https://phpackages.com/badges/createopen-traits/health.svg)](https://phpackages.com/packages/createopen-traits)
```

###  Alternatives

[symfony/requirements-checker

Check Symfony requirements and give recommendations

2014.7M29](/packages/symfony-requirements-checker)[symfony/polyfill-intl-messageformatter

Symfony polyfill for intl's MessageFormatter class and related functions

393.9M21](/packages/symfony-polyfill-intl-messageformatter)[nosh2/nosh2

NOSH ChartingSystem.

771.2k](/packages/nosh2-nosh2)

PHPackages © 2026

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