zlodes / type

PHP Extended Type System • Type

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP Extended Type System • Type

Collection of value objects that represent the types of PHP Extended Type System. Currently, all the types are inspired by popular PHP static analysis tools: Psalm and PHPStan.

All implementations of Type should be treated as sealed, Type interface MUST NOT be implemented in userland! If you need an alias for a complex compound type, extend TypeAlias.

This library will never have any dependencies. Once full and stable, it might be proposed as a PSR or PER.

Installation

composer require extended-type-system/type

Naming

Value objects, representing native PHP types cannot be named after them, because words like Int, Strind etc. are reserved. A suffix might be introduced to fix this problem. Type suffix is too verbose, so we have chosen T: int -> IntT, float -> FloatT. Although types like non-empty-list can be safely named NonEmptyList, for now we have decided to follow the T-convention for all types.

Идеи

  1. Не запрещать Type
  2. Оставить Extended Type System

About

PHP Extended Type System • Type


Languages

Language:PHP 100.0%