| @@ -102,9 +102,12 @@ | ||
| 102 | 102 | |
| 103 | 103 | public function camel(): parent |
| 104 | 104 | { |
| 105 | 105 | $str = clone $this; |
| 106 | - $str->string = lcfirst(str_replace(' ', '', ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); | |
| 106 | + | |
| 107 | + $parts = explode(' ', trim(ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); | |
| 108 | + $parts[0] = 1 !== \strlen($parts[0]) && ctype_upper($parts[0]) ? $parts[0] : lcfirst($parts[0]); | |
| 109 | + $str->string = implode('', $parts); | |
| 107 | 110 | |
| 108 | 111 | return $str; |
| 109 | 112 | } |
| 110 | 113 | |