Skip to content

[Feature]: Turn auto-boot off from composer.json #95

Closed

Description

@fdaviddpt

Proposed Feature / Syntax

A project-level way to turn auto-boot off, for example in the root composer.json:

{
  "extra": {
    "typephp": {
      "auto-boot": false
    }
  }
}

With it, src/bootstrap.php does not boot, and the project calls TypePHP::boot() where it wants checks, such as a test bootstrap file.

Motivation / Use Case

Installed as a dev dependency, TypePHP boots on every vendor/autoload.php require: the local web server, every developer's test run, every CI job. Today the only way out is TYPEPHP_DISABLE, which has to be set in every one of those environments.

It cannot be set where the tests are configured either: the PHPUnit binary requires the autoloader before it reads phpunit.xml, so an <env> entry there is too late.

We want TypePHP active in one dedicated CI job and nowhere else. Our workaround is to composer require it inside that job only.

Code Example

// tests/bootstrap.php, the only place where checks should run
require __DIR__ . '/../vendor/autoload.php';

\TypePHP\TypePHP::boot();

Activity

  1. self-assigned this
    on Oct 3, 2026
  2. rcalicdan commented on Oct 3, 2026

    @rcalicdan
    Member

    This is a good feature for the next minor release..

  3. linked a pull request that will close this issueNext minor released #100on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions