florianv/petrinet
A PHP implementation of Petri nets for modeling and simulating workflows, state machines, and concurrent processes. Define places, transitions, and tokens to represent business logic, then execute markings to track state and control transition firing.
Version 2.1.0 is a compatibility release — the headline change is PHP 8 support. There are no new public APIs, config keys, or workflow changes called out in the release notes, so the integration story is the same as the 2.x line you already know.
Minimal steps to adopt it:
php -v should report 8.0+ if you intend to take advantage of the new support. The package still installs on PHP 7.x, so mixed-fleet deployments are fine.composer require <vendor>/<package>:^2.1 (or composer update <vendor>/<package> if already on 2.x).php artisan config:clear && php artisan cache:clear so any serialized package config is rebuilt under the new PHP version.Where to look first: the package's service provider (config/app.php providers array, or bootstrap/providers.php on Laravel 11+) is the entry point for anything you need to publish, override, or extend. If the package ships config, php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider" is the fastest way to see every knob it exposes before you write any code.
First use case: take your single most representative read path (a controller or job that queries through the package) and run it under PHP 8 in a staging environment. That one smoke test tells you more about 2.1.0's real-world behaviour for your app than the changelog does.
Because 2.1.0 is additive at the platform level rather than the API level, the patterns below are about how you adopt and pin the release rather than new syntax.
Pin to a caret range, not a floor. Use "^2.1" rather than ">=2.1". The point of 2.1.0 is that it declares PHP 8 compatibility; the caret range lets patch releases land while keeping you off a hypothetical 3.x.
Run PHP 8 in CI alongside your current version. The highest-value pattern for a release like this is a matrix build. If you are still on 7.4 locally, add a PHP 8.0 (and 8.1/8.2 if you support them) job to your pipeline now — the package claims support, but only your application's dependency graph can prove it composes. Keep both jobs green until you have migrated fully.
Isolate the package behind a seam. For any package that does meaningful work, wrap its surface in a small repository or service class rather than calling it from controllers and jobs directly. This is the pattern that makes the next major version cheap: when a breaking change lands, you edit one class instead of grepping the codebase. It also gives you a single place to add PHP 8-specific behaviour if you need to branch on PHP_VERSION_ID.
Use dependency injection for overrides. Bind the package's contract (or concrete class) in a service provider and resolve it from the container. This lets tests swap in fakes and lets you decorate the package's behaviour without forking it.
Prefer the package's events/hooks over subclassing. If it dispatches events or exposes extension callbacks, hook into those for cross-cutting concerns (logging, metrics, tenancy scoping). Subclassing ties you to internals that can shift between minor releases.
Pair the upgrade with a config snapshot test. A short test asserting your resolved config array matches expectations catches accidental drift when a package version changes default values — a class of bug that is otherwise invisible until production.
"PHP 8 support" is not "PHP 8 migration." The release means the package no longer breaks on PHP 8. It does not mean your application code does not. Before or during the upgrade, scan for the classic offenders: each() (removed in 8.0), curly-brace array/string offsets like $str{0} (removed), required parameters declared after optional ones (deprecated), and assertEquals on floats without a delta (behaviour changed). Run php -l across your app or use a static analyser at PHP 8 level to surface these cheaply.
Watch your transitive dependency tree. A package declaring PHP 8 support does not mean its dependencies do. After composer update, run composer why-not php 8.0 (or composer depends) to see exactly which packages are still blocking a full PHP 8 upgrade. This is the single most useful debugging command for this class of release.
Strict typing gets louder on PHP 8. If the package or your code relies on loose comparisons (the 0 == "string" class of behaviour), PHP 8's saner string-to-number comparison rules can silently change branch logic. If you have conditionals comparing user input to integers, audit them — this is where "worked fine on 7.4" bugs come from.
Deprecation notices are not errors, but do not ignore them. PHP 8 surfaces deprecations aggressively, and under Laravel's error handling they can fill logs or, if APP_DEBUG and error reporting are configured strictly, fail test suites. Set error_reporting(E_ALL & ~E_DEPRECATED) in local tooling if needed, but track and fix the notices rather than configuring them away permanently.
Do not assume config defaults survived the minor bump. Check your published config file against the package's current stub (vendor/<vendor>/<package>/config/) after upgrading. Minor versions occasionally add new keys, and a stale published config can leave new features inert with no error message.
Extension points beat patches. If you find yourself editing files under vendor/, stop — use a service provider binding, an event listener, or a published config override instead. Anything in vendor/ disappears on the next composer update, and the absence of a changelog entry for internal changes here means you have no guarantee of stability.
Rollback is cheap; take advantage of it. Because 2.1.0 is a compatibility release with no migrations or data-shape changes implied, you can pin back to 2.0.x with a one-line composer edit if staging misbehaves. Do the upgrade in staging first precisely because the rollback cost is near zero — that is a rare luxury and worth using.
How can I help you explore Laravel packages today?