diff --git a/src/ModelInterface.php b/src/ModelInterface.php index a844b93..0d0d1d5 100644 --- a/src/ModelInterface.php +++ b/src/ModelInterface.php @@ -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")); } /** @@ -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";