It seems like argument() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
15
if ($locales = $this->/** @scrutinizer ignore-call */ argument('locales')) {
Loading history...
16
return $this->resolveSelectedLocales($locales);
17
}
18
19
return $this->askLocales($this->getMethod());
20
}
21
22
protected function askLocales(string $method): array
23
{
24
$locales = $this->confirm("Do you want to $method all localizations?") ? $this->getAllLocales() : $this->selectLocales($method);
It seems like confirm() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
24
$locales = $this->/** @scrutinizer ignore-call */ confirm("Do you want to $method all localizations?") ? $this->getAllLocales() : $this->selectLocales($method);
Loading history...
25
26
return $this->resolveSelectedLocales($locales);
27
}
28
29
protected function getAllLocales(): array
30
{
31
return Locales::available();
32
}
33
34
protected function selectLocales(string $method)
35
{
36
return $this->choice("Select localizations to $method (specify the necessary localizations separated by commas):", $this->getAllLocales(), null, null, true);
The expression return Helldar\Support\F...lpers\Str::lower($name) could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
51
}
52
53
protected function validatedLocales(array $locales): array