Your project should use dedicated PHP string functions 6

More information: https://insight.symfony.com/what-we-analyse/php.use_string_function

in scripts/init.php, line 386
  1. continue;
  2. }
  3. $content = \file_get_contents($path);
  4. if ($content === false || \strpos(\substr($content, 0, 8192), "\0") !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  5. continue;
  6. }
  7. $visitor($relative, $content);
  8. }
in scripts/init.php, line 606
  1. }
  2. }
  3. $packageJson = \file_get_contents($root . '/package.json');
  4. if ($packageJson === false || \strpos($packageJson, '"version": "0.0.0"') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  5. $failures[] = 'package.json version is not 0.0.0';
  6. }
  7. $attributes = \file_get_contents($root . '/.gitattributes');
  8. $totalEntries = $attributes === false ? 0 : \preg_match_all('/^.*export-ignore$/m', $attributes);
in scripts/init.php, line 644
  1. string $content
  2. ) use (
  3. &$failures,
  4. $patterns
  5. ): void {
  6. if (\strpos($content, $patterns[0]) !== false || \strpos($content, $patterns[1]) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  7. $failures[] = 'residual template reference in ' . $relative;
  8. }
  9. });
  10. }
in scripts/init.php, line 415
  1. $root,
  2. $target,
  3. $patterns,
  4. &$changed
  5. ): void {
  6. if (\strpos($content, 'projek-xyz/') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  7. return;
  8. }
  9. $replaced = \str_replace($patterns, $target, $content);
in scripts/init.php, line 644
  1. string $content
  2. ) use (
  3. &$failures,
  4. $patterns
  5. ): void {
  6. if (\strpos($content, $patterns[0]) !== false || \strpos($content, $patterns[1]) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  7. $failures[] = 'residual template reference in ' . $relative;
  8. }
  9. });
  10. }
in scripts/init.php, line 374
  1. $path = $file->getPathname();
  2. $relative = \str_replace('\\', '/', \ltrim(\substr($path, \strlen($root)), '/'));
  3. $skip = $path === __FILE__;
  4. foreach ($skipped as $directory) {
  5. if (\strpos('/' . $relative . '/', $directory) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  6. $skip = true;
  7. break;
  8. }
  9. }