Skip to content

Latest commit

 

History

History
161 lines (106 loc) · 4.03 KB

File metadata and controls

161 lines (106 loc) · 4.03 KB

Specialized Commands

Use the standalone commands when you want one tool instead of the full standards pipeline.

tests

Runs PHPUnit with the resolved phpunit.xml.

composer dev-tools tests
composer dev-tools tests -- --filter=EventTracerTest

Important details:

  • local phpunit.xml is preferred over the packaged default;
  • --coverage=<path> creates HTML, Testdox, Clover, and raw coverage output;
  • --no-cache disables tmp/cache/phpunit;
  • the packaged configuration registers the DevTools PHPUnit extension.

code-style

Runs Composer Normalize and ECS.

composer dev-tools code-style
composer dev-tools code-style -- --fix

Important details:

  • it always executes composer update --lock --quiet first;
  • without --fix, Composer Normalize runs in --dry-run mode;
  • ECS uses local ecs.php when present, otherwise the packaged fallback.

refactor

Runs Rector against the current project.

composer dev-tools refactor
composer dev-tools refactor -- --fix

Important details:

  • without --fix, Rector runs in dry-run mode;
  • local rector.php is preferred when present;
  • the packaged default includes Fast Forward custom Rector rules plus shared Rector sets.

phpdoc

Coordinates PHP-CS-Fixer and a focused Rector pass for missing method PHPDoc.

composer dev-tools phpdoc
composer dev-tools phpdoc -- --fix

Important details:

  • it creates .docheader from the packaged template when the file is missing;
  • it uses .php-cs-fixer.dist.php and rector.php through the same local-first fallback logic;
  • the Rector phase explicitly runs FastForward\DevTools\Rector\AddMissingMethodPhpDocRector.

docs

Builds the HTML documentation site with phpDocumentor.

composer dev-tools docs
vendor/bin/dev-tools docs --source=docs --target=public

Important details:

  • docs/ must exist unless you pass another --source directory;
  • API pages are built from the PSR-4 paths declared in composer.json;
  • guide pages are built from the selected source directory;
  • --template defaults to vendor/fast-forward/phpdoc-bootstrap-template.

wiki

Builds Markdown API pages for a GitHub wiki.

composer dev-tools wiki

Important details:

  • the default output directory is .github/wiki;
  • it uses the Markdown template from vendor/saggre/phpdocumentor-markdown/themes/markdown;
  • it is especially useful together with the reusable wiki workflow.

reports

Runs the documentation and test-report pipeline used by GitHub Pages.

composer dev-tools reports

Important details:

  • it calls docs --target public;
  • it calls tests --coverage public/coverage;
  • it is the reporting stage used by standards.

dev-tools:sync

Synchronizes consumer-facing automation and defaults.

composer dev-tools:sync

Important details:

  • it updates composer.json scripts and extra.grumphp.config-default-path;
  • it copies missing workflow stubs, .editorconfig, and dependabot.yml;
  • it creates .github/wiki as a git submodule when the directory is missing.
  • it calls gitignore to merge the canonical .gitignore with the project's .gitignore.

gitignore

Merges and synchronizes .gitignore files.

composer dev-tools gitignore
composer dev-tools gitignore -- --source=/path/to/source/.gitignore --target=/path/to/target/.gitignore

Important details:

  • it reads the canonical .gitignore from dev-tools and merges with the project's existing .gitignore;
  • by default, the source is the packaged .gitignore and the target is the project's root .gitignore;
  • duplicates are removed and entries are sorted alphabetically;
  • it uses the Reader, Merger, and Writer components from the GitIgnore namespace.