Skip to content

Commit e246dee

Browse files
committed
single description: scenarioName, scenarioConst, modelName
1 parent 69dfc10 commit e246dee

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/items/DbModel.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class DbModel extends BaseObject
9292
* Here, you can set your own default description for the scenario.
9393
* AcceptedInputs: {scenarioName}, {scenarioConst}, {modelName}.
9494
*/
95-
public string $scenarioDefaultDescription = " Scenario {scenarioName}";
95+
public string $scenarioDefaultDescription = "Scenario {scenarioName}";
9696

9797
public function getTableAlias():string
9898
{
@@ -234,19 +234,19 @@ private function getScenariosByOpenapiSchema(): array
234234

235235
foreach ($scenarios as $key => $scenario) {
236236
$scenarios[$key]['const'] = 'SCENARIO_' . strtoupper(implode('_', preg_split('/(?=[A-Z])/', $scenario['name'])));
237+
$description = !empty($scenario['description']) ?
238+
$scenario['description'] : $this->scenarioDefaultDescription;
237239
$scenarios[$key]['description'] = FormatHelper::getFormattedDescription(
238-
!empty($scenario['description']) ?
239-
$scenario['description']
240-
: str_replace([
240+
str_replace([
241241
'{scenarioName}',
242242
'{scenarioConst}',
243243
'{modelName}',
244244
], [
245245
$scenario['name'],
246246
$scenarios[$key]['const'],
247247
$this->name,
248-
], $this->scenarioDefaultDescription),
249-
5);
248+
], $description),
249+
5);
250250
}
251251

252252
return $scenarios;

0 commit comments

Comments
 (0)