PHPackages                             doctrineum/strict-string - 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. doctrineum/strict-string

Abandoned → [doctrineum/scalar](/?search=doctrineum%2Fscalar)Library[Utility &amp; Helpers](/categories/utility)

doctrineum/strict-string
========================

Enumeration type for Doctrine - strings only

2.1.1(10y ago)0494MITPHPPHP &gt;=5.5

Since May 11Pushed 10y ago1 watchersCompare

[ Source](https://github.com/doctrineum/doctrineum-strict-string)[ Packagist](https://packagist.org/packages/doctrineum/strict-string)[ RSS](/packages/doctrineum-strict-string/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (8)Used By (0)

[![Build Status](https://camo.githubusercontent.com/8ebdac998734e9d6d8b3ac346ad347fde84ea2e5f2e193e35026ec689b931ecf/68747470733a2f2f7472617669732d63692e6f72672f6a61726f736c61767479632f646f637472696e65756d2d7374726963742d737472696e672e737667)](https://travis-ci.org/jaroslavtyc/doctrineum-strict-string)

About
=====

[](#about)

[Doctrine](http://www.doctrine-project.org/) [enum](http://en.wikipedia.org/wiki/Enumerated_type) allowing strings only.

### Example

[](#example)

```
$stringEnum = StrictStringEnum::getEnum('foo bar');

$stringEnum = StrictStringEnum::getEnum('12345');

// throws an exception - only string is allowed
$stringEnum = StrictStringEnum::getEnum('');

// throws an exception - only string is allowed
StrictStringEnum::getEnum(12);

// throws an exception - only string is allowed
StrictStringEnum::getEnum(false);

// throws an exception - only string is allowed
StrictStringEnum::getEnum(null);

// throws an exception - only string is allowed
StrictStringEnum::getEnum(new ObjectWithToStringMethod('foo'));
```

Doctrine integration
====================

[](#doctrine-integration)

For details about new Doctrine type registration, see the parent project [Doctrineum](https://github.com/jaroslavtyc/doctrineum).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~14 days

Total

7

Last Release

3941d ago

Major Versions

1.0.x-dev → 2.0.02015-07-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e35d11c9a75584084f0dc0ba1a3b6ff03355777809cbe8eabd20a88ac00f794?d=identicon)[jaroslavtyc](/maintainers/jaroslavtyc)

---

Top Contributors

[![jaroslavtyc](https://avatars.githubusercontent.com/u/2290225?v=4)](https://github.com/jaroslavtyc "jaroslavtyc (45 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/doctrineum-strict-string/health.svg)

```
[![Health](https://phpackages.com/badges/doctrineum-strict-string/health.svg)](https://phpackages.com/packages/doctrineum-strict-string)
```

###  Alternatives

[symfony/polyfill-php83

Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions

431292.0M168](/packages/symfony-polyfill-php83)[wp-sync-db/wp-sync-db-cli

WP Sync DB CLI Addon

9252.8k](/packages/wp-sync-db-wp-sync-db-cli)

PHPackages © 2026

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