55use Carbon \Carbon ;
66use Illuminate \Filesystem \Filesystem ;
77use Illuminate \Foundation \Application ;
8+ use Illuminate \Support \Arr ;
9+ use Illuminate \Support \Str ;
810use Symfony \Component \Console \Input \ArrayInput ;
911
1012class Hooks
@@ -478,7 +480,7 @@ public function disable($name)
478480 */
479481 public function make ($ name )
480482 {
481- $ studlyCase = studly_case ($ name );
483+ $ studlyCase = Str:: studly ($ name );
482484
483485 // Check if already exists
484486 if ($ this ->downloaded ($ name )) {
@@ -506,9 +508,9 @@ protected function makeStubFiles($name)
506508 {
507509 $ replaces = [
508510 '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 )),
512514 'MIGRATION_DATE_TIME ' => $ this ->migrationDateTimeString (),
513515 ];
514516
@@ -803,8 +805,8 @@ public function readComposerHooks($file = null)
803805 $ composer = json_decode ($ this ->filesystem ->get ($ file ), true );
804806 }
805807
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 ' ) {
808810 $ hooks [$ package ['name ' ]] = new Hook ($ package );
809811 }
810812 }
@@ -815,7 +817,7 @@ public function readComposerHooks($file = null)
815817 public function readLocalHooks ()
816818 {
817819 $ hooks = [];
818- $ directories = array_except ($ this ->filesystem ->directories (base_path ('hooks ' )), ['. ' , '.. ' ]);
820+ $ directories = Arr:: except ($ this ->filesystem ->directories (base_path ('hooks ' )), ['. ' , '.. ' ]);
819821 foreach ($ directories as $ directory ) {
820822 if (!$ this ->filesystem ->exists ($ directory .'/composer.json ' )) {
821823 continue ;
@@ -879,8 +881,8 @@ public function checkForUpdates()
879881 $ hooks = [];
880882 $ results = json_decode ($ output , true );
881883
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 ' )])) {
884886 $ outdated [$ package ['name ' ]] = $ package ['latest ' ];
885887 $ hook = $ this ->hooks [$ package ['name ' ]];
886888 $ hook ->setLatest ($ package ['latest ' ]);
0 commit comments