PHPackages                             decodelabs/tightrope - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. decodelabs/tightrope

AbandonedArchivedLibrary[Validation &amp; Sanitization](/categories/validation)

decodelabs/tightrope
====================

Reusable constraints for your PHP classes

v0.2.0(1y ago)220.9k1MITPHPPHP ^8.4

Since Aug 30Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/decodelabs/tightrope)[ Packagist](https://packagist.org/packages/decodelabs/tightrope)[ RSS](/packages/decodelabs-tightrope/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (6)Used By (1)

Tightrope
=========

[](#tightrope)

[![PHP from Packagist](https://camo.githubusercontent.com/d2aa2d1c8147500bafde7b988875efc26b3e1f2aa7338628c7551553ffd29b65/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6465636f64656c6162732f7469676874726f70653f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/tightrope)[![Latest Version](https://camo.githubusercontent.com/3870637912d39236793f24a43b551cc24d26e6b4d93c7e907401e72ddb9f6b33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465636f64656c6162732f7469676874726f70652e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/tightrope)[![Total Downloads](https://camo.githubusercontent.com/f0c4c696c3baede8faa41d9b8cd354610d58f073488b04898ddba8e6c007e89b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465636f64656c6162732f7469676874726f70652e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/tightrope)[![GitHub Workflow Status](https://camo.githubusercontent.com/0e3d27fccf32680ae5c070957ba6bea0b43c080da7e5de8f366fc70000849755/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465636f64656c6162732f7469676874726f70652f696e746567726174652e796d6c3f6272616e63683d646576656c6f70)](https://github.com/decodelabs/tightrope/actions/workflows/integrate.yml)[![PHPStan](https://camo.githubusercontent.com/e25c14ce011edabdd0fbd2e10415b41cc5d66ed11ef3e5b7edd074c5bdd35a2d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d3434434331312e7376673f6c6f6e6743616368653d74727565267374796c653d666c6174)](https://github.com/phpstan/phpstan)[![License](https://camo.githubusercontent.com/0f61f13820419c0599e6e89b7a1dddada7b7eac43aadeb8cca201c3388c80166/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465636f64656c6162732f7469676874726f70653f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/tightrope)

### Reusable constraints for your PHP classes.

[](#reusable-constraints-for-your-php-classes)

**Note**: With the introduction of properties in PHP8.4, the need for Tightrope has diminished. This package is now deprecated and will not be maintained. You can use the built-in property types and visibility modifiers to achieve similar functionality, without methods.

---

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

[](#installation)

```
composer require decodelabs/tightrope
```

Usage
-----

[](#usage)

Tightrope defines a number of reusable interfaces that represent a property of an object, such as being disableable, readable or requirable:

```
namespace DecodeLabs\Tightrope;

interface Nullable {
    public function isNullable(): bool;
}
```

It also supplies a *manifest* version of each interface along with a trait implementation:

```
namespace DecodeLabs\Tightrope\Manifest;

use DecodeLabs\Tightrope\Nullable as StaticNullable;

interface Nullable extends StaticNullable {
    public function setNullable(bool $flag): static;
}
```

You can use these interfaces to define properties of your objects:

```
namespace My\Project;

use DecodeLabs\Exceptional;
use DecodeLabs\Tightrope\Manifest\Nullable;
use DecodeLabs\Tightrope\Manifest\NullableTrait;

class MyClass implements Nullable {

    use NullableTrait;

    public function doSomething(?string $value): void {
        if(
            !$this->isNullable() &&
            $value === null
        ) {
            throw Exceptional::InvalidArgument(
                message: 'Value cannot be null'
            );
        }

        // ...
    }
}

$myObject = new MyClass();

$myObject->setNullable(true);
$myObject->doSomething(null); // Fine

$myObject->setNullable(false);
$myObject->doSomething(null); // Not fine
```

Available properties
--------------------

[](#available-properties)

The following interfaces are currently available:

- Disableable
- Immutable
- Nullable
- Readable
- ReadOnlyable
- Requirable
- Writable

Licensing
---------

[](#licensing)

Tightrope is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance47

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~298 days

Total

4

Last Release

453d ago

PHP version history (2 changes)v0.1.0PHP ^8.0

v0.2.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a241d64d12b3b5ee94197862ec1ec30b82ed2efa34a0cd7f4c3565a021daddd?d=identicon)[betterthanclay](/maintainers/betterthanclay)

---

Top Contributors

[![betterthanclay](https://avatars.githubusercontent.com/u/1273586?v=4)](https://github.com/betterthanclay "betterthanclay (41 commits)")

---

Tags

constraintsphpinterfaceconstraint

### Embed Badge

![Health badge](/badges/decodelabs-tightrope/health.svg)

```
[![Health](https://phpackages.com/badges/decodelabs-tightrope/health.svg)](https://phpackages.com/packages/decodelabs-tightrope)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[barbieswimcrew/zip-code-validator

Constraint class for international zipcode validation

772.3M](/packages/barbieswimcrew-zip-code-validator)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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