Skip to content

chore(deps): allow installation of ergebnis/agent-detector:^3.0 - #404

Open
localheinz wants to merge 1 commit into
php-fast-forward:mainfrom
localheinz:enhancement/require-and-use-ergebnis-agent-detector-3-0-0
Open

localheinz wants to merge 1 commit into
php-fast-forward:mainfrom
localheinz:enhancement/require-and-use-ergebnis-agent-detector-3-0-0

Conversation

@localheinz

@localheinz localheinz commented Nov 27, 2026 •

Copy link
Copy Markdown

Related Issue

Follows ergebnis/agent-detector#171.

Motivation / Context

  • ergebnis/agent-detector:3.0.0 turns Detector into an interface and extracts EnvironmentDetector, which reads the agent environment variables itself. isAgentPresent() no longer accepts arguments.

Changes

  • Allows installation of ergebnis/agent-detector:^3.0 next to ^2.0.
  • Creates Detector with a factory in DevToolsServiceProvider that uses EnvironmentDetector when it is available.
  • Calls Detector::isAgentPresent() without arguments in RuntimeEnvironment, which works with both major versions.
  • Sets the environment variables in RuntimeEnvironmentTest with putenv(), since Detector is final in 2.x and cannot be doubled.

Verification

  • composer dev-tools
  • Focused command(s):
  • Manual verification:

Documentation / Generated Output

  • README updated
  • docs/ updated
  • Generated or synchronized output reviewed

Changelog

  • Added a notable .changelog/*.md fragment

Reviewer Notes

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ac894067-ff1e-4323-876a-2bbba04ae38b
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Changelog

✅ Contribution check passed.

Head: a8537fc6fa76c2df87fa6d60e1a7aba4890ec075

Base: 105e9f5f533f8ebdc902071d1627cbf880d33a0a

Contribution: 1 new valid fragment(s). Policy: ordinary.

  • require-ergebnis-agent-detector-3.md — changed, patch

    Allow `ergebnis/agent-detector:^3.0` next to `^2.0`, and use its `EnvironmentDetector` when it is installed.

@localheinz
localheinz marked this pull request as ready for review November 27, 2026 07:38
@localheinz
localheinz requested a review from coisa as a code owner November 27, 2026 07:38
Copilot AI balanced review requested due to automatic review settings November 27, 2026 07:38
@github-actions

Copy link
Copy Markdown
Contributor

Rigorous review requested

This pull request is ready for the dedicated review-guardian pass powered by $pull-request-review.

Review focus

  • Source behavior or orchestration changed; verify regressions, contracts, and dependency boundaries.
  • Tests changed; confirm assertions still cover the touched behavior and edge cases.

Sample changed files

  • .changelog/require-ergebnis-agent-detector-3.md
  • composer.json
  • src/Container/ServiceProvider/DevToolsServiceProvider.php
  • src/Environment/RuntimeEnvironment.php
  • tests/Environment/RuntimeEnvironmentTest.php

Suggested prompt

Use $pull-request-review with the review-guardian agent to review PR #404 (https://github.com/php-fast-forward/dev-tools/pull/404).
Lead with findings ordered by severity. Include repository file references whenever possible.
Prioritize bugs, regressions, missing tests, missing docs, generated-output drift, and workflow or CI impacts.
For workflow/action changes, record validation evidence or residual risk; pay special attention to GITHUB_TOKEN pushes and required-check dispatch/mirroring.
Base: main
Head: enhancement/require-and-use-ergebnis-agent-detector-3-0-0 @ 04faf62

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Pending compatible php-cs-fixer and phpunit-agent-reporter releases leave dependency resolution and DI/runtime integration unverified, requiring maintainer validation before merge.

No open issues 🎉

What changed in this PR

Migrates DevTools to ergebnis/agent-detector 3.x, adapting dependency injection and runtime detection to its new interface-based API.

Changes:

  • Requires version ^3.0 and binds Detector to EnvironmentDetector.
  • Delegates agent detection through the argument-free method.
  • Updates tests to cover both detection outcomes and adds a changelog fragment.

Verification remains pending. The PR description notes that dependency resolution is blocked until compatible PHP-CS-Fixer and PHPUnit agent reporter releases are available.

File Description
tests/​Environment/​RuntimeEnvironmentTest.php Uses a detector test double and checks both boolean outcomes.
src/​Environment/​RuntimeEnvironment.php Calls agent detection without passing environment variables.
src/​Container/​ServiceProvider/​DevToolsServiceProvider.php Binds the detector interface to its environment implementation.
composer.json Raises the agent-detector requirement to ^3.0.
.changelog/​require-ergebnis-agent-detector-3.md Records the dependency and integration changes.

Review effort: Balanced

@localheinz
localheinz force-pushed the enhancement/require-and-use-ergebnis-agent-detector-3-0-0 branch from 04faf62 to 146c107 Compare November 27, 2026 07:49
@localheinz localheinz changed the title chore(deps): require and use ergebnis/agent-detector:^3.0 chore(deps): allow installation of ergebnis/agent-detector:^3.0 Nov 27, 2026
@localheinz
localheinz force-pushed the enhancement/require-and-use-ergebnis-agent-detector-3-0-0 branch from 146c107 to a8537fc Compare November 27, 2026 08:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants