Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Nov 21, 2023
1 parent 660a3f4 commit ffbe9e6
Show file tree
Hide file tree
Showing 39 changed files with 193 additions and 183 deletions.
6 changes: 3 additions & 3 deletions src/Annotation/DocblockAnnotationParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ final class DocblockAnnotationParser
/**
* @var array<string, mixed>
*/
private array $ignoredAnnotationsAsKeys;
private readonly array $ignoredAnnotationsAsKeys;

/**
* @param string[] $ignoredAnnotations
*/
public function __construct(
private DocBlockFactoryInterface $factory,
private Formatter $tagsFormatter,
private readonly DocBlockFactoryInterface $factory,
private readonly Formatter $tagsFormatter,
array $ignoredAnnotations,
) {
$this->ignoredAnnotationsAsKeys = array_flip($ignoredAnnotations);
Expand Down
6 changes: 3 additions & 3 deletions src/Box.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,12 @@ private function processContents(array $files): array

// Keep the fully qualified call here since this function may be executed without the right autoloading
// mechanism
\KevinGH\Box\register_aliases();
register_aliases();
if (true === \KevinGH\Box\is_parallel_processing_enabled()) {
\KevinGH\Box\register_error_handler();
register_error_handler();
}

$contents = \Fidry\FileSystem\FS::getFileContents($file);
$contents = FS::getFileContents($file);

$local = $mapFile($file);

Expand Down
2 changes: 1 addition & 1 deletion src/Compactor/Compactors.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class Compactors implements Compactor, Countable
/**
* @var Compactor[]
*/
private array $compactors;
private readonly array $compactors;

private ?PhpScoper $scoperCompactor = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Compactor/FileExtensionCompactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class FileExtensionCompactor extends BaseCompactor
/**
* @var string[]
*/
private array $extensions;
private readonly array $extensions;

/**
* @param string[] $extensions the list of supported file extensions
Expand Down
2 changes: 1 addition & 1 deletion src/Compactor/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
final class Php extends FileExtensionCompactor
{
public function __construct(
private ?DocblockAnnotationParser $annotationParser,
private readonly ?DocblockAnnotationParser $annotationParser,
array $extensions = ['php'],
) {
parent::__construct($extensions);
Expand Down
2 changes: 1 addition & 1 deletion src/Compactor/PhpScoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* @private
*/
final class PhpScoper implements Compactor
final readonly class PhpScoper implements Compactor
{
public function __construct(private Scoper $scoper)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Compactor/Placeholder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class Placeholder implements Compactor
/**
* @var scalar[]
*/
private array $placeholders;
private readonly array $placeholders;

/**
* @param scalar[] $placeholders
Expand Down
2 changes: 1 addition & 1 deletion src/Composer/CompilerPsrLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
final class CompilerPsrLogger extends AbstractLogger
{
public function __construct(
private CompilerLogger $decoratedLogger,
private readonly CompilerLogger $decoratedLogger,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Composer/ComposerFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

final class ComposerFile
{
private ?string $path;
private array $contents;
private readonly ?string $path;
private readonly array $contents;

public static function createEmpty(): self
{
Expand Down
8 changes: 4 additions & 4 deletions src/Composer/ComposerFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use function array_map;
use function array_values;

final class ComposerFiles
final readonly class ComposerFiles
{
public static function createEmpty(): self
{
Expand All @@ -30,9 +30,9 @@ public static function createEmpty(): self
}

public function __construct(
private readonly ComposerFile $composerJson,
private readonly ComposerFile $composerLock,
private readonly ComposerFile $installedJson,
private ComposerFile $composerJson,
private ComposerFile $composerLock,
private ComposerFile $installedJson,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Composer/ComposerOrchestrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public static function create(): self
}

public function __construct(
private ComposerProcessFactory $processFactory,
private LoggerInterface $logger,
private FileSystem $fileSystem,
private readonly ComposerProcessFactory $processFactory,
private readonly LoggerInterface $logger,
private readonly FileSystem $fileSystem,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Composer/ComposerProcessFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public static function create(
* @param Closure():string $composerExecutableFactory
*/
public function __construct(
private Closure $composerExecutableFactory,
private readonly Closure $composerExecutableFactory,
private ?string $verbosity,
private bool $ansi,
private array $defaultEnvironmentVariables,
private readonly bool $ansi,
private readonly array $defaultEnvironmentVariables,
) {
}

Expand Down
70 changes: 35 additions & 35 deletions src/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ final class Configuration
private const STUB_KEY = 'stub';
private const TIMESTAMP = 'timestamp';

private ?string $mainScriptPath;
private ?string $mainScriptContents;
private readonly ?string $mainScriptPath;
private readonly ?string $mainScriptContents;
private ?string $composerBin = null;

public static function create(?string $file, stdClass $raw): self
Expand Down Expand Up @@ -422,41 +422,41 @@ public static function create(?string $file, stdClass $raw): self
* @param string[] $recommendations
*/
private function __construct(
private ?string $file,
private string $alias,
private string $basePath,
private ComposerFile $composerJson,
private ComposerFile $composerLock,
private array $files,
private array $binaryFiles,
private bool $autodiscoveredFiles,
private bool $dumpAutoload,
private bool $excludeComposerFiles,
private bool $excludeDevFiles,
private Compactors|array $compactors,
private CompressionAlgorithm $compressionAlgorithm,
private int|string|null $fileMode,
private readonly ?string $file,
private readonly string $alias,
private readonly string $basePath,
private readonly ComposerFile $composerJson,
private readonly ComposerFile $composerLock,
private readonly array $files,
private readonly array $binaryFiles,
private readonly bool $autodiscoveredFiles,
private readonly bool $dumpAutoload,
private readonly bool $excludeComposerFiles,
private readonly bool $excludeDevFiles,
private readonly Compactors|array $compactors,
private readonly CompressionAlgorithm $compressionAlgorithm,
private readonly int|string|null $fileMode,
?string $mainScriptPath,
?string $mainScriptContents,
private MapFile $fileMapper,
private mixed $metadata,
private string $tmpOutputPath,
private string $outputPath,
private ?string $privateKeyPassphrase,
private ?string $privateKeyPath,
private bool $promptForPrivateKey,
private array $processedReplacements,
private ?string $shebang,
private SigningAlgorithm $signingAlgorithm,
private ?string $stubBannerContents,
private ?string $stubBannerPath,
private ?string $stubPath,
private bool $isInterceptFileFuncs,
private bool $isStubGenerated,
private ?DateTimeImmutable $timestamp,
private bool $checkRequirements,
private array $warnings,
private array $recommendations,
private readonly MapFile $fileMapper,
private readonly mixed $metadata,
private readonly string $tmpOutputPath,
private readonly string $outputPath,
private readonly ?string $privateKeyPassphrase,
private readonly ?string $privateKeyPath,
private readonly bool $promptForPrivateKey,
private readonly array $processedReplacements,
private readonly ?string $shebang,
private readonly SigningAlgorithm $signingAlgorithm,
private readonly ?string $stubBannerContents,
private readonly ?string $stubBannerPath,
private readonly ?string $stubPath,
private readonly bool $isInterceptFileFuncs,
private readonly bool $isStubGenerated,
private readonly ?DateTimeImmutable $timestamp,
private readonly bool $checkRequirements,
private readonly array $warnings,
private readonly array $recommendations,
) {
if (null === $mainScriptPath) {
Assert::null($mainScriptContents);
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/ConfigurationLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
/**
* @private
*/
final class ConfigurationLoader
final readonly class ConfigurationLoader
{
private const SCHEMA_FILE = __DIR__.'/../../res/schema.json';

public function __construct(private readonly Json $json = new Json())
public function __construct(private Json $json = new Json())
{
}

Expand Down
70 changes: 35 additions & 35 deletions src/Configuration/ExportableConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @internal
*/
final class ExportableConfiguration
final readonly class ExportableConfiguration
{
public static function create(Configuration $configuration): self
{
Expand Down Expand Up @@ -114,40 +114,40 @@ private static function createPathNormalizer(string $basePath): Closure

/** @noinspection PhpPropertyOnlyWrittenInspection */
private function __construct(
private readonly ?string $file,
private readonly string $alias,
private readonly string $basePath,
private readonly ComposerFile $composerJson,
private readonly ComposerFile $composerLock,
private readonly array $files,
private readonly array $binaryFiles,
private readonly bool $autodiscoveredFiles,
private readonly bool $dumpAutoload,
private readonly bool $excludeComposerFiles,
private readonly bool $excludeDevFiles,
private readonly Compactors|array $compactors,
private readonly string $compressionAlgorithm,
private readonly int|string|null $fileMode,
private readonly ?string $mainScriptPath,
private readonly ?string $mainScriptContents,
private readonly MapFile $fileMapper,
private readonly mixed $metadata,
private readonly string $tmpOutputPath,
private readonly string $outputPath,
private readonly ?string $privateKeyPassphrase,
private readonly ?string $privateKeyPath,
private readonly bool $promptForPrivateKey,
private readonly array $processedReplacements,
private readonly ?string $shebang,
private readonly string $signingAlgorithm,
private readonly ?string $stubBannerContents,
private readonly ?string $stubBannerPath,
private readonly ?string $stubPath,
private readonly bool $isInterceptFileFuncs,
private readonly bool $isStubGenerated,
private readonly bool $checkRequirements,
private readonly array $warnings,
private readonly array $recommendations,
private ?string $file,
private string $alias,
private string $basePath,
private ComposerFile $composerJson,
private ComposerFile $composerLock,
private array $files,
private array $binaryFiles,
private bool $autodiscoveredFiles,
private bool $dumpAutoload,
private bool $excludeComposerFiles,
private bool $excludeDevFiles,
private Compactors|array $compactors,
private string $compressionAlgorithm,
private int|string|null $fileMode,
private ?string $mainScriptPath,
private ?string $mainScriptContents,
private MapFile $fileMapper,
private mixed $metadata,
private string $tmpOutputPath,
private string $outputPath,
private ?string $privateKeyPassphrase,
private ?string $privateKeyPath,
private bool $promptForPrivateKey,
private array $processedReplacements,
private ?string $shebang,
private string $signingAlgorithm,
private ?string $stubBannerContents,
private ?string $stubBannerPath,
private ?string $stubPath,
private bool $isInterceptFileFuncs,
private bool $isStubGenerated,
private bool $checkRequirements,
private array $warnings,
private array $recommendations,
) {
}

Expand Down
Loading

0 comments on commit ffbe9e6

Please sign in to comment.