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

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

tessera-php/tessera-type-bool
=============================

Tessera type: Boolean

06PHP

Since Feb 23Pushed 2mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Tessera Type: Bool
==================

[](#tessera-type-bool)

Булев тип для Tessera.

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

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

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

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

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

```
use Tessera\Type\Bool\BoolType;
use Tessera\Type\Bool\BoolData;

$type = new BoolType();

// Валидация
$type->validate(true);      // true
$type->validate('true');    // true
$type->validate('yes');     // true
$type->validate('on');      // true
$type->validate(1);         // true
$type->validate('1');       // true
$type->validate('abc');     // false
$type->validate(2);         // false

// Нормализация
$data = $type->normalize('yes');
echo $data->value ? 'true' : 'false';  // true (bool)

// DTO
$data = new BoolData(true);
echo $data->value ? 'true' : 'false';  // true
```

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

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

### Значения true

[](#значения-true)

- `true` — булево true
- `1` — целое число 1
- `'1'` — строка "1"
- `'true'` — строка (регистронезависимо)
- `'yes'` — строка (регистронезависимо)
- `'on'` — строка (регистронезависимо)

### Значения false

[](#значения-false)

- `false` — булево false
- `0` — целое число 0
- `'0'` — строка "0"
- `'false'` — строка (регистронезависимо)
- `'no'` — строка (регистронезависимо)
- `'off'` — строка (регистронезависимо)

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

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

`provide: tessera-contract-type/bool`

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

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

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance56

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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-bool/health.svg)

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

PHPackages © 2026

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