Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix wrong class name #846

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ the LazyValue can be `memoized <https://en.wikipedia.org/wiki/Memoization>`_ so
return [
// Call CategoryFactory::random() everytime this factory is instantiated
'category' => LazyValue::new(fn() => CategoryFactory::random()),
// The same UserForPersistentFactory instance will be both added to the Project and set as the Task owner
// The same User instance will be both added to the Project and set as the Task owner
'project' => ProjectFactory::new(['users' => [$owner]]),
'owner' => $owner,
];
Expand Down Expand Up @@ -1006,7 +1006,7 @@ common use-case: encoding a password with the ``UserPasswordHasherInterface`` se

public static function class(): string
{
return UserForPersistentFactory::class;
return User::class;
}

protected function defaults(): array
Expand All @@ -1020,7 +1020,7 @@ common use-case: encoding a password with the ``UserPasswordHasherInterface`` se
protected function initialize(): static
{
return $this
->afterInstantiate(function(UserForPersistentFactory $user) {
->afterInstantiate(function(User $user) {
if ($this->passwordHasher !== null) {
$user->setPassword($this->passwordHasher->hashPassword($user, $user->getPassword()));
}
Expand Down Expand Up @@ -2035,7 +2035,7 @@ You can improve the speed by reducing the *work factor* of your encoder:
# config/packages/test/security.yaml
encoders:
# use your user class name here
App\Entity\UserForPersistentFactory:
App\Entity\User:
# This should be the same value as in config/packages/security.yaml
algorithm: auto
cost: 4 # Lowest possible value for bcrypt
Expand Down