Skip to content

Commit 6f2d661

Browse files
committed
Remove more helper methods
1 parent fa87e87 commit 6f2d661

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Diff for: src/Commands/MakeCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Larapack\Hooks\Commands;
44

55
use Illuminate\Console\Command;
6+
use Illuminate\Support\Str;
67
use Larapack\Hooks\Hooks;
78

89
class MakeCommand extends Command
@@ -28,7 +29,7 @@ public function fire()
2829
public function handle()
2930
{
3031
$name = $this->argument('name');
31-
$name = kebab_case($name);
32+
$name = Str::kebab($name);
3233

3334
$this->hooks->make($name);
3435

Diff for: src/Hook.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use ArrayAccess;
66
use Illuminate\Contracts\Support\Arrayable;
77
use Illuminate\Filesystem\Filesystem;
8+
use Illuminate\Support\Str;
89

910
class Hook implements ArrayAccess, Arrayable
1011
{
@@ -128,7 +129,7 @@ public function mergeWithJson($path)
128129

129130
public function setAttribute($key, $value)
130131
{
131-
$method = camel_case('set_'.$key.'_attribute');
132+
$method = Str::camel('set_'.$key.'_attribute');
132133

133134
if (method_exists($this, $method)) {
134135
return $this->$method($value);
@@ -139,7 +140,7 @@ public function setAttribute($key, $value)
139140

140141
public function getAttribute($key)
141142
{
142-
$method = camel_case('get_'.$key.'_attribute');
143+
$method = Str::camel('get_'.$key.'_attribute');
143144

144145
if (method_exists($this, $method)) {
145146
return $this->$method();

Diff for: src/Hooks.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Filesystem\Filesystem;
77
use Illuminate\Foundation\Application;
88
use Illuminate\Support\Arr;
9+
use Illuminate\Support\Str;
910
use Symfony\Component\Console\Input\ArrayInput;
1011

1112
class Hooks
@@ -479,7 +480,7 @@ public function disable($name)
479480
*/
480481
public function make($name)
481482
{
482-
$studlyCase = studly_case($name);
483+
$studlyCase = Str::studly($name);
483484

484485
// Check if already exists
485486
if ($this->downloaded($name)) {

0 commit comments

Comments
 (0)