Skip to content

Commit a19e23d

Browse files
authored
fix: update phpcs errors (#124)
* feat: add bleeding edge * fix: ignore phpcs warnings for insecure functions
1 parent c92a90f commit a19e23d

9 files changed

Lines changed: 16 additions & 1 deletion

File tree

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
includes:
2+
- phar://phpstan.phar/conf/bleedingEdge.neon
3+
14
parameters:
25
level: 8
36
paths:

src/Console/Command/AbstractCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ private function isInteractiveTerminal(OutputInterface $output): bool
219219
}
220220

221221
// Check if TTY is available
222+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- shell_exec required for TTY detection
222223
$sttyOutput = shell_exec('stty -g 2>/dev/null');
223224
return !empty($sttyOutput);
224225
}

src/Console/Command/Hyva/CompatibilityCheckCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ private function isInteractiveTerminal(OutputInterface $output): bool
405405
}
406406

407407
// Additional check: try to detect if running in a proper TTY
408+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- shell_exec required for TTY detection
408409
$sttyOutput = shell_exec('stty -g 2>/dev/null');
409410
return !empty($sttyOutput);
410411
}

src/Console/Command/System/CheckCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ protected function executeCommand(InputInterface $input, OutputInterface $output
118118
*/
119119
private function getNodeVersion(): string
120120
{
121+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version
121122
exec('node -v 2>/dev/null', $output, $returnCode);
122123
return $returnCode === 0 && !empty($output) ? trim($output[0], 'v') : 'Not installed';
123124
}
@@ -201,6 +202,7 @@ private function getMysqlVersionViaMagento(): ?string
201202
*/
202203
private function getMysqlVersionViaClient(): ?string
203204
{
205+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version
204206
exec('mysql --version 2>/dev/null', $output, $returnCode);
205207
if ($returnCode === 0 && !empty($output)) {
206208
$versionString = $output[0];
@@ -299,6 +301,7 @@ private function getShortOsInfo(): string
299301
*/
300302
private function getComposerVersion(): string
301303
{
304+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version
302305
exec('composer --version 2>/dev/null', $output, $returnCode);
303306
if ($returnCode !== 0 || empty($output)) {
304307
return 'Not installed';
@@ -315,6 +318,7 @@ private function getComposerVersion(): string
315318
*/
316319
private function getNpmVersion(): string
317320
{
321+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version
318322
exec('npm --version 2>/dev/null', $output, $returnCode);
319323
return $returnCode === 0 && !empty($output) ? trim($output[0]) : 'Not installed';
320324
}
@@ -326,6 +330,7 @@ private function getNpmVersion(): string
326330
*/
327331
private function getGitVersion(): string
328332
{
333+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- exec required to check external tool version
329334
exec('git --version 2>/dev/null', $output, $returnCode);
330335
if ($returnCode !== 0 || empty($output)) {
331336
return 'Not installed';
@@ -554,7 +559,7 @@ private function formatSearchEngineVersion(array $info): string
554559

555560
return 'Search Engine Available';
556561
}
557-
562+
558563
/**
559564
* Test Elasticsearch connection and return version info
560565
*

src/Console/Command/Theme/BuildCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ private function isInteractiveTerminal(OutputInterface $output): bool
583583

584584
// Additional check: try to detect if running in a proper TTY
585585
// This is a safer alternative to posix_isatty()
586+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- shell_exec required for TTY detection
586587
$sttyOutput = shell_exec('stty -g 2>/dev/null');
587588
return !empty($sttyOutput);
588589
}

src/Console/Command/Theme/CleanCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ private function isInteractiveTerminal(OutputInterface $output): bool
480480
}
481481

482482
// Additional check: try to detect if running in a proper TTY
483+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- shell_exec required for TTY detection
483484
$sttyOutput = shell_exec('stty -g 2>/dev/null');
484485
return !empty($sttyOutput);
485486
}

src/Service/ThemeBuilder/HyvaThemes/Builder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public function watch(string $themeCode, string $themePath, SymfonyStyle $io, Ou
207207

208208
chdir($tailwindPath);
209209
$exitCode = 0;
210+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- passthru required for interactive watch mode
210211
passthru('npm run watch', $exitCode);
211212

212213
// Check if the command failed

src/Service/ThemeBuilder/MagentoStandard/Builder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ public function watch(string $themeCode, string $themePath, SymfonyStyle $io, Ou
212212
}
213213

214214
$exitCode = 0;
215+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- passthru required for interactive watch mode
215216
passthru('node_modules/.bin/grunt watch', $exitCode);
216217

217218
// Check if the command failed

src/Service/ThemeBuilder/TailwindCSS/Builder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public function watch(string $themeCode, string $themePath, SymfonyStyle $io, Ou
183183

184184
chdir($tailwindPath);
185185
$exitCode = 0;
186+
// phpcs:ignore Magento2.Security.InsecureFunction.Found -- passthru required for interactive watch mode
186187
passthru('npm run watch', $exitCode);
187188

188189
// Check if the command failed

0 commit comments

Comments
 (0)