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

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

jessegall/php-types
===================

Named typed constants and predicates — give meaning to magic literals like '', \[\], '{}', 0, true and null.

v1.0.1(today)00MITPHPPHP ^8.2

Since Jun 13Pushed todayCompare

[ Source](https://github.com/jessegall/php-types)[ Packagist](https://packagist.org/packages/jessegall/php-types)[ RSS](/packages/jessegall-php-types/feed)WikiDiscussions main Synced today

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

php-types
=========

[](#php-types)

Named typed constants and predicates — give meaning to magic literals.

A raw `''`, `[]`, `'{}'`, `0`, `true`, or `null` carries an unstated intent and gets re-checked defensively all over a codebase (`if ($this->delimiter === '')`). These tiny static classes give that intent a name and the check a single home.

```
use JesseGall\PhpTypes\T_String;

$prefix = T_String::empty();              // '' with a name
if (T_String::isEmpty($delimiter)) { … }  // reads as intent

// as a first-class callable
$nonEmpty = array_filter($parts, T_String::isNotEmpty(...));
```

Types
-----

[](#types)

ClassConstant(s)FactoryPredicates`T_String``EMPTY`, `SPACE`, `NEWLINE`, `PARAGRAPH`, `CARRIAGE_RETURN`, `CRLF`, `TAB`, `NULL_BYTE`, `COMMA`, `COMMA_SPACE`, `SLASH`, `DOT`, `DASH``empty()``isEmpty()`, `isNotEmpty()`, `isBlank()`, `isNotBlank()``T_Array``EMPTY`, `MATRIX``empty()`, `matrix()``isEmpty()`, `isNotEmpty()``T_Json``EMPTY_OBJECT`, `EMPTY_ARRAY``emptyObject()`, `emptyArray()``isEmptyObject()`, `isEmptyArray()``T_Int``ZERO`, `ONE`, `MINUS_ONE``zero()``isZero()`, `isNotZero()``T_Float``ZERO``zero()``isZero()`, `isNotZero()``T_Bool``TRUE`, `FALSE`—`isTrue()`, `isFalse()``T_Null`——`isNull()`, `isNotNull()``T_Json` predicates are semantic — `isEmptyObject('{ }')` and `isEmptyObject("{\n}")`are `true` (they decode to an empty object), while `isEmptyObject('[]')` and invalid JSON are `false`.

Install
-------

[](#install)

```
composer require jessegall/php-types
```

Requires PHP 8.2+. Zero runtime dependencies.

Test
----

[](#test)

```
composer test
```

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

2

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a13b52a17e71644445ec3597dc1c8faf54ebd8b6b087e219c672aae06ac5332?d=identicon)[JesseGall](/maintainers/JesseGall)

---

Tags

phpvalue objectsconstantstypespredicates

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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