PHPackages                             nexusphp/assert - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. nexusphp/assert

ActiveLibrary[Testing &amp; Quality](/categories/testing)

nexusphp/assert
===============

Chainable type-safety assertions library.

v1.0.0(1mo ago)022↓100%MITPHPPHP ^8.2CI passing

Since Mar 14Pushed 1mo agoCompare

[ Source](https://github.com/NexusPHP/assert)[ Packagist](https://packagist.org/packages/nexusphp/assert)[ RSS](/packages/nexusphp-assert/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (4)Used By (0)

Nexus Assert
============

[](#nexus-assert)

[![Unit Tests](https://github.com/NexusPHP/assert/actions/workflows/unit-tests.yml/badge.svg?branch=1.x)](https://github.com/NexusPHP/assert/actions/workflows/unit-tests.yml)[![Static Code Analysis](https://github.com/NexusPHP/assert/actions/workflows/static-code-analysis.yml/badge.svg?branch=1.x)](https://github.com/NexusPHP/assert/actions/workflows/static-code-analysis.yml)[![Latest Release](https://camo.githubusercontent.com/dc22e0129ac1a373aa0b6b301a1a44b59dfc8948fe87e9ea137cc20378313d19/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f4e657875735048502f6173736572743f6c6162656c3d6c6174657374)](https://github.com/NexusPHP/assert/releases)[![Packagist Version](https://camo.githubusercontent.com/f071756899dfd5f93eea3cfb6e89d4b02f043ff823f856130bae42985e02d707/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e657875737068702f6173736572742e737667)](https://packagist.org/packages/nexusphp/assert)[![PHP Version](https://camo.githubusercontent.com/10de9760de51d7c1d33f53680cf28f4d5459731b83bc21f147258334a92a7a09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6e657875737068702f6173736572742e737667)](https://packagist.org/packages/nexusphp/assert)

This library provides efficient type assertions for input validation in a chainable, fluent, natural language way. This also provides static analysis support ensuring [PHPStan](https://phpstan.org)can understand the asserted type.

Installation
------------

[](#installation)

```
composer require nexusphp/assert

```

Installing the PHPStan extension
--------------------------------

[](#installing-the-phpstan-extension)

You're all set if you are using [phpstan/extension-installer](https://github.com/phpstan/extension-installer).

 Manual installationIf you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:

```
includes:
    - vendor/nexusphp/assert/extension.neon

```

Usage
-----

[](#usage)

Use the static `that()` method of `Nexus\Assert\Assert` to start chaining expectations.

```
