1 | <?php |
||
17 | final class WindowsSystem |
||
18 | { |
||
19 | const PATH_SEPARATOR = ';'; |
||
20 | |||
21 | const FORBIDDEN_CHARS = '<>:"/\|?*'; |
||
22 | |||
23 | /** |
||
24 | * @var WindowsSystem |
||
25 | */ |
||
26 | private static $instance; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private $exts; |
||
32 | |||
33 | /** |
||
34 | * an instance is bootstrapped in to prevent initialization overhead |
||
35 | * |
||
36 | * @return WindowsSystem |
||
37 | */ |
||
38 | private static function getInstance() |
||
44 | |||
45 | private function __construct() |
||
48 | |||
49 | /** |
||
50 | * @return array keys are uppercase extensions incl. dot |
||
51 | */ |
||
52 | private function getExecuteableExtesions() |
||
61 | |||
62 | /** |
||
63 | * a name is executable based on it's extension |
||
64 | * |
||
65 | * @param string $name |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | public static function isExecutableName($name) |
||
86 | |||
87 | /** |
||
88 | * a program (by it's basename) is available on system for execution |
||
89 | * |
||
90 | * @param string $program |
||
91 | * @return bool |
||
92 | */ |
||
93 | public static function isProgramInstalled($program) |
||
126 | } |
||
127 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.