Add new class for auto set vars to certain types or null

Convert\VarSetType for always return type expected (eg string will be string)
or Convert\VarSetTypeNull to return string or null on failure

The return value for failure if not matching type can be set for both, but
only for Convert\VarSetTypeNull the return value can be set to null.
This commit is contained in:
Clemens Schwaighofer
2023-02-08 12:12:46 +09:00
parent f94b350ba4
commit efaf426c55
16 changed files with 2012 additions and 66 deletions

View File

@@ -0,0 +1,652 @@
<?php // phpcs:disable Generic.Files.LineLength
declare(strict_types=1);
namespace tests;
use PHPUnit\Framework\TestCase;
use CoreLibs\Convert\VarSetTypeNull;
/**
* Test class for Convert\Strings
* @coversDefaultClass \CoreLibs\Convert\VarSetTypeNull
* @testdox \CoreLibs\Convert\VarSetTypeNull method tests
*/
final class CoreLibsConvertVarSetTypeNullTest extends TestCase
{
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeStringProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'empty string' => [
'',
null,
''
],
'filled string' => [
'string',
null,
'string'
],
'valid string, override set' => [
'string',
'override',
'string'
],
'int, no override' => [
1,
null,
null
],
'int, override set' => [
1,
'not int',
'not int'
]
];
}
/**
* Undocumented function
* @covers ::setStr
* @dataProvider varSetTypeStringProvider
* @testdox setStr $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param string|null $default
* @param string|null $expected
* @return void
*/
public function testSetString(mixed $input, ?string $default, ?string $expected): void
{
$set_var = VarSetTypeNull::setStr($input, $default);
if ($expected !== null) {
$this->assertIsString($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varMakeTypeStringProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'empty string' => [
'',
null,
''
],
'filled string' => [
'string',
null,
'string'
],
'valid string, override set' => [
'string',
'override',
'string'
],
'int, no override' => [
1,
null,
'1'
],
'int, override set' => [
1,
'not int',
'1'
],
'float, no override' => [
1.5,
null,
'1.5'
],
// all the strange things here
'function, override set' => [
$foo = function () {
return '';
},
'function',
'function'
],
'function, no override' => [
$foo = function () {
return '';
},
null,
null
],
'hex value, override set' => [
0x55,
'hex',
'85'
]
];
}
/**
* Undocumented function
* @covers ::makeStr
* @dataProvider varMakeTypeStringProvider
* @testdox makeStr $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param string|null $default
* @param string|null $expected
* @return void
*/
public function testMakeString(mixed $input, ?string $default, ?string $expected): void
{
$set_var = VarSetTypeNull::makeStr($input, $default);
if ($expected !== null) {
$this->assertIsString($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeIntProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'int' => [
1,
null,
1
],
'int, override set' => [
1,
-1,
1
],
'string, no override' => [
'string',
null,
null
],
'string, override' => [
'string',
-1,
-1
],
'float' => [
1.5,
null,
null
]
];
}
/**
* Undocumented function
* @covers ::setInt
* @dataProvider varSetTypeIntProvider
* @testdox setInt $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param int|null $default
* @param int|null $expected
* @return void
*/
public function testSetInt(mixed $input, ?int $default, ?int $expected): void
{
$set_var = VarSetTypeNull::setInt($input, $default);
if ($expected !== null) {
$this->assertIsInt($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varMakeTypeIntProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'int' => [
1,
null,
1
],
'int, override set' => [
1,
-1,
1
],
'string, no override' => [
'string',
null,
0
],
'string, override' => [
'string',
-1,
0
],
'float' => [
1.5,
null,
1
],
// all the strange things here
'function, override set' => [
$foo = function () {
return '';
},
-1,
-1
],
'function, no override ' => [
$foo = function () {
return '';
},
null,
null
],
'hex value, override set' => [
0x55,
-1,
85
],
];
}
/**
* Undocumented function
* @covers ::makeInt
* @dataProvider varMakeTypeIntProvider
* @testdox makeInt $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param int|null $default
* @param int|null $expected
* @return void
*/
public function testMakeInt(mixed $input, ?int $default, ?int $expected): void
{
$set_var = VarSetTypeNull::makeInt($input, $default);
if ($expected !== null) {
$this->assertIsInt($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeFloatProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'float' => [
1.5,
null,
1.5
],
'float, override set' => [
1.5,
-1.5,
1.5
],
'string, no override' => [
'string',
null,
null
],
'string, override' => [
'string',
1.5,
1.5
],
'int' => [
1,
null,
null
]
];
}
/**
* Undocumented function
* @covers ::setFloat
* @dataProvider varSetTypeFloatProvider
* @testdox setFloat $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param float|null $default
* @param float|null $expected
* @return void
*/
public function testSetFloat(mixed $input, ?float $default, ?float $expected): void
{
$set_var = VarSetTypeNull::setFloat($input, $default);
if ($expected !== null) {
$this->assertIsFloat($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varMakeTypeFloatProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'float' => [
1.5,
null,
1.5
],
'float, override set' => [
1.5,
-1.5,
1.5
],
'string, no override' => [
'string',
null,
0.0
],
'string, override' => [
'string',
1.5,
0.0
],
'int' => [
1,
null,
1.0
],
// all the strange things here
'function, override set' => [
$foo = function () {
return '';
},
-1.0,
-1.0
],
// all the strange things here
'function, no override' => [
$foo = function () {
return '';
},
null,
null
],
'hex value, override set' => [
0x55,
-1,
85.0
],
];
}
/**
* Undocumented function
* @covers ::makeFloat
* @dataProvider varMakeTypeFloatProvider
* @testdox makeFloat $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param float|null $default
* @param float|null $expected
* @return void
*/
public function testMakeFloat(mixed $input, ?float $default, ?float $expected): void
{
$set_var = VarSetTypeNull::makeFloat($input, $default);
if ($expected !== null) {
$this->assertIsFloat($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeArrayProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'array, empty' => [
[],
null,
[]
],
'array, filled' => [
['array'],
null,
['array']
],
'string, no override' => [
'string',
null,
null
],
'string, override' => [
'string',
['string'],
['string']
]
];
}
/**
* Undocumented function
* @covers ::setArray
* @dataProvider varSetTypeArrayProvider
* @testdox setArray $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param array|null $default
* @param array|null $expected
* @return void
*/
public function testSetArray(mixed $input, ?array $default, ?array $expected): void
{
$set_var = VarSetTypeNull::setArray($input, $default);
if ($expected !== null) {
$this->assertIsArray($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeBoolProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'bool true' => [
true,
null,
true
],
'bool false' => [
false,
null,
false
],
'string, no override' => [
'string',
null,
null
],
'string, override' => [
'string',
true,
true
]
];
}
/**
* Undocumented function
* @covers ::setBool
* @dataProvider varSetTypeBoolProvider
* @testdox setBool $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param bool|null $default
* @param bool|null $expected
* @return void
*/
public function testSetBool(mixed $input, ?bool $default, ?bool $expected): void
{
$set_var = VarSetTypeNull::setBool($input, $default);
if ($expected !== null) {
$this->assertIsBool($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varMakeTypeBoolProvider(): array
{
// 0: input
// 2: expected
return [
'true' => [
true,
true
],
'false' => [
false,
false
],
'string on' => [
'on',
true
],
'string off' => [
'off',
false
],
'invalid string' => [
'sulzenbacher',
null,
],
'invalid string, override' => [
'sulzenbacher',
null,
],
'array to default' => [
[],
false
],
];
}
/**
* Undocumented function
* @covers ::setBool
* @dataProvider varMakeTypeBoolProvider
* @testdox setBool $input will be $expected [$_dataName]
*
* @param mixed $input
* @param bool|null $default
* @param bool|null $expected
* @return void
*/
public function testMakeBool(mixed $input, ?bool $expected): void
{
$set_var = VarSetTypeNull::makeBool($input);
if ($expected !== null) {
$this->assertIsBool($set_var);
} else {
$this->assertNull($set_var);
}
$this->assertEquals(
$expected,
$set_var
);
}
}
// __END__

View File

@@ -0,0 +1,632 @@
<?php // phpcs:disable Generic.Files.LineLength
declare(strict_types=1);
namespace tests;
use PHPUnit\Framework\TestCase;
use CoreLibs\Convert\VarSetType;
/**
* Test class for Convert\Strings
* @coversDefaultClass \CoreLibs\Convert\VarSetType
* @testdox \CoreLibs\Convert\VarSetType method tests
*/
final class CoreLibsConvertVarSetTypeTest extends TestCase
{
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeStringProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'empty string' => [
'',
null,
''
],
'filled string' => [
'string',
null,
'string'
],
'valid string, override set' => [
'string',
'override',
'string'
],
'int, no override' => [
1,
null,
''
],
'int, override set' => [
1,
'not int',
'not int'
]
];
}
/**
* Undocumented function
* @covers ::setStr
* @dataProvider varSetTypeStringProvider
* @testdox setStr $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param string|null $default
* @param string $expected
* @return void
*/
public function testSetString(mixed $input, ?string $default, string $expected): void
{
if ($default === null) {
$set_var = VarSetType::setStr($input);
} else {
$set_var = VarSetType::setStr($input, $default);
}
$this->assertIsString($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varMakeTypeStringProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'empty string' => [
'',
null,
''
],
'filled string' => [
'string',
null,
'string'
],
'valid string, override set' => [
'string',
'override',
'string'
],
'int, no override' => [
1,
null,
'1'
],
'int, override set' => [
1,
'not int',
'1'
],
// all the strange things here
'function, override set' => [
$foo = function () {
return '';
},
'function',
'function'
],
'hex value, override set' => [
0x55,
'hex',
'85'
]
];
}
/**
* Undocumented function
* @covers ::makeStr
* @dataProvider varMakeTypeStringProvider
* @testdox makeStr $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param string|null $default
* @param string $expected
* @return void
*/
public function testMakeString(mixed $input, ?string $default, string $expected): void
{
if ($default === null) {
$set_var = VarSetType::makeStr($input);
} else {
$set_var = VarSetType::makeStr($input, $default);
}
$this->assertIsString($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeIntProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'int' => [
1,
null,
1
],
'int, override set' => [
1,
-1,
1
],
'string, no override' => [
'string',
null,
0
],
'string, override' => [
'string',
-1,
-1
],
'float' => [
1.5,
null,
0
]
];
}
/**
* Undocumented function
* @covers ::setInt
* @dataProvider varSetTypeIntProvider
* @testdox setInt $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param int|null $default
* @param int $expected
* @return void
*/
public function testSetInt(mixed $input, ?int $default, int $expected): void
{
if ($default === null) {
$set_var = VarSetType::setInt($input);
} else {
$set_var = VarSetType::setInt($input, $default);
}
$this->assertIsInt($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varMakeTypeIntProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'int' => [
1,
null,
1
],
'int, override set' => [
1,
-1,
1
],
'string, no override' => [
'string',
null,
0
],
'string, override' => [
'string',
-1,
0
],
'float' => [
1.5,
null,
1
],
// all the strange things here
'function, override set' => [
$foo = function () {
return '';
},
-1,
-1
],
'hex value, override set' => [
0x55,
-1,
85
],
];
}
/**
* Undocumented function
* @covers ::makeInt
* @dataProvider varMakeTypeIntProvider
* @testdox makeInt $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param int|null $default
* @param int $expected
* @return void
*/
public function testMakeInt(mixed $input, ?int $default, int $expected): void
{
if ($default === null) {
$set_var = VarSetType::makeInt($input);
} else {
$set_var = VarSetType::makeInt($input, $default);
}
$this->assertIsInt($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeFloatProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'float' => [
1.5,
null,
1.5
],
'float, override set' => [
1.5,
-1.5,
1.5
],
'string, no override' => [
'string',
null,
0.0
],
'string, override' => [
'string',
1.5,
1.5
],
'int' => [
1,
null,
0.0
]
];
}
/**
* Undocumented function
* @covers ::setFloat
* @dataProvider varSetTypeFloatProvider
* @testdox setFloat $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param float|null $default
* @param float $expected
* @return void
*/
public function testSetFloat(mixed $input, ?float $default, float $expected): void
{
if ($default === null) {
$set_var = VarSetType::setFloat($input);
} else {
$set_var = VarSetType::setFloat($input, $default);
}
$this->assertIsFloat($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varMakeTypeFloatProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'float' => [
1.5,
null,
1.5
],
'float, override set' => [
1.5,
-1.5,
1.5
],
'string, no override' => [
'string',
null,
0.0
],
'string, override' => [
'string',
1.5,
0.0
],
'int' => [
1,
null,
1.0
],
// all the strange things here
'function, override set' => [
$foo = function () {
return '';
},
-1.0,
-1.0
],
'hex value, override set' => [
0x55,
-1,
85.0
],
];
}
/**
* Undocumented function
* @covers ::makeFloat
* @dataProvider varMakeTypeFloatProvider
* @testdox makeFloat $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param float|null $default
* @param float $expected
* @return void
*/
public function testMakeFloat(mixed $input, ?float $default, float $expected): void
{
if ($default === null) {
$set_var = VarSetType::makeFloat($input);
} else {
$set_var = VarSetType::makeFloat($input, $default);
}
$this->assertIsFloat($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeArrayProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'array, empty' => [
[],
null,
[]
],
'array, filled' => [
['array'],
null,
['array']
],
'string, no override' => [
'string',
null,
[]
],
'string, override' => [
'string',
['string'],
['string']
]
];
}
/**
* Undocumented function
* @covers ::setArray
* @dataProvider varSetTypeArrayProvider
* @testdox setArray $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param array|null $default
* @param array $expected
* @return void
*/
public function testSetArray(mixed $input, ?array $default, array $expected): void
{
if ($default === null) {
$set_var = VarSetType::setArray($input);
} else {
$set_var = VarSetType::setArray($input, $default);
}
$this->assertIsArray($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varSetTypeBoolProvider(): array
{
// 0: input
// 1: default (null default)
// 2: expected
return [
'bool true' => [
true,
null,
true
],
'bool false' => [
false,
null,
false
],
'string, no override' => [
'string',
null,
false
],
'string, override' => [
'string',
true,
true
]
];
}
/**
* Undocumented function
* @covers ::setBool
* @dataProvider varSetTypeBoolProvider
* @testdox setBool $input with override $default will be $expected [$_dataName]
*
* @param mixed $input
* @param bool|null $default
* @param bool $expected
* @return void
*/
public function testSetBool(mixed $input, ?bool $default, bool $expected): void
{
if ($default === null) {
$set_var = VarSetType::setBool($input);
} else {
$set_var = VarSetType::setBool($input, $default);
}
$this->assertIsBool($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
/**
* Undocumented function
*
* @return array
*/
public function varMakeTypeBoolProvider(): array
{
// 0: input
// 2: expected
return [
'true' => [
true,
null,
true
],
'false' => [
false,
null,
false
],
'string on' => [
'on',
null,
true
],
'string off' => [
'off',
null,
false
],
'invalid string' => [
'sulzenbacher',
null,
false,
],
'invalid string, override' => [
'sulzenbacher',
true,
true,
],
'array to default' => [
[],
null,
false
],
];
}
/**
* Undocumented function
* @covers ::setBool
* @dataProvider varMakeTypeBoolProvider
* @testdox setBool $input will be $expected [$_dataName]
*
* @param mixed $input
* @param bool|null $default
* @param bool $expected
* @return void
*/
public function testMakeBool(mixed $input, ?bool $default, bool $expected): void
{
if ($default === null) {
$set_var = VarSetType::makeBool($input);
} else {
$set_var = VarSetType::makeBool($input, $default);
}
$this->assertIsBool($set_var);
$this->assertEquals(
$expected,
$set_var
);
}
}
// __END__

View File

@@ -114,7 +114,15 @@ final class CoreLibsDebugSupportTest extends TestCase
*/
public function printToStringProvider(): array
{
// 0: unput
// 1: html flag (only for strings and arry)
// 2: expected
return [
'null' => [
null,
null,
'NULL',
],
'string' => [
'a string',
null,
@@ -333,16 +341,19 @@ final class CoreLibsDebugSupportTest extends TestCase
* @dataProvider printToStringProvider
* @testdox printToString $input with $flag will be $expected [$_dataName]
*
* @param mixed $input
* @param boolean|null $flag
* @param string $expected
* @param mixed $input anything
* @param boolean|null $flag html flag, only for string and array
* @param string $expected always string
* @return void
*/
public function testPrintToString($input, ?bool $flag, string $expected): void
public function testPrintToString(mixed $input, ?bool $flag, string $expected): void
{
if ($flag === null) {
// if expected starts with / and ends with / then this is a regex compare
if (substr($expected, 0, 1) == '/' && substr($expected, -1, 1) == '/') {
if (
substr($expected, 0, 1) == '/' &&
substr($expected, -1, 1) == '/'
) {
$this->assertMatchesRegularExpression(
$expected,
\CoreLibs\Debug\Support::printToString($input)

View File

@@ -0,0 +1,119 @@
<?php // phpcs:ignore warning
/**
* @phan-file-suppress PhanTypeSuspiciousStringExpression
*/
declare(strict_types=1);
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
$DEBUG_ALL = 1;
$PRINT_ALL = 1;
$DB_DEBUG = 1;
if ($DEBUG_ALL) {
error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
}
ob_start();
// basic class test file
define('USE_DATABASE', false);
// sample config
require 'config.php';
// define log file id
$LOG_FILE_ID = 'classTest-VarIsType';
ob_end_flush();
use CoreLibs\Convert\VarSetType;
use CoreLibs\Convert\VarSetTypeNull;
use CoreLibs\Debug\Support;
$log = new CoreLibs\Debug\Logging([
'log_folder' => BASE . LOG,
'file_id' => $LOG_FILE_ID,
// add file date
'print_file_date' => true,
// set debug and print flags
'debug_all' => $DEBUG_ALL ?? false,
'echo_all' => $ECHO_ALL ?? false,
'print_all' => $PRINT_ALL ?? false,
]);
$PAGE_NAME = 'TEST CLASS: CONVERT\VARISTYPE';
print "<!DOCTYPE html>";
print "<html><head><title>" . $PAGE_NAME . "</title><head>";
print "<body>";
print '<div><a href="class_test.php">Class Test Master</a></div>';
print '<div><h1>' . $PAGE_NAME . '</h1></div>';
print "Test A str set: " . VarSetType::setStr(5, 'set int') . "<br>";
print "Test A str make int: " . VarSetType::makeStr(5, 'make int') . "<br>";
print "Test A str make object: " . VarSetType::makeStr($log, 'Object') . "<br>";
print "Test A str make null: " . VarSetType::makeStr(null, 'null') . "<br>";
print "Test B int set: " . VarSetType::setInt("5", -1) . "<br>";
print "Test B int make string: " . VarSetType::makeInt("5", -1) . "<br>";
print "Test B' int make float: " . VarSetType::makeInt("5.5", -1) . "<br>";
print "Test B'' int make class: " . VarSetType::makeInt($log, -1) . "<br>";
print "Test B''' int make hex: " . VarSetType::makeInt("0x55", -1) . "<br>";
print "Test B''' int make hex: " . VarSetType::makeInt(0x55, -1) . "<br>";
print "Test C float make: " . VarSetType::makeFloat("13,232.95", -1) . "<br>";
print "Test D floatval: " . floatval("13,232.95") . "<br>";
print "Test E filter_var: "
. filter_var("13,232.95", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) . "<br>";
print "Test F filter_var: "
. filter_var("string", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) . "<br>";
print "Test G make bool: " . VarSetType::makeBool("on") . "<br>";
print "Test G make bool: " . VarSetType::makeBool(null) . "<br>";
print "Test G make bool: " . VarSetType::makeBool("null") . "<br>";
print "Test G make bool: " . VarSetType::makeBool($log) . "<br>";
print "Test G make bool: " . VarSetTypeNull::makeBool($log) . "<br>";
print "<hr>";
$checks = [
'string',
5,
1.2,
['array'],
true,
// resource?
];
foreach ($checks as $string) {
print "** SET NOT NULL: (" . gettype($string) . ")<br>";
print "Str: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetType::setStr($string)) . "-<br>";
print "Int: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetType::setInt($string)) . "-<br>";
print "Float: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetType::setFloat($string)) . "-<br>";
print "Bool: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetType::setBool($string)) . "-<br>";
print "Array: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetType::setArray($string)) . "-<br>";
print "<hr>";
}
foreach ($checks as $string) {
print "** SET NULL: (" . gettype($string) . ")<br>";
print "Str: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetTypeNull::setStr($string)) . "-<br>";
print "Int: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetTypeNull::setInt($string)) . "-<br>";
print "Float: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetTypeNull::setFloat($string)) . "-<br>";
print "Bool: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetTypeNull::setBool($string)) . "-<br>";
print "Array: " . Support::printToString($string) . ": -"
. Support::printToString(VarSetTypeNull::setArray($string)) . "-<br>";
print "<hr>";
}
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -0,0 +1,256 @@
<?php
/*
* Run is_<type> checks and return default value if not this type
* This will return default null on invalid entries
*/
declare(strict_types=1);
namespace CoreLibs\Convert\Extends;
class VarSetTypeMain
{
/**
* If input variable is string then returns it, else returns default set
* if not null is true, then null as return is allowed, else return is
* converted to string
*
* @param mixed $val Input variable
* @param string|null $default Default value
* @param bool $to_null Convert to null (default no)
* @return string|null Input var or default value
*/
protected static function setStrMain(
mixed $val,
?string $default = null,
bool $to_null = false
): ?string {
if (is_string($val)) {
return $val;
}
if ($to_null === false) {
return (string)$default;
}
return $default;
}
/**
* Will convert input data to string if possible.
* Runs for string/int/float/bool/null
* Will skip array/object/resource/callable/etc and use default for that
*
* @param mixed $val Input variable
* @param string|null $default Default value
* @param bool $to_null Convert to null (default no)
* @return string|null Converted input data to string/null
*/
protected static function makeStrMain(
mixed $val,
string $default = null,
bool $to_null = false
): ?string {
// int/float/string/bool/null, everything else is ignored
// no: array/object/resource/callable
if (
is_int($val) ||
is_float($val) ||
is_string($val) ||
is_bool($val) ||
is_null($val)
) {
return (string)$val;
}
if ($to_null === false) {
return (string)$default;
}
return $default;
}
/**
* If input variable is int, return it, else return default value. If to_null
* is true then null as return is allowed, else only int is returned
*
* @param mixed $val Input variable
* @param int|null $default Default value
* @param bool $to_null Convert to null (default no)
* @return int|null Input var or default value
*/
protected static function setIntMain(
mixed $val,
?int $default = null,
bool $to_null = false
): ?int {
if (is_int($val)) {
return $val;
}
if ($to_null === false) {
return (int)$default;
}
return $default;
}
/**
* Convert input to int via filter_var. If not convertable return default value.
* If to_null is set to true null return is allowed
* NOTE: this is only a drastic fallback and not recommned for special use.
* It will try to check via filter_var if we can get an int value and then use
* intval to convert it.
* Reason is that filter_var will convert eg 1.5 to 15 instead 1
* One is very wrong, the other is at least better, but not perfect
*
* @param mixed $val Input variable
* @param int|null $default Default value
* @param bool $to_null Convert to null (default no)
* @return int|null Converted input data to int/null
*/
protected static function makeIntMain(
mixed $val,
int $default = null,
bool $to_null = false
): ?int {
// if we can filter it to a valid int, we can convert it
// we so avoid object, array, etc
if (
filter_var(
$val,
FILTER_SANITIZE_NUMBER_INT
) !== false
) {
return intval($val);
}
if ($to_null === false) {
return (int)$default;
}
return $default;
}
/**
* If input is float return it, else set to default value. If to_null is set
* to true, allow null return
*
* @param mixed $val Input variable
* @param float|null $default Default value
* @param bool $to_null Convert to null (default no)
* @return float|null Input var or default value
*/
protected static function setFloatMain(
mixed $val,
?float $default = null,
bool $to_null = false
): ?float {
if (is_float($val)) {
return $val;
}
if ($to_null === false) {
return (float)$default;
}
return $default;
}
/**
* Convert intput var to float via filter_var. If failed to so return default.
* If to_null is set to true allow null return
*
* @param mixed $val Input variable
* @param float|null $default Default value
* @param bool $to_null Convert to null (default no)
* @return float|null Converted intput data to float/null
*/
protected static function makeFloatMain(
mixed $val,
float $default = null,
bool $to_null = false
): ?float {
if (
(
$val = filter_var(
$val,
FILTER_SANITIZE_NUMBER_FLOAT,
FILTER_FLAG_ALLOW_FRACTION
)
) !== false
) {
return (float)$val;
}
if ($to_null === false) {
return (float)$default;
}
return $default;
}
/**
* If input var is array return it, else return default value. If to_null is
* set to true, allow null return
*
* @param mixed $val Input variable
* @param array<mixed>|null $default Default value
* @param bool $to_null Convert to null (default no)
* @return array<mixed>|null Input var or default value
*/
protected static function setArrayMain(
mixed $val,
?array $default = null,
bool $to_null = false
): ?array {
if (is_array($val)) {
return $val;
}
if ($to_null === false) {
return (array)$default;
}
return $default;
}
/**
* If input var is bool return it, else return default value. If to_null is
* set to true will allow null return.
*
* @param mixed $val Input variable
* @param bool|null $default Default value
* @param bool $to_null Convert to null (default no)
* @return bool|null Input var or default value
*/
protected static function setBoolMain(
mixed $val,
?bool $default = null,
bool $to_null = false
): ?bool {
if (is_bool($val)) {
return $val;
}
if ($to_null === false) {
return (bool)$default;
}
return $default;
}
/**
* Convert anything to bool. If it is a string it will try to use the filter_var
* to convert know true/false strings.
* Else it uses (bool) to convert the rest
* If null is allowed, will return null
*
* @param mixed $val Input variable
* @param bool $default Default value if to_null if false
* @param bool $to_null Convert to null (default no)
* @return bool|null Converted input data to bool/ null
*/
protected static function makeBoolMain(
mixed $val,
bool $default = false,
bool $to_null = false
): ?bool {
$boolvar = is_string($val) ?
filter_var(
$val,
FILTER_VALIDATE_BOOLEAN,
FILTER_NULL_ON_FAILURE
) :
(bool)$val;
return $boolvar === null && !$to_null ? $default : $boolvar;
}
}
// __END__

View File

@@ -0,0 +1,136 @@
<?php
/*
* Run is_<type> checks and return default value if not this type
* This will return a default value as always what is expected and never null
* Use this for santize output from multi return functions where we know what
* will come back
*/
declare(strict_types=1);
namespace CoreLibs\Convert;
use CoreLibs\Convert\Extends\VarSetTypeMain;
class VarSetType extends Extends\VarSetTypeMain
{
/**
* Check is input is string, if not return default string.
* Will always return string
*
* @param mixed $val Input value
* @param string $default Default override value
* @return string Input value or default as string
*/
public static function setStr(mixed $val, string $default = ''): string
{
return (string)VarSetTypeMain::setStrMain($val, $default, false);
}
/**
* Convert input to string if possible.
* Will only work on string/int/float/bool/null types
* Will always return string
*
* @param mixed $val Input value
* @param string $default Default override value
* @return string Input value as string or default as string
*/
public static function makeStr(mixed $val, string $default = ''): string
{
return (string)VarSetTypeMain::makeStrMain($val, $default, false);
}
/**
* Check if input is int, if not return default int value 0.
* Will always return int.
*
* @param mixed $val Input value
* @param int $default Default override value
* @return int Input value or default as int
*/
public static function setInt(mixed $val, int $default = 0): int
{
return (int)VarSetTypeMain::setIntMain($val, $default, false);
}
/**
* Convert intput to int if possible, if not return default value 0.
* Will always return int.
*
* @param mixed $val Input value
* @param int $default Default override value
* @return int Input value as int or default as int
*/
public static function makeInt(mixed $val, int $default = 0): int
{
return (int)VarSetTypeMain::makeIntMain($val, $default, false);
}
/**
* Check if input is float, if not return default value value 0.0.
* Will always return float
*
* @param mixed $val Input value
* @param float $default Default override value
* @return float Input value or default as float
*/
public static function setFloat(mixed $val, float $default = 0.0): float
{
return (float)VarSetTypeMain::setFloatMain($val, $default, false);
}
/**
* Convert input to float, if not possible return default value 0.0.
* Will always return float
*
* @param mixed $val Input value
* @param float $default Default override value
* @return float Input value as float or default as float
*/
public static function makeFloat(mixed $val, float $default = 0.0): float
{
return (float)VarSetTypeMain::makeFloatMain($val, $default, false);
}
/**
* Check if input is array, if not return default empty array.
* Will always return array.
*
* @param mixed $val Input value
* @param array<mixed> $default Default override value
* @return array<mixed> Input value or default as array
*/
public static function setArray(mixed $val, array $default = []): array
{
return (array)VarSetTypeMain::setArrayMain($val, $default, false);
}
/**
* Check if input is bool, if not will return default value false.
* Will aways return bool.
*
* @param mixed $val Input value
* @param bool $default Default override value
* @return bool Input value or default as bool
*/
public static function setBool(mixed $val, bool $default = false): bool
{
return (bool)VarSetTypeMain::setBoolMain($val, $default, false);
}
/**
* Convert anything to bool
*
* @param mixed $val Input value
* @param bool $default Default override value
* @return bool Input value as bool or default as bool
*/
public static function makeBool(mixed $val, bool $default = false): bool
{
return (bool)VarSetTypeMain::makeBoolMain($val, $default, false);
}
}
// __END__

View File

@@ -0,0 +1,130 @@
<?php
/*
* Run is_<type> checks and return default value if not this type
* This will return default null on invalid entries
*/
declare(strict_types=1);
namespace CoreLibs\Convert;
use CoreLibs\Convert\Extends\VarSetTypeMain;
class VarSetTypeNull extends Extends\VarSetTypeMain
{
/**
* Check is input is string, if not return default string.
* Will return null if no string as default.
*
* @param mixed $val Input value
* @param string|null $default Default override value
* @return string|null Input value or default as string/null
*/
public static function setStr(mixed $val, ?string $default = null): ?string
{
return VarSetTypeMain::setStrMain($val, $default, true);
}
/**
* Convert input to string if possible.
* Will only work on string/int/float/bool/null types.
* Will return null if convert failed as default.
*
* @param mixed $val Input value
* @param string|null $default Default override value
* @return string|null Input value as string or default as string/null
*/
public static function makeStr(mixed $val, string $default = null): ?string
{
return VarSetTypeMain::makeStrMain($val, $default, true);
}
/**
* Check if input is int, if not return default value null.
*
* @param mixed $val Input value
* @param int|null $default Default override value
* @return int|null Input value or default as int/null
*/
public static function setInt(mixed $val, ?int $default = null): ?int
{
return VarSetTypeMain::setIntMain($val, $default, true);
}
/**
* Convert intput to int if possible, if not return default value value null.
*
* @param mixed $val Input value $val
* @param int|null $default Default override value
* @return int|null Input value as int or default as int/null
*/
public static function makeInt(mixed $val, int $default = null): ?int
{
return VarSetTypeMain::makeIntMain($val, $default, true);
}
/**
* Check if input is float, if not return default value value null.
*
* @param mixed $val Input value $val
* @param float|null $default Default override value
* @return float|null Input value or default as float/null
*/
public static function setFloat(mixed $val, ?float $default = null): ?float
{
return VarSetTypeMain::setFloatMain($val, $default, true);
}
/**
* Convert input to float, if not possible return default value null.
*
* @param mixed $val Input value $val
* @param float|null $default Default override value
* @return float|null Input value as float or default as float/null
*/
public static function makeFloat(mixed $val, float $default = null): ?float
{
return VarSetTypeMain::makeFloatMain($val, $default, true);
}
/**
* Check if input is array, if not return default value null.
*
* @param mixed $val Input value $val
* @param array<mixed>|null $default Default override value
* @return array<mixed>|null Input value or default as array/null
*/
public static function setArray(mixed $val, ?array $default = null): ?array
{
return VarSetTypeMain::setArrayMain($val, $default, true);
}
/**
* Check if input is bool, if not will return default value null.
*
* @param mixed $val Input value $val
* @param bool|null $default Default override value
* @return bool|null Input value or default as bool/null
*/
public static function setBool(mixed $val, ?bool $default = null): ?bool
{
return VarSetTypeMain::setBoolMain($val, $default, true);
}
/**
* Convert anything to bool
*
* @param mixed $val Input value $val
* @return bool|null Input value as bool or default as bool/null
*/
public static function makeBool(mixed $val): ?bool
{
// note that the default value here is irrelevant, we return null
// on unsetable string var
return VarSetTypeMain::makeBoolMain($val, false, true);
}
}
// __END__

View File

@@ -94,9 +94,11 @@ class Support
* @param bool $no_html set to true to use ##HTMLPRE##or html escape
* @return string
*/
public static function printToString($mixed, bool $no_html = false): string
public static function printToString(mixed $mixed, bool $no_html = false): string
{
if (is_bool($mixed)) {
if (is_null($mixed)) {
return (string)'NULL';
} elseif (is_bool($mixed)) {
return self::printBool($mixed, '', 'TRUE', 'FALSE');
} elseif (is_resource($mixed)) {
return (string)$mixed;

View File

@@ -2,6 +2,24 @@
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit10fe8fe2ec4017b8644d2b64bcf398b9::getLoader();

View File

@@ -42,6 +42,9 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var ?string */
private $vendorDir;
@@ -106,6 +109,7 @@ class ClassLoader
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
@@ -149,7 +153,7 @@ class ClassLoader
/**
* @return string[] Array of classname => path
* @psalm-var array<string, string>
* @psalm-return array<string, string>
*/
public function getClassMap()
{
@@ -425,7 +429,7 @@ class ClassLoader
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
(self::$includeFile)($file);
return true;
}
@@ -555,18 +559,23 @@ class ClassLoader
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{
include $file;
private static function initializeIncludeClosure(): void
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = static function($file) {
include $file;
};
}
}

View File

@@ -2,7 +2,7 @@
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
@@ -24,12 +24,15 @@ return array(
'CoreLibs\\Convert\\Byte' => $baseDir . '/lib/CoreLibs/Convert/Byte.php',
'CoreLibs\\Convert\\Colors' => $baseDir . '/lib/CoreLibs/Convert/Colors.php',
'CoreLibs\\Convert\\Encoding' => $baseDir . '/lib/CoreLibs/Convert/Encoding.php',
'CoreLibs\\Convert\\Extends\\VarSetTypeMain' => $baseDir . '/lib/CoreLibs/Convert/Extends/VarSetTypeMain.php',
'CoreLibs\\Convert\\Html' => $baseDir . '/lib/CoreLibs/Convert/Html.php',
'CoreLibs\\Convert\\Json' => $baseDir . '/lib/CoreLibs/Convert/Json.php',
'CoreLibs\\Convert\\Math' => $baseDir . '/lib/CoreLibs/Convert/Math.php',
'CoreLibs\\Convert\\MimeAppName' => $baseDir . '/lib/CoreLibs/Convert/MimeAppName.php',
'CoreLibs\\Convert\\MimeEncode' => $baseDir . '/lib/CoreLibs/Convert/MimeEncode.php',
'CoreLibs\\Convert\\Strings' => $baseDir . '/lib/CoreLibs/Convert/Strings.php',
'CoreLibs\\Convert\\VarSetType' => $baseDir . '/lib/CoreLibs/Convert/VarSetType.php',
'CoreLibs\\Convert\\VarSetTypeNull' => $baseDir . '/lib/CoreLibs/Convert/VarSetTypeNull.php',
'CoreLibs\\Create\\Email' => $baseDir . '/lib/CoreLibs/Create/Email.php',
'CoreLibs\\Create\\Hash' => $baseDir . '/lib/CoreLibs/Create/Hash.php',
'CoreLibs\\Create\\RandomKey' => $baseDir . '/lib/CoreLibs/Create/RandomKey.php',

View File

@@ -2,10 +2,10 @@
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php',
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php',
);

View File

@@ -2,7 +2,7 @@
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(

View File

@@ -2,7 +2,7 @@
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(

View File

@@ -23,51 +23,26 @@ class ComposerAutoloaderInit10fe8fe2ec4017b8644d2b64bcf398b9
}
spl_autoload_register(array('ComposerAutoloaderInit10fe8fe2ec4017b8644d2b64bcf398b9', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit10fe8fe2ec4017b8644d2b64bcf398b9', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9::getInitializer($loader));
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire10fe8fe2ec4017b8644d2b64bcf398b9($fileIdentifier, $file);
$filesToLoad = \Composer\Autoload\ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9::$files;
$requireFile = static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
};
foreach ($filesToLoad as $fileIdentifier => $file) {
($requireFile)($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire10fe8fe2ec4017b8644d2b64bcf398b9($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}

View File

@@ -7,8 +7,8 @@ namespace Composer\Autoload;
class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9
{
public static $files = array (
'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php',
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php',
);
public static $prefixLengthsPsr4 = array (
@@ -57,12 +57,15 @@ class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9
'CoreLibs\\Convert\\Byte' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Byte.php',
'CoreLibs\\Convert\\Colors' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Colors.php',
'CoreLibs\\Convert\\Encoding' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Encoding.php',
'CoreLibs\\Convert\\Extends\\VarSetTypeMain' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Extends/VarSetTypeMain.php',
'CoreLibs\\Convert\\Html' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Html.php',
'CoreLibs\\Convert\\Json' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Json.php',
'CoreLibs\\Convert\\Math' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Math.php',
'CoreLibs\\Convert\\MimeAppName' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/MimeAppName.php',
'CoreLibs\\Convert\\MimeEncode' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/MimeEncode.php',
'CoreLibs\\Convert\\Strings' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Strings.php',
'CoreLibs\\Convert\\VarSetType' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/VarSetType.php',
'CoreLibs\\Convert\\VarSetTypeNull' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/VarSetTypeNull.php',
'CoreLibs\\Create\\Email' => __DIR__ . '/../..' . '/lib/CoreLibs/Create/Email.php',
'CoreLibs\\Create\\Hash' => __DIR__ . '/../..' . '/lib/CoreLibs/Create/Hash.php',
'CoreLibs\\Create\\RandomKey' => __DIR__ . '/../..' . '/lib/CoreLibs/Create/RandomKey.php',