Skip to content

Commit c2fa5e3

Browse files
committed
Move casing helpers up to language
1 parent 504ca9b commit c2fa5e3

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/SDK/Language.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,19 @@ public function getFilters(): array
8383
{
8484
return [];
8585
}
86+
87+
protected function toUpperCase(string $value): string
88+
{
89+
return ucfirst($this->helperCamelCase($value));
90+
}
91+
92+
protected function helperCamelCase($str): string
93+
{
94+
$str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str);
95+
$str = trim($str);
96+
$str = ucwords($str);
97+
$str = str_replace(" ", "", $str);
98+
99+
return lcfirst($str);
100+
}
86101
}

src/SDK/Language/Web.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -301,22 +301,6 @@ public function getReturn(array $method, array $spec): string
301301
return "";
302302
}
303303

304-
public function toUpperCase(string $value): string
305-
{
306-
return ucfirst((string)$this->helperCamelCase($value));
307-
}
308-
309-
protected function helperCamelCase($str)
310-
{
311-
$str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str);
312-
$str = trim($str);
313-
$str = ucwords($str);
314-
$str = str_replace(" ", "", $str);
315-
$str = lcfirst($str);
316-
317-
return $str;
318-
}
319-
320304
public function getSubSchema(array $property, array $spec): string
321305
{
322306
if (array_key_exists('sub_schema', $property)) {

0 commit comments

Comments
 (0)