PHPackages                             savinmikhail/primitive\_wrappers - 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. savinmikhail/primitive\_wrappers

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

savinmikhail/primitive\_wrappers
================================

The object wrappers and static helpers for php primitive types

v1.2.0(1y ago)19911MITPHPPHP &gt;=7.4

Since May 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/savinmikhail/primitive_wrappers)[ Packagist](https://packagist.org/packages/savinmikhail/primitive_wrappers)[ RSS](/packages/savinmikhail-primitive-wrappers/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (5)Used By (1)

 [ ![EO principles respected here](https://camo.githubusercontent.com/5c7a27b75a8da4be52680df944abec4ccc4d0151df036e0793b8c9b16cbe3d1e/68747470733a2f2f7777772e656c6567616e746f626a656374732e6f72672f62616467652e737667) ](https://www.elegantobjects.org) [ ![Code Coverage](https://camo.githubusercontent.com/35faab64e17b817d1f1e20c9906e3e4844009578f1184e21d7cb82e1ee56e444/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736176696e6d696b6861696c2f7072696d69746976655f77726170706572732f6261646765732f636f7665726167652e706e673f623d6d61696e) ](https://scrutinizer-ci.com/g/savinmikhail/primitive_wrappers/?branch=main) [ ![Quality Score](https://camo.githubusercontent.com/b702fcb88f61c0c0944d32fbf06547027c0f0fecfea584401072bcb3f7a746b9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736176696e6d696b6861696c2f7072696d69746976655f77726170706572732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e) ](https://scrutinizer-ci.com/g/savinmikhail/primitive_wrappers/?branch=main)

Object-Oriented Primitive Wrappers
==================================

[](#object-oriented-primitive-wrappers)

This PHP library provides object-oriented wrappers for primitive data types, aiming to improve code readability, maintainability, and error handling compared to traditional procedural approaches.

Worth to mention, that some other programming languages like Java, Python etc have it built-in.

Features
--------

[](#features)

- **Object-Oriented Design**: The library offers object-oriented wrappers for primitive types, allowing developers to work with primitives in a less imperative style.
- **Enhanced Error Handling**: The library provides more robust error handling mechanisms, so you don't have to remember to check whether some `json_decode` returned false, or null, or empty string, or threw Error or Exception.
- **Improved Readability**: Clear and descriptive method names enhance code readability and maintainability, so you don't have to worry whether function calls `str_split` or `strSplit` or `split`. Either to remember what some `strpbrk` mean
- **Advanced Methods**: You can convert cases (e.g. from camel to snake) fluently, or get words from a string, and many more!

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

[](#installation)

Run

`composer require savinmikhail/primitive_wrappers`

Example Usage
-------------

[](#example-usage)

```
use Mikhail\PrimitiveWrappers\Str;

// Create a string wrapper
$str = new Str('Hello, world!');

// Get the length of the string
$length = $str->length();

// Use methods as a builder
$lowercaseCapitalized = $str->toLower()->capitalize();

//use some more advanced methods
$snake = (new Str('Lorem ipsum dolor sit amet'))->snake(); //lorem_ipsum_dolor_sit_amet
```

Similar projects
----------------

[](#similar-projects)

[Symfony string](https://github.com/symfony/symfony/blob/7.0/src/Symfony/Component/String/UnicodeString.php)

[Illuminate Str](https://github.com/laravel/framework/blob/9.x/src/Illuminate/Support/Str.php)

[Primitive objects](https://github.com/dobryakov/php-primitive-objects)

Contributing
------------

[](#contributing)

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on GitHub.

License
-------

[](#license)

This library is released under the [MIT license](LICENSE).

---

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

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

Every ~20 days

Total

3

Last Release

687d ago

PHP version history (2 changes)v1.0.0PHP &gt;=8.2

v1.2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/b875f06f4a5b59fb1c051d348aee7c06c32fa04277ac9dfef77a1f01a72ebc87?d=identicon)[Savin Mikhail](/maintainers/Savin%20Mikhail)

---

Top Contributors

[![savinmikhail](https://avatars.githubusercontent.com/u/99592925?v=4)](https://github.com/savinmikhail "savinmikhail (70 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/savinmikhail-primitive-wrappers/health.svg)

```
[![Health](https://phpackages.com/badges/savinmikhail-primitive-wrappers/health.svg)](https://phpackages.com/packages/savinmikhail-primitive-wrappers)
```

###  Alternatives

[rohitkundale/order-comment

Allows customer to add a special note/message/comment or instruction while placing an order

209.9k](/packages/rohitkundale-order-comment)[aurorawebsoftware/acalendar

This is my package acalendar

241.0k2](/packages/aurorawebsoftware-acalendar)

PHPackages © 2026

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