netbrothers-gmbh/version-bundle
NetBrothers VersionBundle helps Symfony apps centralize and expose application version/build metadata. Configure a version once and access it in services and Twig templates for easy display, diagnostics, release tracking, and consistent version reporting across environments.
Start by confirming runtime compatibility before installing or upgrading:
composer why-not php 8.4 and inspect composer.json constraints if the install fails.Minimal upgrade/install steps:
composer require <vendor>/<package>:^4.0
php artisan vendor:publish --tag=<package-config> # only if the package provides config
php artisan about
Look first at:
final class change.extends usage against package service or command classes.First use case: resolve services through Laravel’s container rather than instantiating or extending package classes directly.
use Vendor\Package\Contracts\SomeService;
public function __construct(private SomeService $service) {}
Because v4 marks service and command classes as final, the intended integration style is dependency injection and interface binding, not subclassing.
The main v4 migration pattern is replacing inheritance with composition or decoration.
Before:
class CustomService extends PackageService
{
public function handle(): void
{
parent::handle();
// custom logic
}
}
After:
final class CustomService implements SomeService
{
public function __construct(
private SomeService $inner,
) {}
public function handle(): void
{
$this->inner->handle();
// custom logic
}
}
Bind the decorator in a service provider:
use Vendor\Package\Contracts\SomeService;
use Vendor\Package\SomeService as BaseService;
use App\Services\CustomService;
public function register(): void
{
$this->app->bind(SomeService::class, BaseService::class);
$this->app->extend(SomeService::class, function (SomeService $service, $app) {
return new CustomService($service);
});
}
If you previously extended a package command to change behavior, use one of these instead:
Avoid relying on protected methods or internal command properties; final classes make those extension points unavailable by design.
$this->app->extend() for decoration, but only when the resolved service is type-compatible with the contract.composer.json to ^4.0.composer update <vendor>/<package> --with-dependencies.extends references to package services and commands.The BC break is not just stylistic: any code that extends package service or command classes will fatal-error after upgrade. PHPUnit mocks of final classes also fail unless you mock an interface instead.
Use interfaces for test doubles:
$mock = Mockery::mock(SomeService::class);
$this->app->instance(SomeService::class, $mock);
If the package does not expose an interface for a service you need to replace, wrap it in your own application-level contract.
The package will not install on PHP 8.3 or earlier. This can block Laravel upgrades or CI pipelines. Check:
php -vcomposer config platform.phpLaravel itself may constrain Symfony components to a different major version. If Composer reports a conflict, do not force the package in with --ignore-platform-reqs unless you have verified the runtime. Instead:
composer why-not symfony/console 8.0
composer why-not <vendor>/<package> 4.0
Resolve the Laravel/Symfony/PHP version triangle first.
Because services and commands are final, the supported extension points are now likely:
Check the updated documentation for the recommended replacement before refactoring.
Useful commands:
composer diagnose
composer outdated --direct
php artisan about
php artisan package:discover --ansi
If a command fails after upgrade, check whether your application registered a subclass of a now-final package command. The error will usually mention “cannot extend final class.”
If the package publishes config, republish or diff it after upgrading. Major versions often add or rename keys. Prefer environment variables and config caching checks:
php artisan config:clear
php artisan config:cache
extends against package service/command classes.How can I help you explore Laravel packages today?