Skip to content

Modernize the stack, remove deprecations and abandoned dependencies (8.0) - #20

Open
HSAIG wants to merge 7 commits into
masterfrom
chore/modernize-stack
Open

HSAIG wants to merge 7 commits into
masterfrom
chore/modernize-stack

Conversation

@HSAIG

@HSAIG HSAIG commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Modernizes the bundle, removes the deprecations it triggered, and replaces two abandoned dependencies. Intended to be released as 8.0.0 (see UPGRADE-8.0.md for the BC breaks).

Please merge with a merge commit (not squash): the commits are meant to be reviewed separately.

Commits

  1. fix getAllResults: cherry-picked from the symfony7 branch (7091e21), which was never merged. getAllResults() called without execute() ignored the filters. A regression test is added in a later commit.
  2. Apply PHP CS Fixer: coding standards only (@Symfony, @PHP82Migration), no functional change.
  3. Modernize the stack and remove deprecations
    • Symfony ^7.4|^8.0 (7.0–7.3 are EOL), Doctrine ORM ^2.20|^3.3, missing direct dependencies declared, symfony/yaml no longer needed
    • AbstractBundle instead of the Extension/Configuration classes
    • Travis CI → GitHub Actions (PHP 8.2 → 8.5, lowest/highest deps) + PHPStan + PHP CS Fixer
    • Deprecations removed: postExecute() called on every export (PHP 8.4+ #[\Deprecated]), Twig spaceless filter, json_decode(null) without a batch cookie, PhpSpreadsheet < 1.23 compat code, PHPUnit config schema
    • Fixes: getAllResults() returned only the current page after execute(); getRequestedAction() TypeError when no action was requested; session required at construction time (console); batchHeader macro referencing a non-existent pager property
    • Tests rewritten on real Symfony services and an in-memory SQLite database (Doctrine\ORM\Query is final, the previous mocks no longer worked: the suite was failing on master). Dead Propel/Symfony 2 fixtures removed.
  4. Replace abandoned colibri-csv and jquery.cookie dependencies
    • csanquer/colibri-csv and ddeboer/transcoder (no release since 2015; deprecation on every null cell) are replaced by an internal CsvWriter: same csvWriter options and defaults, byte-identical output (checked on 1,792 option combinations)
    • jquery.batch.js no longer needs jquery.cookie: native helpers with the same cookie format (current selections kept), SameSite=Lax / Secure. Also fixes the "select all" checkbox never being updated.
  5. Prepare the 8.0 release: UPGRADE-8.0.md and 8.x-dev branch alias.
  6. Configure the Doctrine proxy directory in tests on PHP < 8.4: test-only fix found by the first CI run (ORM 3 without native lazy objects).
  7. Make exports generic and support any PhpSpreadsheet writer (closes Add Excel Export with more PHPSpreadsheet functions #19)
    • New AbstractExport base class: getResponse() is built from getContentType() and getFilename(), no more duplicated response code
    • New AbstractSpreadsheetExport: any PhpSpreadsheet writer via createWriter() (ODS, HTML, PDF…). AbstractXlsExport is now its XLSX variant
    • BC kept: existing CSV and XLSX exports produce the same content and HTTP headers
    • Fix: XLSX exports contained an extra empty autosized column after the last one
    • README: ODS example and list of writers. PDF writers are only documented, not required: mpdf/mpdf is GPL-2.0, dompdf/dompdf (LGPL-2.1) and tecnickcom/tcpdf (LGPL-3.0) are mentioned as alternatives

Checks

  • PHPUnit: 60 tests green with highest deps (Symfony 8.1, ORM 3.7, PHPUnit 12) and lowest deps (Symfony 7.4, ORM 2.20, PHPUnit 11), failOnDeprecation enabled
  • PHPStan level 5, PHP CS Fixer, composer audit: OK
  • Pagination template: same rendering as before (compared on several page configurations)
  • XLSX, ODS and HTML exports tested in CI: the PHP 8.4 job installs PhpSpreadsheet (not a dev dependency since it requires ext-gd), no test skipped

To check during review

  • jquery.batch.js was only tested in Node (cookie read/write), not in a browser: a manual check on a project using batch actions is welcome.
  • Only PHP 8.5 was available locally: the CI matrix (PHP 8.2 → 8.5) is green.

After merge

  • Tag 8.0.0 + GitHub Release
  • symfony7 branch can be deleted (its only commit is included here)

🤖 Generated with Claude Code

Paul and others added 6 commits November 10, 2026 11:40
(cherry picked from commit 7091e21)
Coding standards only, no functional change. Adds the
.php-cs-fixer.dist.php configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stack:
- Require Symfony ^7.4|^8.0 (7.0-7.3 are EOL) and Doctrine ORM ^2.20|^3.3
- Declare the dependencies actually used (dependency-injection,
  deprecation-contracts); symfony/yaml is no longer needed
- Use AbstractBundle instead of the Extension/Configuration classes
- Replace Travis CI by GitHub Actions (PHP 8.2 to 8.5, lowest/highest deps),
  add PHPStan and PHP CS Fixer
- Remove dead files (Propel/Symfony 2 test fixtures, routing.yml, tracked
  .phpunit.result.cache)

Deprecations:
- Exports no longer call the deprecated postExecute() unless overridden
  (a deprecation is then triggered)
- Remove the deprecated Twig "spaceless" filter from the templates
- Fix json_decode(null) in getBatchData() when there is no batch cookie
- Drop the PhpSpreadsheet < 1.23 compatibility code
- Migrate the PHPUnit configuration, fail on deprecations

Fixes:
- getAllResults() returned only the current page after execute()
- getRequestedAction() threw a TypeError when no action was requested
- The session was required at construction time (console commands)
- FilterObject now accepts any FormFactoryInterface
- batchHeader macro referenced a non-existent "pager" property

Tests: rewritten on real Symfony services and an in-memory SQLite
database (Doctrine Query is final and can no longer be mocked).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CSV: csanquer/colibri-csv (and ddeboer/transcoder) have not been released
since 2015 and trigger a PHP 8.1+ deprecation for every null cell.
They are replaced by an internal CsvWriter accepting the same "csvWriter"
options with the same defaults (Excel dialect: ";", CP1252, CRLF).
The output is byte-identical (checked on 1,792 option combinations).
Projects using colibri-csv classes directly must now require it themselves.

JS: jquery.batch.js no longer needs the jquery.cookie plugin (abandoned).
Native helpers keep the same cookie format, so existing batch selections
stay readable; cookies are now SameSite=Lax (and Secure over HTTPS).
Also fixes the "select all" checkbox never being updated (wrong selector)
and the shared default data being mutated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add UPGRADE-8.0.md and the "8.x-dev" branch alias for master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Doctrine ORM 3 requires a proxy directory when native lazy objects
are not available (PHP < 8.4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As suggested in #19:
- New AbstractExport base class: the response is built from
  getContentType() and getFilename() instead of being duplicated
  in each export
- New AbstractSpreadsheetExport accepting any PhpSpreadsheet writer
  (ODS, HTML, PDF...) through createWriter(); AbstractXlsExport is now
  its XLSX flavour
- CsvExport and AbstractXlsExport keep the same content and headers

Also fixes XLSX exports containing an extra empty column after the
last header. Spreadsheet exports are now tested in CI (PHP 8.4 job).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Excel Export with more PHPSpreadsheet functions

1 participant