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
7 changes: 7 additions & 0 deletions .changelog/framework-composition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
category: changed
type: minor
---

Composes the attributed invocable commands through the published Fast Forward
Container autowiring API, with focused provider bindings and explicit overrides.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ composer test
`check` reports violations with a nonzero status and does not change source.
`fix` explicitly applies ECS fixes. It does not commit, push or update dependencies.
Recheck and inspect the diff afterward; failures can leave already applied fixes.
No selected PHP files is a successful no-op. Invalid options, configuration, Git
history or head mismatch fail closed with exit 2. Otherwise tool exit status is
propagated. Changed mode requires a clean tracked checkout of the requested head.
An empty PHP selection is a successful no-op. Invalid options, configuration paths,
Git history or head mismatch fail closed with exit 2. Syntax/style tool failures,
including executable configuration errors inside ECS, retain their tool status.
Changed mode requires a clean tracked checkout of the requested head.
`--all` includes tracked files and permits inspecting local tracked edits.
Symfony Console provides `help check`, standard global flags and both
`--option=value` and `--option value`. Error diagnostics use stderr. Empty paths,
Expand Down
24 changes: 4 additions & 20 deletions bin/code-standards
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,14 @@
declare(strict_types=1);

use FastForward\CodeStandards\Console\Application;
use FastForward\CodeStandards\Console\Command\CheckCommand;
use FastForward\CodeStandards\Console\Command\FixCommand;
use FastForward\CodeStandards\Console\StandardsOperation;
use FastForward\CodeStandards\Filesystem\PhpFiles;
use FastForward\CodeStandards\Git\FileSelection;
use FastForward\CodeStandards\Process\NativeProcessRunner;
use FastForward\CodeStandards\Project\ProjectScopeResolver;
use FastForward\CodeStandards\Standards\StandardsRunner;
use FastForward\CodeStandards\DependencyInjection\StandardsServiceProvider;
use FastForward\Container\ContainerFactory;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Process\Process;

$autoload = $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
require $autoload;

$vendor = dirname($autoload);
$output = new ConsoleOutput();
$process = new NativeProcessRunner(static function (string $type, string $message) use ($output): void {
$stream = Process::ERR === $type ? $output->getErrorOutput() : $output;
$stream->write($message);
});
$projects = new ProjectScopeResolver(dirname(__DIR__) . '/config/ecs.php');
$selection = new FileSelection($process);
$files = new PhpFiles();
$standards = new StandardsRunner($process, $vendor . '/symplify/easy-coding-standard/bin/ecs');
$operation = new StandardsOperation($projects, $selection, $files, $standards);
$container = ContainerFactory::create(new StandardsServiceProvider(dirname($autoload), $output));

exit((new Application(new CheckCommand($operation), new FixCommand($operation)))->run(output: $output));
exit($container->get(Application::class)->run(output: $output));
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"license": "MIT",
"require": {
"php": "^8.3",
"fast-forward/container": "~1.10.1",
"symfony/console": "^7.4 || ^8.0",
"symfony/process": "^7.4 || ^8.0",
"symplify/easy-coding-standard": "^13.0"
Expand Down
Loading
Loading