Trait NeedsTrait
Trait NeedsTrait
Direct Known Users
Aws\Crypto\Polyfill\AesGcm
,
Aws\Crypto\Polyfill\ByteArray
,
Aws\Crypto\Polyfill\Gmac
Methods Summary
-
static
needs ( $condition, $errorMessage, null $exceptionClass = null )
Preconditions, postconditions, and loop invariants are very useful for safe programing. They also document the specifications. This function is to help simplify the semantic burden of parsing these constructions.
Methods Details
static needs ( $condition, $errorMessage, null $exceptionClass = null )
Preconditions, postconditions, and loop invariants are very useful for safe programing. They also document the specifications. This function is to help simplify the semantic burden of parsing these constructions.
Instead of constructions like if (!(GOOD CONDITION)) { throw new \Exception('condition not true'); }
you can write: needs(GOOD CONDITION, 'condition not true');
Parameters
$condition | ||
$errorMessage | ||
null | $exceptionClass = null |