Skip to content

Commit

Permalink
🐛 remove that annoying extra br
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Aug 18, 2021
1 parent 905ac0d commit ac696f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function generate(): string
$interface = $this->getInterface(new $model());
$allCode .= $this->getCode($interface);
}
return $allCode;
return substr($allCode, 0, strrpos($allCode, "\n"));
}

/**
Expand Down Expand Up @@ -112,19 +112,19 @@ private function getCode(TypescriptInterface $interface): string
if (count($interface->columns) > 0) {
$code .= " // columns\n";
foreach ($interface->columns as $key => $value) {
$code .= " {$key}: {$value}\n";
$code .= " $key: $value\n";
}
}
if (count($interface->mutators) > 0) {
$code .= " // mutators\n";
foreach ($interface->mutators as $key => $value) {
$code .= " {$key}: {$value}\n";
$code .= " $key: $value\n";
}
}
if (count($interface->relations) > 0) {
$code .= " // relations\n";
foreach ($interface->relations as $key => $value) {
$code .= " {$key}: {$value}\n";
$code .= " $key: $value\n";
}
}
$code .= "}\n";
Expand Down

0 comments on commit ac696f2

Please sign in to comment.