Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- feat!: rename package to `php-forge/scaffold` with namespace `PHPForge\Scaffold`; update `require`, `allow-plugins` and class references.
- feat!: overhaul sync, merge modes and CLI; enforce strict manifests and locks; support Console 8 and drop Composer runtime dependency.
- feat: add docblocks for constructors across multiple classes to enhance code clarity.

## 0.2.0 July 04, 2026

Expand Down
2 changes: 2 additions & 0 deletions src/Config/InstalledPackages.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
final readonly class InstalledPackages
{
/**
* Creates an installed-package view from normalized Composer metadata, or an unknown view from `null`.
*
* @param array<string, array{version: string|null, path: string|null}>|null $packages Installed packages keyed by
* name, with their pretty version and absolute install path, or `null` when the installed packages are unknown.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Config/ProjectConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
final readonly class ProjectConfig
{
/**
* Creates consumer settings from scaffold configuration and the configured vendor-directory value.
*
* @param list<string> $allowedPackages Package names allowed to write scaffold files, in declaration order.
* @param bool $auto Whether the Composer hooks scaffold automatically.
* @param int $ignoredEntries Number of non-string `allowed-packages` entries that were ignored.
Expand Down
2 changes: 2 additions & 0 deletions src/Config/ProjectContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
final readonly class ProjectContext
{
/**
* Creates a project context from its resolved filesystem and Composer metadata.
*
* @param string $projectRoot Absolute path to the project root.
* @param string $vendorDir Absolute path to the Composer vendor directory.
* @param ProjectConfig $config Consumer settings from the project `composer.json`.
Expand Down
2 changes: 2 additions & 0 deletions src/Config/ProviderPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
final readonly class ProviderPackage
{
/**
* Creates an installed provider descriptor.
*
* @param string $name Composer package name.
* @param string $prettyVersion Installed version recorded in `scaffold-lock.json`.
* @param string|null $installPath Absolute install path, or `null` for a package without files, such as a
Expand Down
6 changes: 3 additions & 3 deletions src/Console/Command/AbstractScaffoldCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ abstract class AbstractScaffoldCommand extends Command
abstract protected function handle(InputInterface $input, SymfonyOutputWriter $out, string $projectRoot): int;

/**
* Validates the input, resolves the project root and runs {@see self::handle()}.
* Validates the input, resolves the project root and runs {@see AbstractScaffoldCommand::handle()}.
*
* @param InputInterface $input Command input that may carry the global `--working-dir` option.
* @param OutputInterface $output Console output that receives the command output and the error messages.
*
* @return int Exit code of {@see self::handle()}; `1` when the project root is not found or a runtime error is
* reported; `2` when the input is invalid.
* @return int Exit code of {@see AbstractScaffoldCommand::handle()}; `1` when the project root is not found or a
* runtime error is reported; `2` when the input is invalid.
*/
final protected function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down
2 changes: 2 additions & 0 deletions src/Console/ComposerIoWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
final readonly class ComposerIoWriter implements OutputWriter
{
/**
* Creates a writer for Composer IO.
*
* @param IOInterface $io Composer IO that receives the messages.
*/
public function __construct(private IOInterface $io) {}
Expand Down
2 changes: 2 additions & 0 deletions src/Console/SymfonyOutputWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
final readonly class SymfonyOutputWriter implements OutputWriter
{
/**
* Creates a writer for a Symfony Console output.
*
* @param OutputInterface $output Console output that receives the messages and, through its error output when it
* is a {@see \Symfony\Component\Console\Output\ConsoleOutputInterface}, the standard error messages.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Manifest/FileMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
final readonly class FileMapping
{
/**
* Creates a provider file mapping.
*
* @param string $destination Destination path relative to the project root, using forward slashes.
* @param string $source Source path relative to the provider root, using forward slashes.
* @param FileMode $mode Write mode applied to the destination.
Expand Down
2 changes: 2 additions & 0 deletions src/Manifest/ManifestLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
final readonly class ManifestLoader
{
/**
* Creates a loader with its schema validator and mapping expander.
*
* @param ManifestSchema $schema Validates the manifest.
* @param ManifestExpander $expander Expands the validated manifest into file mappings.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Merge/MergeResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
final readonly class MergeResult
{
/**
* Creates the result of a merge operation.
*
* @param string $content Merged content; byte-identical to the consumer when `$changed` is `false`.
* @param bool $changed Whether `$content` differs from the consumer content.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Scaffold/ExpectedState.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
private const int ORPHAN_LIST_LIMIT = 10;

/**
* Creates an expected state from merged mappings and provider diagnostics.
*
* @param array<array-key, FileMapping> $mappings Expected mappings keyed by destination.
* @param list<string> $failedProviders Allowed and installed providers whose manifest could not be loaded.
* @param list<string> $warnings Messages about provider roots and manifests, prefixed with `[scaffold]`.
Expand Down
2 changes: 2 additions & 0 deletions src/Scaffold/FileApplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
final readonly class FileApplier
{
/**
* Creates an applier for validated provider mappings.
*
* @param ProjectConfig $config Consumer settings that list the providers allowed to write files.
* @param PathValidator $pathValidator Validates destinations and sources.
* @param OutputWriter $out Output sink that receives mode warnings on stderr.
Expand Down
2 changes: 2 additions & 0 deletions src/Scaffold/Lock/LockFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ final class LockFile
private array|null $unknownKeys = null;

/**
* Creates a lock-file store for a project.
*
* @param string $projectRoot Absolute path to the project root that holds `scaffold-lock.json`.
*/
public function __construct(private readonly string $projectRoot) {}
Expand Down
2 changes: 2 additions & 0 deletions src/Scaffold/Modes/ApplyResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
final readonly class ApplyResult
{
/**
* Creates the result of applying a file mapping.
*
* @param ApplyOutcome $outcome Whether the destination was written or left unchanged.
* @param string $newHash Hash of the destination after the operation, or an empty string when a user-modified
* destination was skipped.
Expand Down
2 changes: 2 additions & 0 deletions src/Scaffold/ScaffoldRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
private array $modes;

/**
* Creates a runner and its mode implementations.
*
* @param ManifestLoader $loader Loads provider manifests into file mappings.
* @param FileApplier $applier Validates and applies each mapping.
* @param LockFile $lockFile Lock file of the project.
Expand Down
2 changes: 2 additions & 0 deletions src/Scaffold/Scaffolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
final readonly class Scaffolder
{
/**
* Creates the Composer adapter for a scaffold run.
*
* @param ManifestLoader $loader Loads provider manifests into file mappings.
* @param FileApplier $applier Validates and applies each mapping.
* @param LockFile $lockFile Lock file of the project.
Expand Down
2 changes: 2 additions & 0 deletions src/Services/ApplyPreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
final readonly class ApplyPreview
{
/**
* Creates a preview of applying a provider mapping.
*
* @param FileMapping $mapping Mapping that would be applied.
* @param bool $exists Whether the destination exists on disk.
* @param string $current Destination content on disk; an empty string when the destination does not exist.
Expand Down
Loading