mirror of
https://github.com/jbcr/SyliusCmsPlugin.git
synced 2026-03-25 17:32:08 +01:00
30 lines
836 B
PHP
Executable File
30 lines
836 B
PHP
Executable File
<?php
|
|
|
|
/*
|
|
* This file has been created by developers from BitBag.
|
|
* Feel free to contact us once you face any issues or want to start
|
|
* another great project.
|
|
* You can find more information about us on https://bitbag.shop and write us
|
|
* an email on mikolaj.krol@bitbag.pl.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\BitBag\SyliusCmsPlugin\Behat\Service;
|
|
|
|
final class RandomStringGenerator implements RandomStringGeneratorInterface
|
|
{
|
|
public function generate(int $length = 10): string
|
|
{
|
|
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
$charactersLength = strlen($characters);
|
|
$randomString = '';
|
|
|
|
for ($i = 0; $i < $length; ++$i) {
|
|
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
|
}
|
|
|
|
return $randomString;
|
|
}
|
|
}
|