18 行
454B

  1. <?php
  2. /**
  3. * @var $faker \Faker\Generator
  4. * @var $index integer
  5. */
  6. $security = Yii::$app->getSecurity();
  7. return [
  8. 'username' => $faker->userName,
  9. 'email' => $faker->email,
  10. 'auth_key' => $security->generateRandomString(),
  11. 'password_hash' => $security->generatePasswordHash('password_' . $index),
  12. 'password_reset_token' => $security->generateRandomString() . '_' . time(),
  13. 'created_at' => time(),
  14. 'updated_at' => time(),
  15. ];