Skip to content

Commit

Permalink
Merge branch '6.x' into 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Sep 1, 2023
2 parents d60b379 + 8445836 commit 2bd23b0
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/GeneratesCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ protected function buildClass(string $name): string
{
$stub = $this->files->get($this->getListenerStubFile());

return $this->replaceClass(
$this->replaceNamespace($stub, $name), $name
return $this->listener->generatingCode(
$this->replaceClass(
$this->replaceNamespace($stub, $name), $name
), $name
);
}

Expand Down Expand Up @@ -181,15 +183,7 @@ protected function replaceNamespace(string $stub, string $name): string
);
}

return $this->listener->generatingCode($stub, $name);
}

/**
* Get the full namespace for a given class, without the class name.
*/
protected function getNamespace(string $name): string
{
return trim(implode('\\', \array_slice(explode('\\', $name), 0, -1)), '\\');
return $stub;
}

/**
Expand All @@ -210,6 +204,14 @@ class_basename($this->userProviderModel()),
);
}

/**
* Get the full namespace for a given class, without the class name.
*/
protected function getNamespace(string $name): string
{
return trim(implode('\\', \array_slice(explode('\\', $name), 0, -1)), '\\');
}

/**
* Alphabetically sorts the imports for the given stub.
*/
Expand Down

0 comments on commit 2bd23b0

Please sign in to comment.