Build1 publisher3 min readPublished
Renaming ServiceProvider to ServiceLauncher costs five edits per class in Doppar 4
Doppar 4 drops the Laravel-shaped names that 3.x applications were written against, and it will only run on PHP 8.5. The release post tells 3.x users to move the runtime before touching application code.
The Engineer · Build desk
What happened
- Doppar 4 requires PHP 8.5 where 3.x ran on 8.3, and the release post states that there is no compatibility mode for applications still on the older runtime.
- The generator follows the rename, so php pool make:provider MyServiceProvider becomes php pool make:launcher MyLauncher.
- The post lists the folder layout, bootstrapping classes, config file, mailer, path helpers and controller attribute imports among what 4.0 changes, and asks 3.x users to read all of it before upgrading.
- Features the post credits as Doppar's own, including #[Temporal] history queries, #[Immutable] frozen services and a queue worker that forks a child per job, were already shipping in 3.x.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- constraint An application pinned to PHP 8.3 in production cannot take Doppar 4 at all, and the post puts the runtime move ahead of every code edit, so the first step belongs to whoever owns the images.
- cost The rename costs five edits and a file move per provider, so the work scales with how many launchers an application defines.
- exposure Packages that extend the removed ServiceProvider base class break on upgrade. That puts a 3.x app's dependency list inside the upgrade estimate alongside its own classes.
- decision Teams weighing 4.0 are choosing between naming and a PHP bump, because the attribute features the post credits as Doppar's own were available before this release.
The two-phase contract survives the rename. register() is still where container bindings and raw service wiring go, and launch() is where anything that depends on other services already existing belongs: routes, views, migrations, translations, console commands [11]. The split is an ordering rule, so registration finishes for everything before any launch code runs [24]. On why the second method was renamed, the post says that "boot" tells you nothing [12].
Set the post's two samples side by side and the per-class cost is countable. The namespace goes from App\Providers to App\Launchers, and the import from Phaseolies\Providers\ServiceProvider to Phaseolies\Launchers\ServiceLauncher. AppServiceProvider becomes AppLauncher, the parent class changes with it, and boot() becomes launch() [9]. Five edits, and then the file leaves app/Providers for src/Launchers [19][8].
One detail in that sample is worth checking against your composer.json: the 4.x class declares namespace App\Launchers, while the post says the classes move to src/Launchers [9][8]. Both hold only if the autoload map for App\ points at src/. The old base class is removed outright, with no deprecation step [6], so a first-party class or a third-party package that extends Phaseolies\Providers\ServiceProvider stops resolving until someone edits it [21].
The PHP requirement cannot be handled in application code. 3.x ran on 8.3 and 4.x needs 8.5, two minor versions up [1][20], and the post is blunt about the fallback: "There is no compatibility mode." [2] The language features given as the reason are the pipe operator, first-class Uri objects, clone() with property overrides, and the #[\NoDiscard] attribute [3]. The author wrote: "Some of those we can already lean on, others we will use as they settle in, and none of them would be available to the framework or to your application if we kept an 8.3 floor." [4] The stated order of operations is to upgrade the PHP runtime first, before touching a single line of application code [5].
The reason for the renames is given in the first person: "With 3.0 we wore the Laravel t-shirt. With 4.0 we took it off." [16] A 3.x project opened on service providers with register() and boot(), an App\Http\Kernel, resource_path() and database_path(), a .env file and an app/ folder [15]. According to the post, people read ServiceProvider and assumed the rest would behave the same, and sometimes it did and often it did not [23]. The rule set for 4.0 was that "if a name, a folder, or a convention exists only because another framework has it, question it." [17]
The mailer and path helper renames are not spelled out; the text breaks off mid-sentence on launcher features [22]. Until they are published, the parts of a 3.x upgrade that can be priced are the runtime and the launcher move [22][13].
What to watch
- Publication of the config file, mailer and path helper renames. They are the remaining unknowns in a 3.x upgrade estimate.
- Whether any automated rewrite ships for the launcher rename, or whether the five edits per class stay manual.
- PHP 8.5 availability on the hosts and container images a 3.x app currently deploys to, since 4.0 will not run on 8.3.