To catch your own mistakes in an uncommitted PHP diff before it reaches a reviewer or CI, Atlas provides a terminal-native workflow that integrates directly with your PHP toolchain. In 2026, you can use Atlas to read your working tree, generate a unified diff, and then leverage its capabilities to run `PHPUnit` tests, apply `PHP-CS-Fixer` formatting, and even `grep` for debugging leftovers. This process ensures that your changes are thoroughly vetted against PHP standards and project requirements before you commit, all within a permission-gated and recoverable environment.
How to review uncommitted PHP changes with Atlas
In 2026, Atlas helps PHP developers review uncommitted changes by providing a comprehensive view of the working diff and integrating with core PHP tools. It reads your `composer.json` to understand namespaces and dependencies, ensuring context-aware review of your modifications.
Atlas allows PHP developers to produce and read their working diff end-to-end, not just the files they remember touching. This is crucial because a standard `git diff` might hide the broader context of changes. Atlas, leveraging its ability to read git branches, status, and diffs, surfaces a unified diff for every file edit. This means you can examine each changed PHP file in full to check the modification against its surroundings, ensuring that new code aligns with existing patterns and PSR standards within your `src/` or `tests/` directories. Atlas's deep understanding of your PHP codebase, built by indexing AST declarations using tree-sitter, provides a richer context than blind line windows, making your self-review more effective.
Running PHPUnit tests and PHP-CS-Fixer with Atlas before commit
Before committing any PHP changes, Atlas enables developers to run their project's `PHPUnit` tests and apply `PHP-CS-Fixer` formatting directly from the terminal. This ensures that your modifications adhere to both functional requirements and coding standards, a critical step in any 2026 PHP development workflow.
Atlas integrates direct with the PHP toolchain, allowing you to execute `PHPUnit` tests and `PHP-CS-Fixer` formatting commands as part of your self-review. After making changes to your PHP files, you can instruct Atlas to run the tests using the actual `vendor/bin/phpunit` command, catching any regressions or new bugs introduced. Similarly, you can apply formatting rules with `vendor/bin/php-cs-fixer fix` to ensure your code adheres to PSR-12 or other project-specific standards defined in `.php-cs-fixer.dist.php`. Atlas's ability to fan out work to subagents means these checks can run efficiently, providing immediate feedback on your uncommitted PHP diff before it ever leaves your local machine.
Catching debugging leftovers in PHP diffs using Atlas grep
Atlas's `grep` tool is invaluable for PHP developers in 2026, helping them identify and remove debugging leftovers like temporary `echo` statements or skipped `PHPUnit` tests. This prevents common mistakes from reaching production code or CI pipelines, maintaining code quality.
Debugging leftovers, such as temporary `echo 'debug';` statements, `var_dump()` calls, commented-out blocks of PHP code, or `@testSkipped` annotations in `PHPUnit` tests, are common pitfalls. Atlas's `grep` capability allows you to search your working diff for these specific patterns. For instance, you can `grep` for `echo 'debug';` or `// TODO: remove` to quickly locate and clean up temporary code. This proactive step, performed before committing, ensures that your PHP codebase remains clean and free of unnecessary artifacts, improving maintainability and preventing potential security or performance issues that might arise from forgotten debugging code.
Safely reverting unwanted PHP changes with Atlas session revert
Atlas offers a robust session revert mechanism for PHP developers, allowing them to undo unwanted changes from a snapshot. This feature, available in 2026, asserts that the session is not busy, preventing a half-written turn from being rolled back mid-flight and ensuring data integrity.
If, during your self-review of a PHP diff, you discover a change that should not have been made, Atlas provides a safe and reliable way to undo it. The session revert flow is backed by snapshots, meaning every edit Atlas made is recoverable. This allows you to restore your PHP files to a previous state, effectively rolling back an unwanted modification without manual intervention. A key safety feature is that Atlas's revert refuses to run on a busy session, which prevents a half-written turn from being rolled back mid-flight. This ensures that your PHP development workflow remains stable and that you can confidently experiment with changes, knowing you have a reliable undo mechanism.
Atlas's safety features for PHP code modifications
Atlas incorporates multiple safety features to protect PHP codebases, including permission-gated tool calls and a read-only plan agent. In 2026, these mechanisms ensure that any modifications to your PHP files, `composer.json`, or `phpunit.xml` are intentional and approved.
Atlas is designed with developer safety at its core. Every Atlas tool call, whether it's running `PHPUnit` or modifying a PHP file, is permission-gated against allow, ask, and deny rules before it executes. This means you maintain explicit control over what Atlas does in your PHP project. Furthermore, Atlas drafts a plan in a read-only plan agent and asks for your approval before switching to a build agent to make actual changes. When Atlas does make edits, it computes a unified diff for every file modification and surfaces it for your approval before writing. This multi-layered approval process ensures that any changes to your PHP code, `composer.json`, or other project files are transparent and explicitly sanctioned by you, preventing unexpected or accidental modifications.
Step by step
- 01Use Atlas to read the current `git status` and generate a comprehensive `git diff` of your uncommitted PHP changes.
- 02Instruct Atlas to `read` each changed PHP file in full, examining the modifications against their surrounding context in `src/` or `tests/` directories.
- 03Employ Atlas's `grep` tool to search your working diff for common PHP debugging leftovers, such as `var_dump(`, `echo 'debug';`, or `// TODO: remove` comments.
- 04Run your project's `PHPUnit` tests by executing `vendor/bin/phpunit` through Atlas to verify functional correctness of your PHP code.
- 05Apply `PHP-CS-Fixer` formatting rules by running `vendor/bin/php-cs-fixer fix` via Atlas to ensure your PHP code adheres to PSR-12 or other standards.
- 06If any changes are undesirable, use Atlas's session revert feature to restore your PHP files from a snapshot, ensuring the session is not busy first.
- 07Once satisfied with the self-review, use Atlas to stage and create your `git commit`.
Frequently asked questions
- How does Atlas integrate with PHPUnit for testing?
- Atlas integrates with `PHPUnit` by allowing you to execute the actual `vendor/bin/phpunit` command directly within your Atlas session. It can run your project's test suite, providing immediate feedback on any regressions or new bugs introduced by your uncommitted PHP changes. This ensures your PHP code remains robust before committing.
- Can Atlas automatically format my PHP code with PHP-CS-Fixer?
- Yes, Atlas can apply `PHP-CS-Fixer` formatting to your PHP code. You can instruct Atlas to run `vendor/bin/php-cs-fixer fix` to automatically correct code style issues according to your project's configuration, such as PSR-12. Atlas will then present a unified diff of these formatting changes for your approval before writing them.
- What PHP files and configurations does Atlas read for context?
- Atlas reads your `composer.json` file to understand PHP namespaces, autoload configurations, and project dependencies. It also indexes your PHP code by AST declarations using tree-sitter, providing a deep, structural understanding of your `src/` and `tests/` directories, rather than just line-based analysis.
- How does Atlas prevent accidental changes in my PHP project?
- Atlas prevents accidental changes through several safety mechanisms. It drafts a plan in a read-only agent and seeks your approval before making any modifications. Every tool call is permission-gated, and any file edit, including to PHP files or `composer.json`, generates a unified diff for your explicit approval before being written to disk.
- Can I use Atlas with my existing Composer project?
- Absolutely. Atlas is designed to work direct within existing PHP projects that use `Composer`. You simply run Atlas in a project containing a `composer.json` file, and Atlas will read your namespaces, autoload configuration, and dependencies to provide context-aware assistance and code review capabilities.
- How does Atlas help me find debugging code in my PHP diffs?
- Atlas helps you find debugging code in your PHP diffs using its `grep` tool. You can specify patterns like `var_dump(`, `echo 'debug';`, or `// TODO: remove` to quickly scan your uncommitted changes for temporary logging, commented-out blocks, or other debugging artifacts, ensuring a clean commit.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Self-Review Your Working Diff Before Committing with Atlas (2026 Workflow)
How to self-review your working diff before committing with Atlas in 2026: bash produces the diff, read checks each file, grep finds leftovers, session revert undoes bad edits.
Atlas for PHP in 2026
Atlas, the terminal-native AI coding agent, empowers PHP developers in 2026 with intelligent code understanding, secure workflows, and direct integration for Composer and PSR standards.
Onboard to an Unfamiliar PHP Codebase with Atlas (2026)
Build a mental model of an unfamiliar PHP repo in 2026 without reading every file. Atlas maps the Composer layout, delegates sweeps to a read-only explore subagent.
Refactor a Legacy PHP Module with Atlas Without Breaking Callers (2026)
How Atlas refactors a legacy PHP module in 2026: map callers with the lsp tool, pin behavior with PHPUnit, restructure with apply_patch, and format with PHP-CS-Fixer.
Locate Where a Behavior Is Implemented in PHP with Atlas (2026)
Track a PHP behavior down to the exact class and method in 2026. Atlas fuses semantic retrieval, ripgrep-backed regex, and the lsp symbol graph across your src tree.
Document a PHP Module with a README in 2026
Atlas helps PHP developers in 2026 generate accurate README documentation directly from source code. It leverages Composer, PHPUnit, and PSR standards to describe what your PHP code actually does today.
Migrate a Deprecated API Across Every Callsite in PHP with Atlas in 2026
Move your PHP codebase off deprecated functions or modules onto replacements without missing a single caller. Atlas integrates with Composer and PHPUnit for a verified migration.
Add a regression test for a bug fix in PHP with Atlas (2026)
Add a PHP regression test for a bug fix in 2026: Atlas proves the PHPUnit test fails red first, applies the fix with edit, and re-runs the same command to prove green.