PHPackages                             nejcc/php-custom-types - 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. nejcc/php-custom-types

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

nejcc/php-custom-types
======================

A Laravel package providing custom data types like i8, u8, i32, u32, f32, etc.

v1.0.3(1y ago)271MITPHPPHP ^8.1|8.2|8.3

Since Sep 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Nejcc/php-custom-types)[ Packagist](https://packagist.org/packages/nejcc/php-custom-types)[ RSS](/packages/nejcc-php-custom-types/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

PHP Custom Types
================

[](#php-custom-types)

[![Latest Stable Version](https://camo.githubusercontent.com/b83cd074b327d8497e5c4403d5aa6c466e5c8b8dd0f4a05b27e92b56aac35a16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e656a63632f7068702d637573746f6d2d74797065732e737667)](https://packagist.org/packages/nejcc/php-custom-types)[![Total Downloads](https://camo.githubusercontent.com/0cc9ea1f60831c8dee43ad74ef7aa2334010d0c56ddfb90b4a1488a05b2653e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e656a63632f7068702d637573746f6d2d74797065732e737667)](https://packagist.org/packages/nejcc/php-custom-types)[![License](https://camo.githubusercontent.com/1fc0dfc6c0f112d34a5e767045360a5593b1af95bbe1e2690c9e87f5f741fd56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e656a63632f7068702d637573746f6d2d74797065732e737667)](https://packagist.org/packages/nejcc/php-custom-types)

**Nejcc/php-custom-types** is a Laravel package that provides custom data types like `i8`, `u8`, `i32`, `u32`, `f32`, and more. These custom types help enforce data integrity, memory efficiency, and validation constraints in your Laravel applications.

Features
--------

[](#features)

- **Custom Integer Types**: `i8`, `u8`, `i32`, `u32`
- **Custom Floating Point Type**: `f32`
- **Custom String Type**: `Utf8String`
- **Tuple and Array Types**: `Pair`, `FixedArray`
- **Easy Integration**: Designed to work seamlessly with Laravel.
- **PHP 8.3 Compatibility**: Leverages the latest PHP features for performance and security.

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

[](#installation)

To install the package, use Composer:

```
composer require nejcc/php-custom-types
```

Tree
----

[](#tree)

```
CustomTypes
├── Scalar Types
│   ├── Integer Types
│   │   ├── Signed Integers
│   │   │   ├── i8    (8-bit signed)
│   │   │   ├── i16   (16-bit signed)
│   │   │   ├── i32   (32-bit signed)
│   │   │   ├── i64   (64-bit signed)
│   │   │   └── i128  (128-bit signed)
│   │   └── Unsigned Integers
│   │       ├── u8    (8-bit unsigned)
│   │       ├── u16   (16-bit unsigned)
│   │       ├── u32   (32-bit unsigned)
│   │       ├── u64   (64-bit unsigned)
│   │       └── u128  (128-bit unsigned)
│   ├── Floating-Point Types
│   │   ├── f16       (16-bit floating-point)
│   │   ├── f32       (32-bit floating-point)
│   │   ├── f64       (64-bit floating-point)
│   │   └── f128      (128-bit floating-point)
│   ├── Character Type
│   │   └── Char      (Single Unicode character)
│   └── Boolean Type
│       └── Bool      (Boolean, true or false)
├── Compound Types
│   ├── Tuple
│   │   └── Tuple (Fixed-size collection of heterogeneous values)
│   └── FixedArray
│       └── FixedArray (Fixed-size collection of homogeneous values)
├── String Types
│   ├── StrSlice      (Immutable string slice)
│   └── OwnedString   (Owned, mutable string)
├── Collection Types
│   ├── Vec           (Growable array type)
│   ├── HashMap       (Key-value store)
│   └── HashSet       (Unordered collection of unique values)
├── Custom Types
│   ├── Structs
│   │   └── ExampleStruct (Custom user-defined data structures)
│   └── Enums
│       └── ExampleEnum (Custom enumerations)
├── Smart Pointer Types
│   ├── Box           (Single ownership heap allocation)
│   ├── Rc            (Reference counted pointer)
│   ├── RefCell       (Single-threaded interior mutability)
│   └── Mutex         (Thread-safe interior mutability)
└── Other Types
    ├── Unit          (Represents an empty value or no value)
    └── PhantomData   (Marker for unused generic type parameters)

```

Usage
-----

[](#usage)

### Custom Integer Types

[](#custom-integer-types)

#### `i32` (32-bit Signed Integer)

[](#i32-32-bit-signed-integer)

```
use Nejcc\CustomTypes\ScalarTypes\Integers\Signed\i32;

$number = new i32(123456);
echo $number->getValue(); // Output: 123456
```

Running Tests
-------------

[](#running-tests)

To run the unit tests for this package, ensure that you have PHPUnit installed and run:

```
./vendor/bin/phpunit
```

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.4% 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 ~0 days

Total

4

Last Release

615d ago

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

v1.0.1PHP 8.2|8.3

v1.0.2PHP ^8.1|8.2|8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e4629de002c40aef796e5b320091892f0b7b35b62497260c52cef3eb721eed1?d=identicon)[Nejcc](/maintainers/Nejcc)

---

Top Contributors

[![Nejcc](https://avatars.githubusercontent.com/u/6236128?v=4)](https://github.com/Nejcc "Nejcc (14 commits)")[![nejcdev](https://avatars.githubusercontent.com/u/66303179?v=4)](https://github.com/nejcdev "nejcdev (3 commits)")

---

Tags

laravellibrarymit-licensepackagephp8unittest

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nejcc-php-custom-types/health.svg)

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

###  Alternatives

[zzstudio/think-addons

The ThinkPHP6 Addons Package

1518.6k](/packages/zzstudio-think-addons)

PHPackages © 2026

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