Your project uses discouraged functions to kill scripts 5
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.use_exit_function
- $buildDirectory = $baseDirectory . '/build';
- $pharFile = $buildDirectory . '/makeFont.phar';
- if (!\is_dir($buildDirectory) && !\mkdir($buildDirectory)) {
- echo "Unable to create the output directory: $buildDirectory.\n";
- exit(1);
- }
- if (\is_file($pharFile) && !\unlink($pharFile)) {
- echo "Unable to remove the old Phar: $pharFile.\n";
- exit(1);
- exit(1);
- }
- if (\is_file($pharFile) && !\unlink($pharFile)) {
- echo "Unable to remove the old Phar: $pharFile.\n";
- exit(1);
- }
- // create phar
- $phar = new Phar($pharFile);
- $phar->setStub("<?php
- declare(strict_types=1);
- if (!\class_exists('Phar')) {
- echo "Enable Phar extension.\n";
- exit(1);
- }
- if (\ini_get('phar.readonly')) {
- echo "Set directive 'phar.readonly=off'.\n";
- exit(1);
- }
- \chmod($pharFile, 0o770);
- echo "$pharFile successfully created.";
- } catch (Exception $e) {
- echo 'Error: ' . $e->getMessage() . "\n";
- exit(1);
- }
- echo "Enable Phar extension.\n";
- exit(1);
- }
- if (\ini_get('phar.readonly')) {
- echo "Set directive 'phar.readonly=off'.\n";
- exit(1);
- }
- function addFiles(Phar $phar, string $baseDirectory, string $sourceDirectory): void
- {
- $offset = \strlen($baseDirectory) + 1;
Your project should not use global variables or functions
- Read doc
- Reliability
- Minor
More information: https://insight.symfony.com/what-we-analyse/php.use_global_variable_or_function
- if (\ini_get('phar.readonly')) {
- echo "Set directive 'phar.readonly=off'.\n";
- exit(1);
- }
- function addFiles(Phar $phar, string $baseDirectory, string $sourceDirectory): void
- {
- $offset = \strlen($baseDirectory) + 1;
- $fullPath = $baseDirectory . $sourceDirectory;
- $flags = FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS;
- $directory = new RecursiveDirectoryIterator($fullPath, $flags);