Use string buildCharStringsFromList function
This commit is contained in:
@@ -8,6 +8,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace CoreLibs\Create;
|
namespace CoreLibs\Create;
|
||||||
|
|
||||||
|
use CoreLibs\Convert\Strings;
|
||||||
|
|
||||||
class RandomKey
|
class RandomKey
|
||||||
{
|
{
|
||||||
/** @var int set the default key length it nothing else is set */
|
/** @var int set the default key length it nothing else is set */
|
||||||
@@ -44,7 +46,7 @@ class RandomKey
|
|||||||
*/
|
*/
|
||||||
private static function validateRandomKeyData(array ...$key_range): string
|
private static function validateRandomKeyData(array ...$key_range): string
|
||||||
{
|
{
|
||||||
$key_character_range = join('', array_unique(array_merge(...$key_range)));
|
$key_character_range = Strings::buildCharStringFromLists(...$key_range);
|
||||||
if (strlen(self::$key_character_range) <= 1) {
|
if (strlen(self::$key_character_range) <= 1) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user