Lint PHP code psr-12, add GH action
This commit is contained in:
@@ -7,8 +7,7 @@ use Faker;
|
||||
|
||||
class FormSubmissionDataFactory
|
||||
{
|
||||
|
||||
private Faker\Generator|null $faker;
|
||||
private ?Faker\Generator $faker;
|
||||
|
||||
public function __construct(private Form $form)
|
||||
{
|
||||
@@ -68,24 +67,27 @@ class FormSubmissionDataFactory
|
||||
private function generateSelectValue($property)
|
||||
{
|
||||
$values = [];
|
||||
if (isset($property["select"]["options"]) && count($property["select"]["options"]) > 0) {
|
||||
$values = collect($property["select"]["options"])->map(function ($option) {
|
||||
if (isset($property['select']['options']) && count($property['select']['options']) > 0) {
|
||||
$values = collect($property['select']['options'])->map(function ($option) {
|
||||
return $option['name'];
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
return ($values) ? $this->faker->randomElement($values) : null;
|
||||
}
|
||||
|
||||
private function generateMultiSelectValues($property)
|
||||
{
|
||||
$values = [];
|
||||
if (isset($property["multi_select"]["options"]) && count($property["multi_select"]["options"]) > 0) {
|
||||
$values = collect($property["multi_select"]["options"])->map(function ($option) {
|
||||
if (isset($property['multi_select']['options']) && count($property['multi_select']['options']) > 0) {
|
||||
$values = collect($property['multi_select']['options'])->map(function ($option) {
|
||||
return $option['name'];
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
return ($values) ? $this->faker->randomElements(
|
||||
$values,
|
||||
$this->faker->numberBetween(1, count($values))) : null;
|
||||
$this->faker->numberBetween(1, count($values))
|
||||
) : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user