diff --git a/src/Commands/AppendContentCommand.php b/src/Commands/AppendContentCommand.php index 0f40fd2..f902580 100644 --- a/src/Commands/AppendContentCommand.php +++ b/src/Commands/AppendContentCommand.php @@ -3,6 +3,7 @@ namespace Hesto\Core\Commands; use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Str; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; @@ -53,7 +54,6 @@ public function fire() if ($this->putContent($fullPath, $this->compileContent($fullPath, $setting))) { $this->getInfoMessage($fullPath); } - } return true; @@ -71,7 +71,7 @@ protected function compileContent($path, $setting) //It should be compile method $originalContent = $this->files->get($path); $content = $this->replaceNames($this->files->get($setting['stub'])); - if( ! str_contains(trim($originalContent), trim($content))) { + if (!Str::contains(trim($originalContent), trim($content))) { if ($setting['prefix']) { $stub = $content . $setting['search']; @@ -84,4 +84,4 @@ protected function compileContent($path, $setting) //It should be compile method return $originalContent; } -} +} \ No newline at end of file diff --git a/src/Commands/InstallAndReplaceCommand.php b/src/Commands/InstallAndReplaceCommand.php index 42cc5ae..b5569f9 100644 --- a/src/Commands/InstallAndReplaceCommand.php +++ b/src/Commands/InstallAndReplaceCommand.php @@ -4,6 +4,7 @@ use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Str; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Hesto\Core\Traits\CanReplaceKeywords; @@ -102,10 +103,10 @@ public function contentExists($path, $stub) $originalContent = $this->files->get($path); $content = $this->replaceNames($this->files->get($stub)); - if(str_contains(trim($originalContent), trim($content))) { + if (Str::contains(trim($originalContent), trim($content))) { return true; } return false; } -} +} \ No newline at end of file