diff --git a/phpstan.neon b/phpstan.neon index 1ff472c..8fc3894 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,3 +1,6 @@ +includes: + - phar://phpstan.phar/conf/bleedingEdge.neon + parameters: level: 8 paths: diff --git a/src/Console/Command/AbstractCommand.php b/src/Console/Command/AbstractCommand.php index 52aa505..495de15 100644 --- a/src/Console/Command/AbstractCommand.php +++ b/src/Console/Command/AbstractCommand.php @@ -219,6 +219,7 @@ private function isInteractiveTerminal(OutputInterface $output): bool } // Check if TTY is available + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- shell_exec required for TTY detection $sttyOutput = shell_exec('stty -g 2>/dev/null'); return !empty($sttyOutput); } diff --git a/src/Console/Command/Hyva/CompatibilityCheckCommand.php b/src/Console/Command/Hyva/CompatibilityCheckCommand.php index 1114496..d3d8dcc 100644 --- a/src/Console/Command/Hyva/CompatibilityCheckCommand.php +++ b/src/Console/Command/Hyva/CompatibilityCheckCommand.php @@ -405,6 +405,7 @@ private function isInteractiveTerminal(OutputInterface $output): bool } // Additional check: try to detect if running in a proper TTY + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- shell_exec required for TTY detection $sttyOutput = shell_exec('stty -g 2>/dev/null'); return !empty($sttyOutput); } diff --git a/src/Console/Command/System/CheckCommand.php b/src/Console/Command/System/CheckCommand.php index 6e3a71f..300cd30 100644 --- a/src/Console/Command/System/CheckCommand.php +++ b/src/Console/Command/System/CheckCommand.php @@ -118,6 +118,7 @@ protected function executeCommand(InputInterface $input, OutputInterface $output */ private function getNodeVersion(): string { + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version exec('node -v 2>/dev/null', $output, $returnCode); return $returnCode === 0 && !empty($output) ? trim($output[0], 'v') : 'Not installed'; } @@ -201,6 +202,7 @@ private function getMysqlVersionViaMagento(): ?string */ private function getMysqlVersionViaClient(): ?string { + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version exec('mysql --version 2>/dev/null', $output, $returnCode); if ($returnCode === 0 && !empty($output)) { $versionString = $output[0]; @@ -299,6 +301,7 @@ private function getShortOsInfo(): string */ private function getComposerVersion(): string { + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version exec('composer --version 2>/dev/null', $output, $returnCode); if ($returnCode !== 0 || empty($output)) { return 'Not installed'; @@ -315,6 +318,7 @@ private function getComposerVersion(): string */ private function getNpmVersion(): string { + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version exec('npm --version 2>/dev/null', $output, $returnCode); return $returnCode === 0 && !empty($output) ? trim($output[0]) : 'Not installed'; } @@ -326,6 +330,7 @@ private function getNpmVersion(): string */ private function getGitVersion(): string { + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version exec('git --version 2>/dev/null', $output, $returnCode); if ($returnCode !== 0 || empty($output)) { return 'Not installed'; @@ -554,7 +559,7 @@ private function formatSearchEngineVersion(array $info): string return 'Search Engine Available'; } - + /** * Test Elasticsearch connection and return version info * diff --git a/src/Console/Command/Theme/BuildCommand.php b/src/Console/Command/Theme/BuildCommand.php index a3d39fd..70160b8 100644 --- a/src/Console/Command/Theme/BuildCommand.php +++ b/src/Console/Command/Theme/BuildCommand.php @@ -583,6 +583,7 @@ private function isInteractiveTerminal(OutputInterface $output): bool // Additional check: try to detect if running in a proper TTY // This is a safer alternative to posix_isatty() + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- shell_exec required for TTY detection $sttyOutput = shell_exec('stty -g 2>/dev/null'); return !empty($sttyOutput); } diff --git a/src/Console/Command/Theme/CleanCommand.php b/src/Console/Command/Theme/CleanCommand.php index 352d06c..466c100 100644 --- a/src/Console/Command/Theme/CleanCommand.php +++ b/src/Console/Command/Theme/CleanCommand.php @@ -480,6 +480,7 @@ private function isInteractiveTerminal(OutputInterface $output): bool } // Additional check: try to detect if running in a proper TTY + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- shell_exec required for TTY detection $sttyOutput = shell_exec('stty -g 2>/dev/null'); return !empty($sttyOutput); } diff --git a/src/Service/ThemeBuilder/HyvaThemes/Builder.php b/src/Service/ThemeBuilder/HyvaThemes/Builder.php index 6aed047..9903fe9 100644 --- a/src/Service/ThemeBuilder/HyvaThemes/Builder.php +++ b/src/Service/ThemeBuilder/HyvaThemes/Builder.php @@ -207,6 +207,7 @@ public function watch(string $themeCode, string $themePath, SymfonyStyle $io, Ou chdir($tailwindPath); $exitCode = 0; + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- passthru required for interactive watch mode passthru('npm run watch', $exitCode); // Check if the command failed diff --git a/src/Service/ThemeBuilder/MagentoStandard/Builder.php b/src/Service/ThemeBuilder/MagentoStandard/Builder.php index f783ac8..722d49f 100644 --- a/src/Service/ThemeBuilder/MagentoStandard/Builder.php +++ b/src/Service/ThemeBuilder/MagentoStandard/Builder.php @@ -212,6 +212,7 @@ public function watch(string $themeCode, string $themePath, SymfonyStyle $io, Ou } $exitCode = 0; + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- passthru required for interactive watch mode passthru('node_modules/.bin/grunt watch', $exitCode); // Check if the command failed diff --git a/src/Service/ThemeBuilder/TailwindCSS/Builder.php b/src/Service/ThemeBuilder/TailwindCSS/Builder.php index 766d2a4..0f40b56 100644 --- a/src/Service/ThemeBuilder/TailwindCSS/Builder.php +++ b/src/Service/ThemeBuilder/TailwindCSS/Builder.php @@ -183,6 +183,7 @@ public function watch(string $themeCode, string $themePath, SymfonyStyle $io, Ou chdir($tailwindPath); $exitCode = 0; + // phpcs:ignore Magento2.Security.InsecureFunction.Found -- passthru required for interactive watch mode passthru('npm run watch', $exitCode); // Check if the command failed