PHPackages                             tessera-php/tessera-type-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. tessera-php/tessera-type-string

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

tessera-php/tessera-type-string
===============================

Tessera type: String

06PHP

Since Feb 23Pushed 2mo agoCompare

[ Source](https://github.com/tessera-php/tessera-type-string)[ Packagist](https://packagist.org/packages/tessera-php/tessera-type-string)[ RSS](/packages/tessera-php-tessera-type-string/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Tessera Type: String
====================

[](#tessera-type-string)

Строковый тип для Tessera.

Установка
---------

[](#установка)

```
composer require tessera-php/tessera-type-string
```

Использование
-------------

[](#использование)

```
use Tessera\Type\String\StringType;
use Tessera\Type\String\StringData;

$type = new StringType();

// Валидация
$type->validate('hello');     // true
$type->validate('');          // true
$type->validate(42);          // true
$type->validate(3.14);        // true
$type->validate(true);        // true
$type->validate(null);        // true
$type->validate(['a']);       // false

// Нормализация
$data = $type->normalize(42);
echo $data->value;            // '42' (string)

$data = $type->normalize(true);
echo $data->value;            // '1'

$data = $type->normalize(false);
echo $data->value;            // '0'

$data = $type->normalize(null);
echo $data->value;            // '' (пустая строка)

// DTO
$data = new StringData('hello');
echo $data->value;            // 'hello'
```

Принимаемые форматы
-------------------

[](#принимаемые-форматы)

- `string` — нативная строка
- `int` — целое число (приводится к строке)
- `float` — число с плавающей точкой (приводится к строке)
- `bool` — булево значение (приводится к '1' или '0')
- `null` — null (приводится к пустой строке)

Контракт
--------

[](#контракт)

`provide: tessera-contract-type/string`

Лицензия
--------

[](#лицензия)

MIT

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance60

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e78f325d4580bbfe722ff05052308109007ad43dc95ff8c07de870d843b54adc?d=identicon)[targrik](/maintainers/targrik)

---

Top Contributors

[![targrik](https://avatars.githubusercontent.com/u/6997825?v=4)](https://github.com/targrik "targrik (2 commits)")

### Embed Badge

![Health badge](/badges/tessera-php-tessera-type-string/health.svg)

```
[![Health](https://phpackages.com/badges/tessera-php-tessera-type-string/health.svg)](https://phpackages.com/packages/tessera-php-tessera-type-string)
```

###  Alternatives

[froiden/laravel-installer

Laravel web installer

10883.9k](/packages/froiden-laravel-installer)

PHPackages © 2026

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