Aggiornato Composer
This commit is contained in:
@@ -193,7 +193,7 @@ class EntityPopulator
|
||||
return $obj;
|
||||
}
|
||||
|
||||
private function fillColumns($obj, $insertedEntities)
|
||||
private function fillColumns($obj, $insertedEntities): void
|
||||
{
|
||||
foreach ($this->columnFormatters as $field => $format) {
|
||||
if (null !== $format) {
|
||||
@@ -205,7 +205,7 @@ class EntityPopulator
|
||||
'Failed to generate a value for %s::%s: %s',
|
||||
get_class($obj),
|
||||
$field,
|
||||
$ex->getMessage()
|
||||
$ex->getMessage(),
|
||||
));
|
||||
}
|
||||
// Try a standard setter if it's available, otherwise fall back on reflection
|
||||
@@ -220,7 +220,7 @@ class EntityPopulator
|
||||
}
|
||||
}
|
||||
|
||||
private function callMethods($obj, $insertedEntities)
|
||||
private function callMethods($obj, $insertedEntities): void
|
||||
{
|
||||
foreach ($this->getModifiers() as $modifier) {
|
||||
$modifier($obj, $insertedEntities);
|
||||
|
||||
@@ -111,7 +111,7 @@ class Populator
|
||||
$insertedEntities[$class][] = $this->entities[$class]->execute(
|
||||
$entityManager,
|
||||
$insertedEntities,
|
||||
$generateId
|
||||
$generateId,
|
||||
);
|
||||
|
||||
if (count($insertedEntities) % $this->batchSize === 0) {
|
||||
|
||||
@@ -69,9 +69,9 @@ class ColumnTypeGuesser
|
||||
case \PropelColumnTypes::FLOAT:
|
||||
case \PropelColumnTypes::DOUBLE:
|
||||
case \PropelColumnTypes::REAL:
|
||||
return static function () use ($generator) {
|
||||
return $generator->randomFloat();
|
||||
};
|
||||
return static function () use ($generator) {
|
||||
return $generator->randomFloat();
|
||||
};
|
||||
|
||||
case \PropelColumnTypes::CHAR:
|
||||
case \PropelColumnTypes::VARCHAR:
|
||||
@@ -102,7 +102,7 @@ class ColumnTypeGuesser
|
||||
case \PropelColumnTypes::OBJECT:
|
||||
case \PropelColumnTypes::PHP_ARRAY:
|
||||
default:
|
||||
// no smart way to guess what the user expects here
|
||||
// no smart way to guess what the user expects here
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ class EntityPopulator
|
||||
foreach ($tableMap->getBehaviors() as $name => $params) {
|
||||
switch ($name) {
|
||||
case 'nested_set':
|
||||
$modifiers['nested_set'] = static function ($obj, $inserted) use ($class, $generator) {
|
||||
$modifiers['nested_set'] = static function ($obj, $inserted) use ($class, $generator): void {
|
||||
if (isset($inserted[$class])) {
|
||||
$queryClass = $class . 'Query';
|
||||
$parent = $queryClass::create()->findPk($generator->randomElement($inserted[$class]));
|
||||
@@ -170,7 +170,7 @@ class EntityPopulator
|
||||
break;
|
||||
|
||||
case 'sortable':
|
||||
$modifiers['sortable'] = static function ($obj, $inserted) use ($class, $generator) {
|
||||
$modifiers['sortable'] = static function ($obj, $inserted) use ($class, $generator): void {
|
||||
$obj->insertAtRank($generator->numberBetween(1, count($inserted[$class] ?? []) + 1));
|
||||
};
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class ColumnTypeGuesser
|
||||
case PropelTypes::OBJECT:
|
||||
case PropelTypes::PHP_ARRAY:
|
||||
default:
|
||||
// no smart way to guess what the user expects here
|
||||
// no smart way to guess what the user expects here
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ class EntityPopulator
|
||||
foreach ($tableMap->getBehaviors() as $name => $params) {
|
||||
switch ($name) {
|
||||
case 'nested_set':
|
||||
$modifiers['nested_set'] = static function ($obj, $inserted) use ($class, $generator) {
|
||||
$modifiers['nested_set'] = static function ($obj, $inserted) use ($class, $generator): void {
|
||||
if (isset($inserted[$class])) {
|
||||
$queryClass = $class . 'Query';
|
||||
$parent = $queryClass::create()->findPk($generator->randomElement($inserted[$class]));
|
||||
@@ -173,7 +173,7 @@ class EntityPopulator
|
||||
break;
|
||||
|
||||
case 'sortable':
|
||||
$modifiers['sortable'] = static function ($obj, $inserted) use ($class, $generator) {
|
||||
$modifiers['sortable'] = static function ($obj, $inserted) use ($class, $generator): void {
|
||||
$obj->insertAtRank($generator->numberBetween(1, count($inserted[$class] ?? []) + 1));
|
||||
};
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ class EntityPopulator
|
||||
return $obj;
|
||||
}
|
||||
|
||||
private function fillColumns($obj, $insertedEntities)
|
||||
private function fillColumns($obj, $insertedEntities): void
|
||||
{
|
||||
foreach ($this->columnFormatters as $field => $format) {
|
||||
if (null !== $format) {
|
||||
@@ -190,7 +190,7 @@ class EntityPopulator
|
||||
}
|
||||
}
|
||||
|
||||
private function callMethods($obj, $insertedEntities)
|
||||
private function callMethods($obj, $insertedEntities): void
|
||||
{
|
||||
foreach ($this->getModifiers() as $modifier) {
|
||||
$modifier($obj, $insertedEntities);
|
||||
|
||||
@@ -79,7 +79,7 @@ class Populator
|
||||
foreach ($this->quantities as $entityName => $number) {
|
||||
for ($i = 0; $i < $number; ++$i) {
|
||||
$insertedEntities[$entityName][] = $this->entities[$entityName]->execute(
|
||||
$insertedEntities
|
||||
$insertedEntities,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user