Skip to content

Commit

Permalink
Fix multibyte issues in automatic spec updates
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinsFrank committed Aug 24, 2022
1 parent f19836d commit 9b352fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dev/DataTarget/EnumFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function putContent(string $content): self
public function writeCases(): self
{
$enumContent = $this->getContent();
$startEnum = strpos($enumContent, '{');
$firstMethodPos = strpos($enumContent, ' public ');
$endEnumPos = strrpos($enumContent, '}');
$startEnum = mb_strpos($enumContent, '{');
$firstMethodPos = mb_strpos($enumContent, ' public ');
$endEnumPos = mb_strrpos($enumContent, '}');
$newEnumContent = mb_substr($enumContent, 0, $startEnum + 1) . PHP_EOL;
foreach ($this->cases as $case) {
$newEnumContent .= ' ' . ((string) $case) . PHP_EOL;
Expand Down

0 comments on commit 9b352fc

Please sign in to comment.