mirror of
https://github.com/jbcr/SyliusCmsPlugin.git
synced 2026-04-28 02:53:14 +02:00
31 lines
847 B
PHP
Executable File
31 lines
847 B
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* This file was created by the 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.
|
|
*/
|
|
|
|
namespace Tests\BitBag\SyliusCmsPlugin\Behat\Service;
|
|
|
|
final class RandomStringGenerator implements RandomStringGeneratorInterface
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
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;
|
|
}
|
|
}
|