Issues (12)

src/Console/Commands/HashString.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Squadron\Base\Console\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Hash;
7
8
class HashString extends Command
9
{
10
    protected $signature = 'squadron:utils:hash {value : The string that will be hashed}';
11
    protected $description = 'Get hash of the string';
12
13
    /**
14
     * Execute the console command.
15
     */
16
    public function handle(): void
17
    {
18
        $this->info(sprintf('Hash: %s', Hash::make($this->argument('value'))));
0 ignored issues
show
It seems like $this->argument('value') can also be of type string[]; however, parameter $value of Illuminate\Support\Facades\Hash::make() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

18
        $this->info(sprintf('Hash: %s', Hash::make(/** @scrutinizer ignore-type */ $this->argument('value'))));
Loading history...
19
    }
20
}
21