Skip to content

Commit a533d6a

Browse files
committed
Update string helper names
1 parent 8e029b1 commit a533d6a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/SDK/Language.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ public function getFilters(): array
8484
return [];
8585
}
8686

87-
protected function toUpperCase(string $value): string
87+
protected function toUpperCaseWords(string $value): string
8888
{
89-
return ucfirst($this->helperCamelCase($value));
89+
return ucfirst($this->toCamelCase($value));
9090
}
9191

92-
protected function helperCamelCase($str): string
92+
protected function toCamelCase($str): string
9393
{
9494
$str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str);
9595
$str = trim($str);

src/SDK/Language/Kotlin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ protected function getReturnType(array $method, array $spec, string $namespace,
451451
return 'Any';
452452
}
453453

454-
$ret = $this->toUpperCase($method['responseModel']);
454+
$ret = $this->toUpperCaseWords($method['responseModel']);
455455

456456
if ($this->hasGenericType($method['responseModel'], $spec)) {
457457
$ret .= '<' . $generic . '>';
@@ -463,15 +463,15 @@ protected function getReturnType(array $method, array $spec, string $namespace,
463463
protected function getModelType(array $definition, array $spec, string $generic = 'T'): string
464464
{
465465
if ($this->hasGenericType($definition['name'], $spec)) {
466-
return $this->toUpperCase($definition['name']) . '<' . $generic . '>';
466+
return $this->toUpperCaseWords($definition['name']) . '<' . $generic . '>';
467467
}
468-
return $this->toUpperCase($definition['name']);
468+
return $this->toUpperCaseWords($definition['name']);
469469
}
470470

471471
protected function getPropertyType(array $property, array $spec, string $generic = 'T'): string
472472
{
473473
if (\array_key_exists('sub_schema', $property)) {
474-
$type = $this->toUpperCase($property['sub_schema']);
474+
$type = $this->toUpperCaseWords($property['sub_schema']);
475475

476476
if ($this->hasGenericType($property['sub_schema'], $spec)) {
477477
$type .= '<' . $generic . '>';

src/SDK/Language/Web.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function getTypeName(array $parameter, array $method = []): string
208208
protected function populateGenerics(string $model, array $spec, array &$generics, bool $skipFirst = false)
209209
{
210210
if (!$skipFirst && $spec['definitions'][$model]['additionalProperties']) {
211-
$generics[] = $this->toUpperCase($model);
211+
$generics[] = $this->toUpperCaseWords($model);
212212
}
213213

214214
$properties = $spec['definitions'][$model]['properties'];
@@ -257,14 +257,14 @@ public function getReturn(array $method, array $spec): string
257257
$ret .= 'Models.';
258258
}
259259

260-
$ret .= $this->toUpperCase($method['responseModel']);
260+
$ret .= $this->toUpperCaseWords($method['responseModel']);
261261

262262
$models = [];
263263

264264
$this->populateGenerics($method['responseModel'], $spec, $models);
265265

266266
$models = array_unique($models);
267-
$models = array_filter($models, fn ($model) => $model != $this->toUpperCase($method['responseModel']));
267+
$models = array_filter($models, fn ($model) => $model != $this->toUpperCaseWords($method['responseModel']));
268268

269269
if (!empty($models)) {
270270
$ret .= '<' . implode(', ', $models) . '>';
@@ -284,9 +284,9 @@ public function getSubSchema(array $property, array $spec): string
284284
$generics = [];
285285
$this->populateGenerics($property['sub_schema'], $spec, $generics);
286286

287-
$generics = array_filter($generics, fn ($model) => $model != $this->toUpperCase($property['sub_schema']));
287+
$generics = array_filter($generics, fn ($model) => $model != $this->toUpperCaseWords($property['sub_schema']));
288288

289-
$ret .= $this->toUpperCase($property['sub_schema']);
289+
$ret .= $this->toUpperCaseWords($property['sub_schema']);
290290
if (!empty($generics)) {
291291
$ret .= '<' . implode(', ', $generics) . '>';
292292
}

0 commit comments

Comments
 (0)