Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Keep global `dev-tools:sync` runs machine-independent by removing only deprecated DevTools-managed Composer GrumPHP default-path metadata while wiring packaged Git hooks to prefer a project-local `grumphp.yml` and otherwise use the active packaged DevTools config path resolved at sync time (#288)
- Complete global runtime binary fallback support for phpdoc, phpunit, and phpmetrics commands (#297)

## [1.24.2] - 2026-04-30

Expand Down
3 changes: 2 additions & 1 deletion src/Console/Command/DocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use FastForward\DevTools\Console\Input\HasJsonOption;
use Twig\Environment;
use FastForward\DevTools\Filesystem\FilesystemInterface;
use FastForward\DevTools\Path\DevToolsPathResolver;
use FastForward\DevTools\Process\ProcessBuilderInterface;
use FastForward\DevTools\Process\ProcessQueueInterface;
use FastForward\DevTools\Path\ManagedWorkspace;
Expand Down Expand Up @@ -167,7 +168,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$processBuilder = $processBuilder->withArgument('--no-progress');
}

$phpdoc = $processBuilder->build('vendor/bin/phpdoc');
$phpdoc = $processBuilder->build([DevToolsPathResolver::getPreferredToolBinaryPath('phpdoc')]);

$this->processQueue->add(process: $phpdoc, label: 'Generating API Docs with phpDocumentor');

Expand Down
7 changes: 4 additions & 3 deletions src/Console/Command/MetricsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use FastForward\DevTools\Console\Command\Traits\LogsCommandResults;
use FastForward\DevTools\Console\Input\HasJsonOption;
use FastForward\DevTools\Path\DevToolsPathResolver;
use FastForward\DevTools\Process\ProcessBuilderInterface;
use FastForward\DevTools\Process\ProcessQueueInterface;
use FastForward\DevTools\Path\ManagedWorkspace;
Expand All @@ -45,9 +46,9 @@ final class MetricsCommand extends Command
use LogsCommandResults;

/**
* @var string the bundled PhpMetrics binary path relative to the consumer root
* @var string the PhpMetrics binary name resolved through the runtime-aware tooling lookup
*/
private const string BINARY = 'vendor/bin/phpmetrics';
private const string BINARY = 'phpmetrics';

/**
* @var int the PHP error reporting mask that suppresses deprecations emitted by PhpMetrics internals
Expand Down Expand Up @@ -161,7 +162,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
\PHP_BINARY,
'-derror_reporting=' . self::PHP_ERROR_REPORTING,
'-ddefault_socket_timeout=' . self::PHP_DEFAULT_SOCKET_TIMEOUT,
self::BINARY,
DevToolsPathResolver::getPreferredToolBinaryPath(self::BINARY),
]),
label: 'Generating Metrics with PhpMetrics',
);
Expand Down
3 changes: 2 additions & 1 deletion src/Console/Command/TestsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use FastForward\DevTools\Console\Input\HasJsonOption;
use FastForward\DevTools\Composer\Json\ComposerJsonInterface;
use FastForward\DevTools\Filesystem\FilesystemInterface;
use FastForward\DevTools\Path\DevToolsPathResolver;
use FastForward\DevTools\PhpUnit\Bootstrap\BootstrapShimGenerator;
use FastForward\DevTools\PhpUnit\Coverage\CoverageSummaryLoaderInterface;
use FastForward\DevTools\Process\ProcessBuilderInterface;
Expand Down Expand Up @@ -209,7 +210,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->processQueue->add(
process: $processBuilder
->withArgument($input->getArgument('path'))
->build('vendor/bin/phpunit'),
->build([DevToolsPathResolver::getPreferredToolBinaryPath('phpunit')]),
label: 'Running PHPUnit Tests',
);

Expand Down
3 changes: 2 additions & 1 deletion src/Console/Command/WikiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use FastForward\DevTools\Console\Input\HasJsonOption;
use FastForward\DevTools\Filesystem\FilesystemInterface;
use FastForward\DevTools\Git\GitClientInterface;
use FastForward\DevTools\Path\DevToolsPathResolver;
use FastForward\DevTools\Process\ProcessBuilderInterface;
use FastForward\DevTools\Process\ProcessQueueInterface;
use FastForward\DevTools\Path\ManagedWorkspace;
Expand Down Expand Up @@ -157,7 +158,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

$this->processQueue->add(
process: $processBuilder->build('vendor/bin/phpdoc'),
process: $processBuilder->build([DevToolsPathResolver::getPreferredToolBinaryPath('phpdoc')]),
Comment thread
coisa marked this conversation as resolved.
label: 'Generating Wiki with phpDocumentor',
);

Expand Down
6 changes: 5 additions & 1 deletion tests/Console/Command/DocsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
use FastForward\DevTools\Console\Command\Traits\LogsCommandResults;
use FastForward\DevTools\Console\Command\DocsCommand;
use FastForward\DevTools\Filesystem\FilesystemInterface;
use FastForward\DevTools\Path\DevToolsPathResolver;
use FastForward\DevTools\Process\ProcessBuilderInterface;
use FastForward\DevTools\Process\ProcessQueueInterface;
use FastForward\DevTools\Path\ManagedWorkspace;
use FastForward\DevTools\Path\WorkingProjectPathResolver;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\Attributes\UsesClass;
Expand All @@ -43,7 +45,9 @@
use Twig\Environment;

#[CoversClass(DocsCommand::class)]
#[UsesClass(DevToolsPathResolver::class)]
#[UsesClass(ManagedWorkspace::class)]
#[UsesClass(WorkingProjectPathResolver::class)]
#[UsesTrait(LogsCommandResults::class)]
final class DocsCommandTest extends TestCase
{
Expand Down Expand Up @@ -133,7 +137,7 @@ protected function setUp(): void
$this->processBuilder->withArgument(Argument::any(), Argument::any())->willReturn(
$this->processBuilder->reveal()
);
$this->processBuilder->build('vendor/bin/phpdoc')
$this->processBuilder->build([DevToolsPathResolver::getPreferredToolBinaryPath('phpdoc')])
->willReturn($this->process->reveal());

$this->command = new DocsCommand(
Expand Down
7 changes: 6 additions & 1 deletion tests/Console/Command/MetricsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@

use FastForward\DevTools\Console\Command\MetricsCommand;
use FastForward\DevTools\Console\Command\Traits\LogsCommandResults;
use FastForward\DevTools\Path\DevToolsPathResolver;
use FastForward\DevTools\Process\ProcessBuilderInterface;
use FastForward\DevTools\Process\ProcessQueueInterface;
use FastForward\DevTools\Path\ManagedWorkspace;
use FastForward\DevTools\Path\WorkingProjectPathResolver;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\Attributes\UsesClass;
Expand All @@ -42,7 +44,9 @@
use function Safe\putenv;

#[CoversClass(MetricsCommand::class)]
#[UsesClass(DevToolsPathResolver::class)]
#[UsesClass(ManagedWorkspace::class)]
#[UsesClass(WorkingProjectPathResolver::class)]
#[UsesTrait(LogsCommandResults::class)]
final class MetricsCommandTest extends TestCase
{
Expand Down Expand Up @@ -99,7 +103,8 @@ protected function setUp(): void
$this->processBuilder->build(Argument::that(static fn(array $command): bool => \PHP_BINARY === $command[0]
&& str_starts_with((string) $command[1], '-derror_reporting=')
&& '-ddefault_socket_timeout=1' === $command[2]
&& 'vendor/bin/phpmetrics' === $command[3]))->willReturn($this->process->reveal());
&& DevToolsPathResolver::getPreferredToolBinaryPath('phpmetrics') === $command[3]))
->willReturn($this->process->reveal());
$this->command = new MetricsCommand(
$this->processBuilder->reveal(),
$this->processQueue->reveal(),
Expand Down
5 changes: 5 additions & 0 deletions tests/Console/Command/TestsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use FastForward\DevTools\Process\ProcessQueueInterface;
use FastForward\DevTools\Path\ManagedWorkspace;
use FastForward\DevTools\Path\DevToolsPathResolver;
use FastForward\DevTools\Path\WorkingProjectPathResolver;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\Attributes\UsesClass;
Expand All @@ -54,6 +55,7 @@
#[UsesClass(DevToolsPathResolver::class)]
#[UsesClass(ProcessBuilder::class)]
#[UsesClass(ManagedWorkspace::class)]
#[UsesClass(WorkingProjectPathResolver::class)]
#[UsesTrait(LogsCommandResults::class)]
final class TestsCommandTest extends TestCase
{
Expand Down Expand Up @@ -147,6 +149,9 @@ public function executeWillRunPhpUnitProcessWithConfigFile(): void
) && str_contains(
$process->getCommandLine(),
'--bootstrap=' . $generatedBootstrapPath,
) && str_contains(
$process->getCommandLine(),
DevToolsPathResolver::getPreferredToolBinaryPath('phpunit'),
) && str_contains($process->getCommandLine(), '--cache-result') && str_contains(
$process->getCommandLine(),
'--cache-directory=' . getcwd() . '/.dev-tools/cache/phpunit',
Expand Down
7 changes: 6 additions & 1 deletion tests/Console/Command/WikiCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
use FastForward\DevTools\Console\Command\WikiCommand;
use FastForward\DevTools\Filesystem\FilesystemInterface;
use FastForward\DevTools\Git\GitClientInterface;
use FastForward\DevTools\Path\DevToolsPathResolver;
use FastForward\DevTools\Process\ProcessBuilderInterface;
use FastForward\DevTools\Process\ProcessQueueInterface;
use FastForward\DevTools\Path\ManagedWorkspace;
use FastForward\DevTools\Path\WorkingProjectPathResolver;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\Attributes\UsesClass;
Expand All @@ -42,7 +44,9 @@
use Symfony\Component\Process\Process;

#[CoversClass(WikiCommand::class)]
#[UsesClass(DevToolsPathResolver::class)]
#[UsesClass(ManagedWorkspace::class)]
#[UsesClass(WorkingProjectPathResolver::class)]
#[UsesTrait(LogsCommandResults::class)]
final class WikiCommandTest extends TestCase
{
Expand Down Expand Up @@ -107,7 +111,8 @@ protected function setUp(): void
$this->processBuilder->withArgument(Argument::any(), Argument::any())->willReturn(
$this->processBuilder->reveal()
);
$this->processBuilder->build(Argument::any())->willReturn($this->process->reveal());
$this->processBuilder->build([DevToolsPathResolver::getPreferredToolBinaryPath('phpdoc')])
->willReturn($this->process->reveal());

$this->command = new WikiCommand(
$this->processBuilder->reveal(),
Expand Down
3 changes: 3 additions & 0 deletions tests/Path/DevToolsPathResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ public function itWillResolveRuntimeAutoloadPathsForRepositoryAndDependencyInsta
*/
#[Test]
#[TestWith(['php-cs-fixer'])]
#[TestWith(['phpdoc'])]
#[TestWith(['phpmetrics'])]
#[TestWith(['phpunit'])]
#[TestWith(['rector'])]
#[TestWith(['ecs'])]
#[TestWith(['jack'])]
Expand Down
Loading