Skip to content

Commit bcfb46d

Browse files
author
Mingeun Kim
committed
refactor: easy contract name
1 parent 6c3b660 commit bcfb46d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/MakeService.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,17 @@ public function handle()
9393

9494
// Whether to create contract
9595
if ($isContract) {
96-
$contractName = str_replace($this->getNameInput(), $this->getNameInput() . 'Contract.php', $this->getNameInput());
96+
$contractName = $this->getNameInput() . 'Contract.php';
9797
$contractPath = str_replace($this->getNameInput() . '.php', 'Contracts/', $path);
98+
9899
$this->makeDirectory($contractPath . $contractName);
99-
$this->files->put($contractPath . $contractName, $this->sortImports($this->buildServiceContractInterface($this->getNameInput())));
100+
101+
$this->files->put($contractPath . $contractName,
102+
$this->sortImports(
103+
$this->buildServiceContractInterface($this->getNameInput())
104+
)
105+
);
106+
100107
$message .= ' and Contract';
101108
}
102109

0 commit comments

Comments
 (0)