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

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

trentonmaki/complex-types
=========================

Adds strongly typed lists and maps

1.1.0(10y ago)06[1 PRs](https://github.com/MakiCode/ComplexPrimitiveTypes/pulls)MITPHPPHP ^5.3CI failing

Since Aug 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/MakiCode/ComplexPrimitiveTypes)[ Packagist](https://packagist.org/packages/trentonmaki/complex-types)[ RSS](/packages/trentonmaki-complex-types/feed)WikiDiscussions main Synced 1mo ago

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

ComplexPrimitiveTypes
=====================

[](#complexprimitivetypes)

Complex list and map types for PHP

API
===

[](#api)

The TypedMap and TypedList API support almost the same interface as an Array (see (ArrayObject)\[\] for an example of this) the differences are in the key values these two types allow and the icompatability with the array\_\* functions

Usage
=====

[](#usage)

Simple subclass `TypedList` or `TypedMap` for each kind of list or map you want, then write the `isType()` or `keyType()` and `valueType()` methods.

Example:

```
class StringList extends TypedList
    {

      /**
       * @param mixed $val
       * @return bool
       */
      protected function isType($val)
      {
          return is_string($val);
      }
  }
```

You can now use StringList as you would a normal array. If someone attempts to put a non string in your list, an exception will be thrown immediately.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

3925d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/003e778d56725ae96ef3fe63486ac7dbb7c053070a64eba67c07476567694084?d=identicon)[huulktya](/maintainers/huulktya)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-sap/saprfc-kralik

PHP/SAP implementation for Gregor Kraliks sapnwrfc module. See https://php-sap.github.io for details.

1019.3k](/packages/php-sap-saprfc-kralik)

PHPackages © 2026

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