Your project uses discouraged functions to kill scripts 5

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

in create_phar.php, line 16
  1. declare(strict_types=1);
  2. if (!\class_exists('Phar')) {
  3. echo "Enable Phar extension.\n";
  4. exit(1);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Laurent Muller
  5. }
  6. if (\ini_get('phar.readonly')) {
  7. echo "Set directive 'phar.readonly=off'.\n";
  8. exit(1);
  9. }
in create_phar.php, line 20
  1. echo "Enable Phar extension.\n";
  2. exit(1);
  3. }
  4. if (\ini_get('phar.readonly')) {
  5. echo "Set directive 'phar.readonly=off'.\n";
  6. exit(1);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Laurent Muller
  7. }
  8. function addFiles(Phar $phar, string $baseDirectory, string $sourceDirectory): void
  9. {
  10. $offset = \strlen($baseDirectory) + 1;
in create_phar.php, line 49
  1. $buildDirectory = $baseDirectory . '/build';
  2. $pharFile = $buildDirectory . '/makeFont.phar';
  3. if (!\is_dir($buildDirectory) && !\mkdir($buildDirectory)) {
  4. echo "Unable to create the output directory: $buildDirectory.\n";
  5. exit(1);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Laurent Muller
  6. }
  7. if (\is_file($pharFile) && !\unlink($pharFile)) {
  8. echo "Unable to remove the old Phar: $pharFile.\n";
  9. exit(1);
in create_phar.php, line 54
  1. exit(1);
  2. }
  3. if (\is_file($pharFile) && !\unlink($pharFile)) {
  4. echo "Unable to remove the old Phar: $pharFile.\n";
  5. exit(1);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Laurent Muller
  6. }
  7. // create phar
  8. $phar = new Phar($pharFile);
  9. $phar->setStub("<?php
in create_phar.php, line 79
  1. \chmod($pharFile, 0o770);
  2. echo "$pharFile successfully created.";
  3. } catch (Exception $e) {
  4. echo 'Error: ' . $e->getMessage() . "\n";
  5. exit(1);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Laurent Muller
  6. }

Your project should not use global variables or functions

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

in create_phar.php, line 23
  1. if (\ini_get('phar.readonly')) {
  2. echo "Set directive 'phar.readonly=off'.\n";
  3. exit(1);
  4. }
  5. function addFiles(Phar $phar, string $baseDirectory, string $sourceDirectory): void

    addFiles() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Read doc Open Issue Permalink
    Last edited by Laurent Muller
  6. {
  7. $offset = \strlen($baseDirectory) + 1;
  8. $fullPath = $baseDirectory . $sourceDirectory;
  9. $flags = FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS;
  10. $directory = new RecursiveDirectoryIterator($fullPath, $flags);