11<?php
22
3+ declare (strict_types=1 );
4+
35namespace Povils \PHPMND \Console ;
46
57use Povils \PHPMND \Detector ;
1719use Symfony \Component \Console \Input \InputOption ;
1820use Symfony \Component \Console \Output \OutputInterface ;
1921
20- /**
21- * Class Command
22- *
23- * @package Povils\PHPMND\Console
24- */
2522class Command extends BaseCommand
2623{
2724 const EXIT_CODE_SUCCESS = 0 ;
@@ -232,7 +229,7 @@ private function getCSVOption(InputInterface $input, string $option): array
232229 $ result = $ input ->getOption ($ option );
233230 if (false === is_array ($ result )) {
234231 return array_filter (
235- explode (', ' , $ result ),
232+ explode (', ' , ( string ) $ result ),
236233 function ($ value ) {
237234 return false === empty ($ value );
238235 }
@@ -270,7 +267,7 @@ private function getFileOption($filename)
270267 {
271268 $ filename = $ this ->convertFileDescriptorLink ($ filename );
272269
273- if (file_exists ($ filename )) {
270+ if (is_string ( $ filename ) && file_exists ($ filename )) {
274271 return array_map ('trim ' , file ($ filename ));
275272 }
276273
@@ -279,7 +276,7 @@ private function getFileOption($filename)
279276
280277 private function convertFileDescriptorLink ($ path )
281278 {
282- if (strpos ($ path , '/dev/fd ' ) === 0 ) {
279+ if (is_string ( $ path ) && strpos ($ path , '/dev/fd ' ) === 0 ) {
283280 return str_replace ('/dev/fd ' , 'php://fd ' , $ path );
284281 }
285282
0 commit comments