PHPackages                             types-toon/types-toon - 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. types-toon/types-toon

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

types-toon/types-toon
=====================

a simple and elegant lib for manipulate types of data in php, with fluent API.

v1.0.0(3mo ago)14MITPHPPHP &gt;=8.0

Since Jan 21Pushed 3mo agoCompare

[ Source](https://github.com/cceffas/TypesToon)[ Packagist](https://packagist.org/packages/types-toon/types-toon)[ RSS](/packages/types-toon-types-toon/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

[![logomark](./typeToonLogomark.svg)](./typeToonLogomark.svg)

[![Version](https://camo.githubusercontent.com/7ab3adc28fa443741eea76625d49c0f1cd93c7b6201b1e270b40d0488e3852cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74797065732d746f6f6e2f74797065732d746f6f6e)](https://camo.githubusercontent.com/7ab3adc28fa443741eea76625d49c0f1cd93c7b6201b1e270b40d0488e3852cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74797065732d746f6f6e2f74797065732d746f6f6e)[![Downloads](https://camo.githubusercontent.com/5f9b7ed4a486a6312070d2a4581d7bf1d112dd41d9150e2b5338e3354c1727eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74797065732d746f6f6e2f74797065732d746f6f6e)](https://camo.githubusercontent.com/5f9b7ed4a486a6312070d2a4581d7bf1d112dd41d9150e2b5338e3354c1727eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74797065732d746f6f6e2f74797065732d746f6f6e)[![License](https://camo.githubusercontent.com/3117c7800f1fc82609c9f9a4be1c9b7c4e221725f827470811a6cb6bdc46f543/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74797065732d746f6f6e2f74797065732d746f6f6e)](https://camo.githubusercontent.com/3117c7800f1fc82609c9f9a4be1c9b7c4e221725f827470811a6cb6bdc46f543/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74797065732d746f6f6e2f74797065732d746f6f6e)

About Types-Toon
----------------

[](#about-types-toon)

TypesToon is a PHP library for manipulating primitive types using a fluent, simple, and chainable API, inspired by modern languages.

Something like
--------------

[](#something-like)

- less verbosity
- more readability
- chained methods
- focus on productivity

Types Supported
---------------

[](#types-supported)

1. string/text
2. array/list
3. number

Get started / install
---------------------

[](#get-started--install)

- require composer
- require php&gt;=8.x

```
composer require types-toon/types-toon
```

Code Examples
-------------

[](#code-examples)

### Array

[](#array)

```
require_once __DIR__."/vendor/autoload.php";

use TypesToon\Toon as type;

$users = [
    [
        'name' => 'John Doe',
        'email' => 'john@example.com',
        'age' => 30,
    ],
    [
        'name' => 'Jane Smith',
        'email' => 'jane@example.com',
        'age' => 25,
    ],
    [
        'name' => 'Alice Johnson',
        'email' => 'alice@example.com',
        'age' => 28,
    ],
];

# declare object the type array
$list = type::Arr($users);

# demonstrate various methods

$list->forEach(function ($user) {

    echo "Name: {$user['name']}, Email: {$user['email']}, Age: {$user['age']}\n";
});

```

#### output

[](#output)

```
Name: John Doe, Email: john@example.com, Age: 30
Name: Jane Smith, Email: jane@example.com, Age: 25
Name: Alice Johnson, Email: alice@example.com, Age: 28
```

---

### String

[](#string)

```
use TypesToon\Toon as type;

require_once __DIR__ . '/../vendor/autoload.php';

# declare object the type string

$text=type::Str("Hello, World!");

# demonstrate various methods

echo "length: ".$text->length()."\n";
echo "upper: ".$text->upper()."\n";
echo "lower: ".$text->lower()."\n";
echo "replace: ".$text->replace("World","PHP")."\n";
echo "substring: ".$text->substring(7,5)."\n";

echo "fluet: ".$text->lower()->replace("hello","hi")->length()."\n";
```

#### output

[](#output-1)

```
length: 13
upper: HELLO, WORLD!
lower: hello, world!
replace: Hello, PHP!
substring: World
fluet: 10
```

---

Number
------

[](#number)

```
use TypesToon\Toon as type;

require_once __DIR__ . '/../vendor/autoload.php';

# declare a Num type

$num = type::Num(400.00);

# demonstrate various methods

echo "Sqrt: " . $num->sqrt() . "\n";
echo "Is Even: " . ($num->isEven() ? 'Yes' : 'No') . "\n";
echo "Is Odd: " . ($num->isOdd() ? 'Yes' : 'No') . "\n";
echo "Absolute Value: " . $num->abs() . "\n";
echo "Rounded Value: " . $num->round() . "\n";
echo "Ceiling Value: " . $num->ceil() . "\n";
echo "Floor Value: " . $num->floor() . "\n";
echo "Formatted Value: " . $num->format(3, '.', ',') . "\n";

echo "Result of complex operations: " . ($num->divide(2)->sqrt()->isEven() ? 'Yes' : 'No') . "\n";

```

#### output

[](#output-2)

```
Sqrt: 20
Is Even: Yes
Is Odd: No
Absolute Value: 400
Rounded Value: 400
Ceiling Value: 400
Floor Value: 400
Formatted Value: 400.000
Result of complex operations: Yes
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance78

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

116d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f034ba707e34401760ccdfcd29b55e8dd70c743bf5028cfd108c194f6f84ed2f?d=identicon)[Pedro Moisés Julieta](/maintainers/Pedro%20Mois%C3%A9s%20Julieta)

---

Top Contributors

[![cceffas](https://avatars.githubusercontent.com/u/163452765?v=4)](https://github.com/cceffas "cceffas (19 commits)")

---

Tags

composer-packagedata-type-libraryfluent-apihelpersphpphp-libraryphp8string-manipulationtypesphparraystringdataobjecttypesfloatmanipulateintbool

### Embed Badge

![Health badge](/badges/types-toon-types-toon/health.svg)

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

###  Alternatives

[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[hi-folks/data-block

Data class for managing nested arrays and JSON data.

1472.2k](/packages/hi-folks-data-block)[michaldudek/foundation

A set of useful PHP classes.

13111.9k13](/packages/michaldudek-foundation)

PHPackages © 2026

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