OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
aws-ses
/
vendor
/
aws
/
aws-sdk-php
/
src
/
Crypto
/
Polyfill
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/14/2024 10:55:07 AM
rwxr-xr-x
📄
AesGcm.php
7.02 KB
08/14/2024 10:55:07 AM
rw-r--r--
📄
ByteArray.php
7.09 KB
08/14/2024 10:55:07 AM
rw-r--r--
📄
Gmac.php
6.37 KB
08/14/2024 10:55:07 AM
rw-r--r--
📄
Key.php
1.76 KB
08/14/2024 10:55:07 AM
rw-r--r--
📄
NeedsTrait.php
1.03 KB
08/14/2024 10:55:07 AM
rw-r--r--
Editing: NeedsTrait.php
Close
<?php namespace Aws\Crypto\Polyfill; use Aws\Exception\CryptoPolyfillException; /** * Trait NeedsTrait */ trait NeedsTrait { /** * 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'); * @param $condition * @param $errorMessage * @param null $exceptionClass */ public static function needs($condition, $errorMessage, $exceptionClass = null) { if (!$condition) { if (!$exceptionClass) { $exceptionClass = CryptoPolyfillException::class; } throw new $exceptionClass($errorMessage); } } }