Your project uses dangerous command injection functions
- Read doc
- Security
- Critical
More information: https://insight.symfony.com/what-we-analyse/php.use_command_injection_function
- if ($overrides !== null) {
- $environment = \array_merge((array) \getenv(), $overrides);
- }
- $process = \proc_open(
- $command,
- [
- 0 => ['pipe', 'r'],
- 1 => ['pipe', 'w'],
- 2 => ['pipe', 'w'],
Your project uses discouraged functions to kill scripts
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.use_exit_function
- return true;
- }
- if (\realpath($_SERVER['SCRIPT_FILENAME'] ?? '') === __FILE__) {
- exit(main());
- }
Your project should use dedicated PHP string functions 6
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.use_string_function
- $path = $file->getPathname();
- $relative = \str_replace('\\', '/', \ltrim(\substr($path, \strlen($root)), '/'));
- $skip = $path === __FILE__;
- foreach ($skipped as $directory) {
- if (\strpos('/' . $relative . '/', $directory) !== false) {
- $skip = true;
- break;
- }
- }
- continue;
- }
- $content = \file_get_contents($path);
- if ($content === false || \strpos(\substr($content, 0, 8192), "\0") !== false) {
- continue;
- }
- $visitor($relative, $content);
- }
- $root,
- $target,
- $patterns,
- &$changed
- ): void {
- if (\strpos($content, 'projek-xyz/') === false) {
- return;
- }
- $replaced = \str_replace($patterns, $target, $content);
- }
- }
- $packageJson = \file_get_contents($root . '/package.json');
- if ($packageJson === false || \strpos($packageJson, '"version": "0.0.0"') === false) {
- $failures[] = 'package.json version is not 0.0.0';
- }
- $attributes = \file_get_contents($root . '/.gitattributes');
- $totalEntries = $attributes === false ? 0 : \preg_match_all('/^.*export-ignore$/m', $attributes);
- string $content
- ) use (
- &$failures,
- $patterns
- ): void {
- if (\strpos($content, $patterns[0]) !== false || \strpos($content, $patterns[1]) !== false) {
- $failures[] = 'residual template reference in ' . $relative;
- }
- });
- }
- string $content
- ) use (
- &$failures,
- $patterns
- ): void {
- if (\strpos($content, $patterns[0]) !== false || \strpos($content, $patterns[1]) !== false) {
- $failures[] = 'residual template reference in ' . $relative;
- }
- });
- }