New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

tessera-php/tessera-type-int

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tessera-php/tessera-type-int

Tessera type: Integer

Source
Packagist
Version
dev-main
Version published
Total downloads
8
Maintainers
0
Created
Source

Tessera Type: Int

Целочисленный тип для Tessera.

Установка

composer require tessera-php/tessera-type-int

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

use Tessera\Type\Int\IntType;
use Tessera\Type\Int\IntData;

$type = new IntType();

// Валидация
$type->validate(42);        // true
$type->validate('42');      // true
$type->validate(42.0);      // true (float без дробной части)
$type->validate(3.14);      // false
$type->validate('abc');     // false

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

// DTO
$data = new IntData(123);
echo $data->value;          // 123

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

  • int — нативное целое число
  • bool — булево значение (приводится к 0 или 1)
  • string — числовая строка ('42', '-10', '+5')
  • float — только без дробной части (42.0, -10.0)

Контракт

provide: tessera-contract-type/int

Лицензия

MIT

FAQs

Package last updated on 23 Feb 2026

Related posts