PHPackages                             objective-php/primitives - 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. objective-php/primitives

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

objective-php/primitives
========================

Primitives classes for ObjectivePHP

v2.0.0(8y ago)7133.3k↓26.9%317GPL-3.0PHPPHP &gt;=7.0.0

Since May 18Pushed 8y ago8 watchersCompare

[ Source](https://github.com/objective-php/primitives)[ Packagist](https://packagist.org/packages/objective-php/primitives)[ Docs](https://github.com/objective-php/primitives)[ RSS](/packages/objective-php-primitives/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (16)Used By (17)

Objective PHP / Primitives [![Build Status](https://camo.githubusercontent.com/890924ff7f43bf3ba66e77e4053049b2e0516965bf4b7e55451b57fc3e3d9fc0/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6f626a6563746976652d7068702f7072696d6974697665732e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/objective-php/primitives)
===============================================================================================================================================================================================================================================================================================================================================

[](#objective-php--primitives-)

Disclaimer
----------

[](#disclaimer)

This document is written in globish, the flavour of English we're trying to use in France. We know how bad our english is, please don't pay too much attention to it :)

Although we're thinking to this library for a while now, its implementation is still in early stage, and for the next coming months, you'll probably see a few code and a lot of changes in it. This means that if you're interested in this project, you're more than welcome to try it, contribute to it, make proposals for it, but please don't use it in production projects for now!

Project introduction
--------------------

[](#project-introduction)

Primitives objects are foundation of Objective PHP. Objective PHP aims at providing some high-level component to provide PHP with a more objective syntax. The goals of Objective PHP libraries can be summed up like this:

- make extensive use of PHP OOP capabilities
- work with data objects, no multipurpose, dummy containers (aka variables)
- package commonly needed data processing into reliable, efficient and unit tested methods
- turn any error in Exception to ease failure handling
- bring to PHP a more elegant, modern and fluent way to write code (partly inspired by Javascript)
- auto-completion minded library for enhancing developer productivity
- make use of more language's features (like closures)

Our primitives library is intended achieve most of these goals. The very first set of object will contain:

- ObjectivePHP\\Primitives\\String
- ObjectivePHP\\Primitives\\Collection

Each of them will both wrap native functions in a object-oriented way and expose higher level methods to perform many usual data manipulation over those. More on this coming soon, in another document describing the coding standard and rules.

What's next?
------------

[](#whats-next)

First, we'll focus on the three above mentioned classes. We'll consider releasing a 1.0 version once they are ready to get implemented in third-party code with total reliability. Starting from here, we'll be able to work on a much more detailed roadmap.

This roadmap will not only anticipate Primitives library evolutions, but also include parallel development of extended libraries, built on top of Primitives, and offering some even higher level components for real life use:

- HTML Tag
- CSS Styles
- File/Stream
- Image
- Point (coordinates)
- ...

These are just some examples of what kind of classes we intend to work on, but much more are to come.

Once again, you all are invited to contribute by submitting us proposals, trying and testing what we do, contribute (code or documentation). For any contact, please drop us a message at

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

[](#installation)

### Manual

[](#manual)

You can clone our Github repository by running:

```
git clone http://github.com/objective-php/primitives

```

If you're to proceed this way, you probably don't need more explanation about how to use the library :)

### Composer

[](#composer)

The easiest way to install the library and get ready to play with it is by using Composer. Run the following command in an empty folder you just created for Primitives:

```
composer require --dev objective-php/primitives:dev-master

```

Then, you can start coding using primitive classes by requiring Composer's `autoload.php` located in its `vendor` directory.

Hmm, before starting coding, please take the time to read this file till the end :)

How to test the work in progress?
---------------------------------

[](#how-to-test-the-work-in-progress)

### Run unit tests

[](#run-unit-tests)

First of all, before playing around with our primitives, please always run the unit tests suite. Our tests are written using PHPUnit, and can be run as follow:

```
cd [clone directory]/tests
./phpunit .

```

### Write some code

[](#write-some-code)

At this time, you're on your own to find out what Primitives can do for you, sorry for that, we'll soon work on some samples to help you getting started. Meanwhile, you can instantiate the various classes and learn by yourself their capabilities by relying on your IDE auto-completion feature ;)

```
use ObjectivePHP\Primitives\String;
use ObjectivePHP\Primitives\Collection;

// allow Primitives classes autoloading
// Note: this is assuming you used Composer to install the library!
require 'vendor/autoload.php';

$identifier = new String(uniqid());
$server = new Collection($_SERVER);
```

May the OOP be with PHP!

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% 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 ~80 days

Total

14

Last Release

2973d ago

Major Versions

v1.3.7 → v2.0.02018-03-28

PHP version history (3 changes)v1.0PHP &gt;=5.5.0

v1.1.0PHP &gt;=5.6.0

v1.3.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/35ff61d55f3f648d8c1046aac3892fba4781067c98c5cf7e364767f8ca033166?d=identicon)[gauthier](/maintainers/gauthier)

---

Top Contributors

[![gauthier](https://avatars.githubusercontent.com/u/32955?v=4)](https://github.com/gauthier "gauthier (91 commits)")[![fanshan](https://avatars.githubusercontent.com/u/1986015?v=4)](https://github.com/fanshan "fanshan (1 commits)")

---

Tags

collectionobjective phpprimitives

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/objective-php-primitives/health.svg)

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

###  Alternatives

[phpcollection/phpcollection

General-Purpose Collection Library for PHP

1.0k64.0M34](/packages/phpcollection-phpcollection)[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.2k412.9k11](/packages/aimeos-map)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[loophp/collection

A (memory) friendly, easy, lazy and modular collection class.

745663.8k13](/packages/loophp-collection)[athari/yalinqo

YaLinqo, a LINQ-to-objects library for PHP

4561.2M5](/packages/athari-yalinqo)[lorisleiva/lody

Load files and classes as lazy collections in Laravel.

956.6M9](/packages/lorisleiva-lody)

PHPackages © 2026

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