phpoffice/common
PHPOffice Common provides shared utility classes for PHPOffice projects, including XML helpers, drawing and font handling, file utilities, and compatibility code. It supports libraries such as PhpSpreadsheet and PHPWord.
Architecture fit
phpoffice/common is not an application-layer package; it is a low-level shared utility library that sits beneath the PHPOffice document stack (phpspreadsheet, phpword, phppresentation). In a Laravel codebase it is almost always a transitive dependency, not something a team wires up directly. Its responsibilities are narrow and infrastructural: OLE compound-document container reading, XML/stream helpers, and drawing primitives. Architecturally this means it should be treated as a platform dependency governed by our document-processing surface area, not as a component we design around.
Release 1.1.0 is additive rather than structural. The one substantive change is OLEWrite (PR #65), the write-side counterpart to the long-standing OLERead. That closes a genuine capability gap — historically OLE container writing lived inside downstream packages (notably PhpSpreadsheet's Xls writer), so consolidating it here is a directionally correct layering fix. However, it introduces new public API surface and, more importantly, new binary output paths into our dependency tree.
The remaining three changes are toolchain hygiene: PHP 8.5 in the CI matrix, PHPStan 2.x allowance, and PHPStan raised to level 7. These have zero runtime footprint for consumers but are meaningful signals about maintainer discipline and forward-compatibility posture.
Integration feasibility
Very low effort. This is a 1.0.5 → 1.1.0 bump with no breaking changes, no deprecations, and no removed symbols. Integration is a composer update phpoffice/common or, more realistically, an incidental consequence of updating phpspreadsheet/phpword within their existing version constraints. No Laravel service provider, config, migration, or facade involvement. No database, queue, or HTTP surface.
The only decision point is whether we consciously adopt OLEWrite. Default integration — i.e., simply absorbing the bump — is effectively a no-op we should still validate, because binary-adjacent code paths are where silent regressions hide.
Technical risk
OLEWrite is brand-new, contributed by a first-time contributor (@businessarshgoyal), and has essentially no production mileage. Any code path that begins emitting OLE containers via this class should be considered beta until we have a golden-file corpus.zip, xml, gd) is equally ready. Do not let this lull us into an early PHP 8.5 upgrade.OLEWrite and produces malformed .xls/.doc containers, the failure surfaces at the consumer (Excel repair prompts, truncated documents), not in our logs.phpoffice/common explicitly, the bump arrives silently. Our lockfile diff is the only audit trail.Key questions
.xls/.doc/.ppt export) rather than just reading? If not, OLEWrite is inert for us and risk is near zero.phpoffice/common, and does their current constraint already admit 1.1.0? (Confirm before assuming the bump is deliberate.)Stack fit
Standard Composer dependency, PSR-4 autoloaded, no framework coupling. It fits the Laravel stack without friction precisely because it does nothing framework-specific. The relevant fit question is not Laravel-version compatibility but PHP-version and extension compatibility: this package's surface depends on ext-xml, ext-zip, and binary stream handling, which is where operational surprises actually originate.
Migration path
Effectively a no-migration change. Recommended path:
composer.json if we pin explicitly) so it is trivially revertible and clearly attributable in history.OLEWrite. If we are not, add a note to the dependency register that the symbol exists but is unused, so a future engineer does not assume it is battle-tested.Compatibility
^1.0, so 1.1.0 resolves without a coordinated multi-package upgrade. Verify against our lockfile rather than assuming.Sequencing
.xlsx, one .docx, one .csv — and confirm files open cleanly in a real client, even though those paths should not touch OLEWrite.OLEWrite adoption to its own ticket, with an explicit evaluation gate: golden-file round-trip tests, a validation pass against Excel/LibreOffice, and a documented fallback (e.g., retain the PhpSpreadsheet-internal writer) if output proves unstable.Maintenance
Near-zero steady-state burden. No runtime configuration, no scheduled tasks, no persistence layer. The maintenance consideration is entirely dependency hygiene: because it arrives transitively and silently, it should be captured in our dependency-inventory process (SBOM / lockfile review) so version changes are attributable. Maintainer signals here are positive — active CI matrix expansion, tightened static analysis, and first-time contributors being merged — which suggests a healthy project rather than an abandoned one.
Support
No vendor support; community-maintained under the PHPOffice umbrella. Escalation path is upstream issues on GitHub, which historically have variable latency. Mitigation is architectural: never let this package be the sole component responsible for a customer-visible artifact without a verified fallback.
Scaling
Not a scaling-relevant component in the horizontal sense — it is CPU- and memory-bound within a single request or job. The scaling concern is per-artifact cost: OLE container handling reads/writes whole binary structures in memory. If we adopt OLEWrite for bulk export, large documents will inflate peak memory per worker. This should be modeled against our queue worker memory limits before any volume rollout, and exports of meaningful size should run in queued jobs rather than synchronous requests.
Failure modes
| Mode | Likelihood | Impact | Detection |
|---|---|---|---|
Corrupt OLE output (via OLEWrite) |
Low today, rises on adoption | High — customer-visible unreadable files | Golden-file tests; client-open smoke tests |
| Memory exhaustion on large binary artifacts | Medium if adopted for bulk export | Medium — job failures, worker restarts | Worker memory metrics; queue failure rate |
| Silent transitive version drift | Medium | Low–Medium — unattributable behavior change | Lockfile diff review; SBOM |
| Regression in existing read paths | Very low | Medium | Existing document-ingest test suite |
| PHP 8.5 assumption mismatch | Low | Low — future upgrade friction | Deferred until we plan 8.5 |
Ramp-up
Minimal for absorbing the bump — a competent PHP engineer needs no ramp-up to consume a transitive minor version. Ramp-up is only material if we adopt OLEWrite, in which case budget for: understanding the compound-document container format, building a golden-file corpus, and establishing a binary-output testing convention the team does not currently need. Estimate that as a small, self-contained spike rather than a line item on this release.
Recommendation
Adopt 1.1.0 as a routine, isolated dependency bump — no breaking changes, no migration, no deprecations, and the toolchain changes are strictly beneficial to the ecosystem. Treat OLEWrite as additive capability we are not yet consuming: flag it as unproven, do not build production write paths on it without a dedicated evaluation ticket, and record the deliberate deferral so the decision is revisit-able rather than accidental.
How can I help you explore Laravel packages today?