Skip to content

php-type-language/dev

Repository files navigation


TypeLang is a declarative type language inspired by static analyzers like PHPStan and Psalm. It describes the type syntax found in PHPDoc comments (int[], array<string, T>, Foo::CONST_*, T is U ? A : B, ...) and provides a set of components to work with it.

This is the development monorepo for all TypeLang components. Each package listed below is also published as a standalone, read-only repository via git subtree split.

Packages

Package Description Tests
type-lang/types AST node classes (TypeLang\Type\*) — the shared vocabulary of the ecosystem. Tests
type-lang/parser Parses TypeLang syntax into an AST, validating the grammar. Tests
type-lang/printer Renders AST nodes back into their string representation. Tests
type-lang/reader Builds AST nodes from types exposed by PHP Reflection objects. Tests
type-lang/phpdoc Parses /** ... */ DocBlock comments into a graph of description and tags. Tests

Development

This repository contains all components together. Changes are contributed here and then split into the individual read-only package repositories.

git clone https://github.com/php-type-language/dev.git
cd dev
composer install

Common tasks:

composer test:unit     # run the PHPUnit test suite
composer linter:check  # run PHPStan static analysis
composer phpcs:check   # check the code style (php-cs-fixer, dry-run)
composer phpcs:fix     # apply the code style fixes

License

TypeLang is licensed under the MIT License.

About

A monorepo with core development packages

Resources

License

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages