5
5
use Carbon \Carbon ;
6
6
use Illuminate \Filesystem \Filesystem ;
7
7
use Illuminate \Foundation \Application ;
8
+ use Illuminate \Support \Arr ;
9
+ use Illuminate \Support \Str ;
8
10
use Symfony \Component \Console \Input \ArrayInput ;
9
11
10
12
class Hooks
@@ -478,7 +480,7 @@ public function disable($name)
478
480
*/
479
481
public function make ($ name )
480
482
{
481
- $ studlyCase = studly_case ($ name );
483
+ $ studlyCase = Str:: studly ($ name );
482
484
483
485
// Check if already exists
484
486
if ($ this ->downloaded ($ name )) {
@@ -506,9 +508,9 @@ protected function makeStubFiles($name)
506
508
{
507
509
$ replaces = [
508
510
'kebab-case ' => $ name ,
509
- 'snake_case ' => snake_case (str_replace ('- ' , '_ ' , $ name )),
510
- 'camelCase ' => camel_case (str_replace ('- ' , '_ ' , $ name )),
511
- 'StudlyCase ' => studly_case (str_replace ('- ' , '_ ' , $ name )),
511
+ 'snake_case ' => Str:: snake (str_replace ('- ' , '_ ' , $ name )),
512
+ 'camelCase ' => Str:: camel (str_replace ('- ' , '_ ' , $ name )),
513
+ 'StudlyCase ' => Str:: studly (str_replace ('- ' , '_ ' , $ name )),
512
514
'MIGRATION_DATE_TIME ' => $ this ->migrationDateTimeString (),
513
515
];
514
516
@@ -803,8 +805,8 @@ public function readComposerHooks($file = null)
803
805
$ composer = json_decode ($ this ->filesystem ->get ($ file ), true );
804
806
}
805
807
806
- foreach (array_get ($ composer , 'packages ' , []) as $ package ) {
807
- if (array_get ($ package , 'notification-url ' ) == static ::$ remote .'/downloads ' ) {
808
+ foreach (Arr:: get ($ composer , 'packages ' , []) as $ package ) {
809
+ if (Arr:: get ($ package , 'notification-url ' ) == static ::$ remote .'/downloads ' ) {
808
810
$ hooks [$ package ['name ' ]] = new Hook ($ package );
809
811
}
810
812
}
@@ -815,7 +817,7 @@ public function readComposerHooks($file = null)
815
817
public function readLocalHooks ()
816
818
{
817
819
$ hooks = [];
818
- $ directories = array_except ($ this ->filesystem ->directories (base_path ('hooks ' )), ['. ' , '.. ' ]);
820
+ $ directories = Arr:: except ($ this ->filesystem ->directories (base_path ('hooks ' )), ['. ' , '.. ' ]);
819
821
foreach ($ directories as $ directory ) {
820
822
if (!$ this ->filesystem ->exists ($ directory .'/composer.json ' )) {
821
823
continue ;
@@ -879,8 +881,8 @@ public function checkForUpdates()
879
881
$ hooks = [];
880
882
$ results = json_decode ($ output , true );
881
883
882
- foreach (array_get ($ results , 'installed ' , []) as $ package ) {
883
- if (isset ($ this ->hooks [array_get ($ package , 'name ' )])) {
884
+ foreach (Arr:: get ($ results , 'installed ' , []) as $ package ) {
885
+ if (isset ($ this ->hooks [Arr:: get ($ package , 'name ' )])) {
884
886
$ outdated [$ package ['name ' ]] = $ package ['latest ' ];
885
887
$ hook = $ this ->hooks [$ package ['name ' ]];
886
888
$ hook ->setLatest ($ package ['latest ' ]);
0 commit comments