It seems like $filename can also be of type string[]; however, parameter $subject of preg_match() 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
17
if (preg_match('/\.y[a]{0,1}ml$/i', /** @scrutinizer ignore-type */ $filename)) {
Loading history...
18
$content = $this->createYamlContent($generator);
19
} else {
20
$content = $this->createJsonContent($generator);
21
}
22
if (@file_put_contents($this->argument('filename'), $content)) {
It seems like $this->argument('filename') can also be of type string[]; however, parameter $filename of file_put_contents() 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
22
if (@file_put_contents(/** @scrutinizer ignore-type */ $this->argument('filename'), $content)) {