Skip to content

Maintenance updates to enable new releases#1397

Merged
mike42 merged 15 commits into
developmentfrom
1396-maintenance-updates
Jul 1, 2026
Merged

Maintenance updates to enable new releases#1397
mike42 merged 15 commits into
developmentfrom
1396-maintenance-updates

Conversation

@mike42

@mike42 mike42 commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Fixing a bunch of things to get us up to a maintainable state, per #1396 plus some things I've found along the way.

  • Dropping support for PHP < 8.2 - this is a breaking change which will require a major version increment
  • Dropping Travis CI and coveralls builds
  • Introducing GitHub actions, testing 8.2, 8.3, 8.4 and 8.5
  • Updating gfx-php, our image processing dependency, where I went through this process recently (see v1.0)
  • Updating PHPUnit (strongly tied to PHP versions)
  • Fixing tests well enough that we can see that the library vaguely works on these versions
  • Updating badges in the README
  • Fixing PHP implied nullable argument deprecation warnings, which is the main reason we need to do a new release
  • A modernization pass over the code to introduce strict types, plus many type hints. There is no plan to intentionally change the API, but this may technically be a breaking change
  • Updates to copyright notice
  • Inclusion of a .gitattributes file to exclude test data from the distributed package

@mike42

mike42 commented Jun 30, 2026

Copy link
Copy Markdown
Owner Author

Currently getting failures on one test on PHP 8.5 only, looking at it.

1) CodePageTest::testDataGenerateFailed
IntlException: UConverter::__construct(): returned error 4: U_FILE_ACCESS_ERROR

Fixed: Confirmed that this is a PHP 8.5 change - it now throws if an unknown code page is passed to UConverter.

@erikn69

erikn69 commented Jun 30, 2026

Copy link
Copy Markdown

I think these changes are necessary.

Maybe example folder must be in .gitattributes with export-ignore

@mike42

mike42 commented Jun 30, 2026

Copy link
Copy Markdown
Owner Author

Thanks for picking up that typo @erikn69 - I've grabbed a few changes from your PR #1398

A few notes-

  • Inclusion of the lockfile and version override are intentional to help with development. It does not affect the production install.
  • I was 50/50 on bundling examples. I decided to leave them in for now, because it helps with bug tracker traffic if corresponding examples / known-good test images are easily available to new users.
  • Re BUG: Support \t, \r on raw usage, they are printable #1355, that doesn't relate to getting the code up and running on more modern PHP versions, I'll leave that for now.

@mike42 mike42 marked this pull request as ready for review June 30, 2026 17:52
@mike42

mike42 commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

This package has a good test suite, but to make sure everything is installable, I ran a test locally using 4 PHP versions (via docker) and a real printer.

I added this dev branch to a blank project like this:

php composer.phar init --no-interaction --name foooo
php composer.phar require --no-interaction mike42/escpos-php:dev-1396-maintenance-updates

Ran this test script:

<?php
require __DIR__ . '/vendor/autoload.php';
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\Printer;
$connector = new FilePrintConnector("out.bin");
$printer = new Printer($connector);
$printer -> text("Hello from ".PHP_VERSION."!\n");
$printer -> cut();
$printer -> close();
EOF

And then collected the output files and sent them to an Epson TM-T20III printer to test, using cat out-*.bin | sudo tee /dev/usb/lp0.

pre-release-test

@mike42 mike42 merged commit 985d57c into development Jul 1, 2026
8 checks passed
@mike42 mike42 deleted the 1396-maintenance-updates branch July 1, 2026 09:18
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.

2 participants