Skip to content

Commit

Permalink
use str::of instead of str()
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Allen committed Aug 13, 2024
1 parent 6c745ce commit a46820e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Console/CheckSQLGrammerDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


use Illuminate\Console\Command;

use Illuminate\Support\Str;
/**
* There is an international date format Y-m-d that is supposed to be universal, however the MSSQL implementation is flawed
* and is not universal and incorrect interprets it as Y-d-m which is beyond idiotic.
Expand Down Expand Up @@ -65,17 +65,17 @@ public function handle()
{
$filetocheck = base_path('vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\SqlServerGrammar.php');
if (file_exists($filetocheck)){
$file_txt = Str(file_get_contents($filetocheck));
$file_txt = Str::of(file_get_contents($filetocheck));
$datestr = 'return \'Y-m-d H:i:s.v\';';
if ($file_txt->contains($datestr)){
if ($this->option('update')){
$UpdatedFile_txt = $file_txt->replace($datestr, 'return \'Ymd H:i:s.v\';');
file_put_contents($filetocheck,$UpdatedFile_txt);

$this->comment("
**********************************
**********************************
Incorrect Date Format value found
**********************************
**********************************
File on disk: $filetocheck");
$this->info('
------------------
Expand Down

0 comments on commit a46820e

Please sign in to comment.