// static linter · Symfony · Laravel Octane · FrankenPHP worker mode

Will your Symfony or Laravel app survive the lightning?

In worker mode, your services no longer die at the end of the request. Igor inspects every shared service in your Symfony container, or every singleton that outlives a request in an Octane worker, and spots leaking state, growing memory and calls that kill the worker, before you ship to production.

composer require --dev igor-php/igor-php
downloads on Packagist
440k+
in the last 30 days
220k+
stars on GitHub
133
Downloads per month

// Igor's verdict, in one command

$ vendor/bin/igor-php . src/Service/CartService.php  [PROJECT] [HIGH] Mutation of state 'items' in CartService::add()  18 | $this->items[] = $product; src/Service/ReportService.php  [PROJECT] [HIGH] date_default_timezone_set() mutates process state  42 | date_default_timezone_set('Europe/Paris'); vendor/knp/snappy/src/.../AbstractGenerator.php  [VENDOR] [INFO] Mutation of state 'binary' in setBinary() ℹ️  71 findings in code that does not run during a request (console, kernel boot) — use --show-all to list them RECOMMENDATIONS  [PROJECT] refactor to be stateless or implement ResetInterface  [VENDOR]  set a 'max_requests' limit in your Worker config$ 

01 · the problem

With PHP-FPM, every request starts from scratch. With a worker, never again.

FrankenPHP keeps your Symfony kernel or your Laravel application in memory between requests. That is what makes it fast, and also what turns an innocent $this->items[] = … into data leaking from one user to the next.

Memory keeps growing

A shared service that piles up data and never clears it grows with every request, until the worker crashes.

Global state gets poisoned

A date_default_timezone_set() or an ini_set() changes the behaviour of every following request handled by the same worker.

The worker dies

An exit() or a die() no longer ends a request: it kills the long-running process.

See it for yourself: the Leak Lab is a Symfony + FrankenPHP project running in Docker that reproduces every leak in real conditions. There is a Laravel Octane version too.

02 · what Igor detects

Thirteen rules, one question: does it survive the request?

Igor is strict on purpose. The Symfony bundle, the Laravel provider, readonly properties, services tagged kernel.reset or reset by an Octane listener, lazy initialisation and finally blocks that clean up state are recognised automatically to cut false positives. Code that never runs during a request (console commands, cache warmers, kernel boot) is folded into a single line.

03 · installation

Four commands to your first audit.

  1. Add the package

    composer require --dev \
      igor-php/igor-php

    The Go binary matching your version is downloaded automatically. Laravel Octane, the Claude Code plugin and the MCP server come with 0.11, still in beta: composer require --dev igor-php/igor-php:^0.11@beta.

  2. Plug in your framework

    // Symfony: config/bundles.php
    IgorPhp\IgorBundle\IgorPhpBundle::class
      => ['dev' => true, 'test' => true],
    
    // Laravel Octane: nothing to add

    Symfony: enable the bundle, optional but recommended, so Igor reads the exact map of your container. Laravel: nothing to do, Composer registers IgorServiceProvider and Igor runs php artisan igor:dump itself.

  3. Generate the config

    php bin/console cache:clear  # Symfony only
    vendor/bin/igor-php init

    On Symfony, cache:clear builds the bundle's service map. Then init creates an igor.json tailored to your project.

  4. Run the audit

    vendor/bin/igor-php .

    Exits with code 1 on any issue: ready for CI.

04 · fix

Igor found something. Here is how to fix it.

Pick the rule from Igor's report to see the faulty code and its fix. The full reference, for Symfony and Laravel, is also one command away: igor-php rule <RuleId>.

Why it is dangerous

The service is created once per worker. Every product added stays in $items for the next user, and memory never goes down.

The fix

Make the service stateless (store data in the session or the database), or implement ResetInterface so Symfony clears the property between two requests. On Laravel Octane: a scoped() binding, or a reset() called from an Octane listener.

Before
final class CartService
{
    private array $items = [];

    public function add(Product $p): void
    {
        $this->items[] = $p;
    }
}
After
final class CartService implements ResetInterface
{
    private array $items = [];

    public function add(Product $p): void
    {
        $this->items[] = $p;
    }

    public function reset(): void
    {
        $this->items = [];
    }
}

A false positive?

Document it with the #[WorkerSafe(reason: '…')] attribute on the class, method or property, or with // @igor-ignore on a single line.

A legacy project?

Freeze the existing debt with --generate-baseline, then clean up with --prune-baseline as you fix things.

Vendor code?

You cannot fix it on your side: limit the damage with max_requests in the worker config, and report it to the maintainer.

05 · AI agents

Let your agent audit and fix.

Igor plugs into Claude Code and any MCP client: the agent runs the audit, sorts the findings, fixes one service at a time with the Symfony or Laravel remedy, and checks every fix before writing it.

Claude Code plugin

Ask "audit my project for FrankenPHP worker mode" or run /igor:audit. Claude installs Igor if needed, handles reachable leaks first, and only accepts a finding with a written reason.

/plugin marketplace add igor-php/igor-php
/plugin install igor@igor-php
/igor:audit

/igor:watch on audits every PHP file Claude edits, so a leak is fixed before it lands.

Discover the plugin

MCP server

igor-php mcp serves Igor over stdio to Claude Code, Cursor, VS Code / Copilot, Antigravity, Codex and any other MCP client. The project is loaded once, then every call is instant.

claude mcp add --scope project igor \
  -- vendor/bin/igor-php mcp

Tools: audit_project, audit_file (even on unsaved code), explain_service, get_rule, project_info and baseline management. --read-only leaves out the tools that write.

Set up your client

06 · wherever you code

In the editor, in the pull request, in CI.

GitHub Actions

Igor detects GitHub Actions and adds its annotations right on the pull request lines.

Sample workflow