Skip to content

Commit

Permalink
fix: allow interfaces in default type replacements
Browse files Browse the repository at this point in the history
For example, we use the `Carbon\CarbonInterface` often, but we cannot set a default replacement for it now.
  • Loading branch information
erikgaal authored Dec 20, 2021
1 parent 9ed42aa commit 8ccc226
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TypeScriptTransformerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function getDefaultTypeReplacements(): array
$replacements = [];

foreach ($this->defaultTypeReplacements as $class => $replacement) {
if (! class_exists($class)) {
if (! class_exists($class) && ! interface_exists($class)) {
throw InvalidDefaultTypeReplacer::classDoesNotExist($class);
}

Expand Down

0 comments on commit 8ccc226

Please sign in to comment.