Registry / utility / webmozart-assert

webmozart-assert

JSON →
library2.4.1phppackagistunverified

A PHP library for validating method inputs and outputs with descriptive error messages.

composer require webmozart/assert
INSTALL
IMPORT
SIG · WEBMOZART-ASSERT
W
webmozart-assert
utilityphpv2.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Assert
✓ use Webmozart\Assert\Assert;

Validate that a divisor is not zero.

use Webmozart\Assert\Assert; function divide(int $a, int $b): float { Assert::notEq($b, 0, 'Division by zero is not allowed.'); return $a / $b; } echo divide(10, 2); // 5
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.4.1latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
webmozart-assert — pip install webmozart-assert · libregistry