Skip to content

Commit cd17f99

Browse files
authored
Merge pull request #135 from tabacitu/add-kebab-case-vendor-and-package-names
Allow kebab-case to be used for package and vendor names - fixes #132
2 parents 8462a4a + e64f22d commit cd17f99

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/Commands/NewPackage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,15 @@ public function handle()
123123
':uc:package',
124124
':lc:vendor',
125125
':lc:package',
126+
':kc:vendor',
127+
':kc:package',
126128
], [
127129
$this->conveyor->vendorStudly(),
128130
$this->conveyor->packageStudly(),
129131
strtolower($this->conveyor->vendor()),
130132
strtolower($this->conveyor->package()),
133+
$this->conveyor->vendorKebab(),
134+
$this->conveyor->packageKebab(),
131135
]);
132136

133137
if ($this->option('i')) {

src/Conveyor.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ public function vendorStudly()
5252
return Str::studly($this->vendor());
5353
}
5454

55+
/**
56+
* Get the vendor name converted to kebab-case.
57+
*
58+
* @return string|RuntimeException
59+
*/
60+
public function vendorKebab()
61+
{
62+
return Str::kebab($this->vendor());
63+
}
64+
5565
/**
5666
* Set or get the package name.
5767
*
@@ -81,6 +91,16 @@ public function packageStudly()
8191
return Str::studly($this->package());
8292
}
8393

94+
/**
95+
* Get the package name converted to kebab-case.
96+
*
97+
* @return string|RuntimeException
98+
*/
99+
public function packageKebab()
100+
{
101+
return Str::kebab($this->package());
102+
}
103+
84104
/**
85105
* Download the skeleton package.
86106
*/

0 commit comments

Comments
 (0)