PHPackages                             serger/cake-utility - 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. serger/cake-utility

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

serger/cake-utility
===================

CakePHP 3.x Utility classes such as Inflector, String, and Hash without Cake/Core dependency

v3.0.4(1y ago)0217MITPHPPHP &gt;=8.0

Since Apr 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SergeR/cake-utils)[ Packagist](https://packagist.org/packages/serger/cake-utility)[ RSS](/packages/serger-cake-utility/feed)WikiDiscussions master Synced 3d ago

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

[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)

CakePHP Utility Classes
=======================

[](#cakephp-utility-classes)

This is the fork of library provides a range of utility classes of CakePHP framework but without framework core dependencies.

Why?
----

[](#why)

I like CakePHP, a powerful, beautiful and flexible PHP framework. But I can't use it with every project I work :( . So I clone this very handy toolbox, drops out any dependencies to Cake/Core to use this library separately.

Versioning strategy
-------------------

[](#versioning-strategy)

- 1.x.x — PHP 5.6-7.3, receives code backports as soon as my projects runs on these PHP versions
- 2.x.x — PHP 7.4, receives code and tests backports
- 3.x.x — PHP 8.0 currently in the master branch

What's in the toolbox?
----------------------

[](#whats-in-the-toolbox)

### Hash

[](#hash)

A `Hash` (as in PHP arrays) class, capable of extracting data using an intuitive DSL:

```
$things = [
    ['name' => 'Mark', 'age' => 15],
    ['name' => 'Susan', 'age' => 30],
    ['name' => 'Lucy', 'age' => 25]
];

$bigPeople = Hash::extract($things, '{n}[age>21].name');

// $bigPeople will contain ['Susan', 'Lucy']
```

Check the [official Hash class documentation](https://book.cakephp.org/3.0/en/core-libraries/hash.html)

### Inflector

[](#inflector)

The Inflector class takes a string and can manipulate it to handle word variations such as pluralizations or camelizing.

```
echo Inflector::pluralize('Apple'); // echoes Apples

echo Inflector::singularize('People'); // echoes Person
```

Check the [official Inflector class documentation](https://book.cakephp.org/3.0/en/core-libraries/inflector.html)

### Text

[](#text)

The Text class includes convenience methods for creating and manipulating strings.

```
Text::insert(
    'My name is :name and I am :age years old.',
    ['name' => 'Bob', 'age' => '65']
);
// Returns: "My name is Bob and I am 65 years old."

$text = 'This is the song that never ends.';
$result = Text::wrap($text, 22);

// Returns
This is the song
that never ends.
```

Check the [official Text class documentation](https://book.cakephp.org/3.0/en/core-libraries/text.html)

### Xml

[](#xml)

The Xml class allows you to easily transform arrays into SimpleXMLElement or DOMDocument objects and back into arrays again

```
$data = [
    'post' => [
        'id' => 1,
        'title' => 'Best post',
        'body' => ' ... '
    ]
];
$xml = Xml::build($data);
```

Check the [official Xml class documentation](https://book.cakephp.org/3.0/en/core-libraries/xml.html)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance47

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

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

Recently: every ~19 days

Total

17

Last Release

397d ago

Major Versions

v1.0.0 → v2.0.02023-04-20

v1.0.1 → v3.0.02023-04-20

v1.0.2 → v3.0.22023-04-27

v1.0.3 → v2.0.32025-01-25

v1.0.4 → v3.0.32025-01-25

PHP version history (3 changes)v1.0.0PHP &gt;=5.6.0

v2.0.0PHP &gt;=7.4.0

v3.0.0PHP &gt;=8.0

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

stringhashinflector

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/serger-cake-utility/health.svg)

```
[![Health](https://phpackages.com/badges/serger-cake-utility/health.svg)](https://phpackages.com/packages/serger-cake-utility)
```

###  Alternatives

[doctrine/inflector

PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.

11.4k855.8M711](/packages/doctrine-inflector)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[hashids/hashids

Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers

5.5k48.6M278](/packages/hashids-hashids)[cakephp/utility

CakePHP Utility classes such as Inflector, String, Hash, and Security

12027.1M63](/packages/cakephp-utility)[coduo/php-to-string

Simple library that converts PHP value into strings

27112.7M10](/packages/coduo-php-to-string)[opis/string

Multibyte strings as objects

7120.9M7](/packages/opis-string)

PHPackages © 2026

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