OpenProviderライブラリ

This commit is contained in:
2026-04-24 23:28:20 +09:00
parent 7492790a9c
commit f0f75124ee
7 changed files with 438 additions and 9 deletions

View File

@@ -268,6 +268,13 @@ function randstr(): string {
return bin2hex(random_bytes($len));
}
function assert_exists(mixed $assertion, Throwable|string|null $description = null): bool {
if (ini_get('zend.assertions') < 1) trigger_error('assert機能性が無効です。有効するには、php.iniで「zend.assertions = 1」に設定して下さい。', E_USER_WARNING);
if (isset($assertion)) return true;
assert(false, $description ?? 'Assertion failed: value is not null');
return false;
}
function assert_null(mixed $assertion, Throwable|string|null $description = null): bool {
if (ini_get('zend.assertions') < 1) trigger_error('assert機能性が無効です。有効するには、php.iniで「zend.assertions = 1」に設定して下さい。', E_USER_WARNING);
if (is_null($assertion)) return true;