Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5c082a0

Browse files
KDederichsnikophil
andcommittedJan 29, 2025··
Update src/Maker/Factory/MakeFactoryData.php
Co-authored-by: Nicolas PHILIPPE <[email protected]>
1 parent ab074c9 commit 5c082a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/Maker/Factory/MakeFactoryData.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,20 @@ public function addDefaultProperty(string $propertyName, string $defaultValue):
158158
public function getDefaultProperties(): array
159159
{
160160
$defaultProperties = $this->defaultProperties;
161-
$clazz = $this->object->getName();
161+
$class = $this->object->getName();
162162

163163
/**
164164
* If forceProperties is not set we filter out properties that can not be set because they're either readonly or have no setter.
165165
* Useful for properties that auto generate when the entity is created and can not be changed like a createdAt property for example.
166166
*
167167
* We do this here because we need to get the class of the Entity which only seems to be accessible here.
168168
*/
169-
$defaultProperties = array_filter($defaultProperties, function (string $propertyName) use ($clazz): bool {
169+
$defaultProperties = array_filter($defaultProperties, function (string $propertyName) use ($class): bool {
170170
if (true === $this->forceProperties) {
171171
return true;
172172
}
173173

174-
return self::propertyInfo()->isWritable($clazz, $propertyName) || self::propertyInfo()->isInitializable($clazz, $propertyName);
174+
return self::propertyInfo()->isWritable($class, $propertyName) || self::propertyInfo()->isInitializable($class, $propertyName);
175175
}, ARRAY_FILTER_USE_KEY);
176176

177177
\ksort($defaultProperties);

0 commit comments

Comments
 (0)
Please sign in to comment.