Local override files let a consumer project keep the Fast Forward baseline without forking the whole package.
FastForward\DevTools\Console\Command\AbstractCommand::getConfigFile() resolves
configuration in this order:
- Check whether the file exists in the current working directory.
- Use the local file when it exists.
- Otherwise fall back to the packaged file inside
fast-forward/dev-tools.
| Command | Local file | Fallback behavior |
|---|---|---|
code-style |
ecs.php |
Falls back to the packaged ECS configuration. |
refactor |
rector.php |
Falls back to the packaged Rector configuration. |
tests |
phpunit.xml |
Falls back to the packaged PHPUnit configuration. |
phpdoc |
.php-cs-fixer.dist.php and rector.php |
Falls back to the packaged files; .docheader is created locally
when missing. |
docs |
docs/ or another path passed with --source |
The selected guide source must exist locally. |
skills |
.agents/skills/ |
Creates missing local links to packaged skills and preserves existing non-symlink directories. |
dev-tools:sync |
Consumer repository files | Works directly against local project files such as composer.json and
.github/*. |
To customize Rector for one library, create rector.php in the consumer
project root. The refactor command and the Rector phase inside phpdoc
will use that file instead of the packaged default.
Instead of copying the entire ecs.php file, consumers can extend the
default configuration using the ECSConfig class:
<?php
use FastForward\DevTools\Config\ECSConfig;
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer;
$config = ECSConfig::configure();
$config->withRules([CustomRule::class]);
$config->withConfiguredRule(PhpdocAlignFixer::class, ['align' => 'right']);
return $config;Instead of copying the entire rector.php file, consumers can extend the
default configuration using the RectorConfig class:
<?php
use FastForward\DevTools\Config\RectorConfig;
return RectorConfig::configure(
static function (\Rector\Config\RectorConfig $rectorConfig): void {
$rectorConfig->rules([
// custom rules
]);
$rectorConfig->skip([
// custom skips
]);
}
);This approach:
- Eliminates duplication of the base configuration
- Automatically receives upstream updates
- Only requires overriding what is needed
- existing workflow files in
.github/workflows/; - an existing
.editorconfig; - an existing
.github/dependabot.yml; - an existing non-symlink directory inside
.agents/skills/; - an existing
.github/wikidirectory or submodule.
Tip
Start with the packaged defaults, copy only the file you need to customize, and keep the rest on the shared baseline. That gives you the least maintenance overhead across Fast Forward libraries.