Skip to content

Feature/php8.3 support#38

Merged
emgiezet merged 6 commits intomasterfrom
feature/php8.3-support
Jan 12, 2026
Merged

Feature/php8.3 support#38
emgiezet merged 6 commits intomasterfrom
feature/php8.3-support

Conversation

@emgiezet
Copy link
Owner

Summary

This PR adds full PHP 8.3 support to errbit-php and significantly improves test coverage from ~73% to ~88%.

Key Changes

PHP 8.3 Compatibility Fixes:

  • Updated Dockerfile to use php:8.3-fpm-alpine with PECL-based Xdebug installation
  • Fixed WriterInterface to use \Throwable instead of removed ErrorInterface
  • Added proper constructor signatures to error classes (BaseError, Notice, Warning, Error, Fatal) with $file and $backtrace parameters
  • Fixed ErrorHandlers::onShutdown() parameter order for Fatal constructor
  • Fixed ErrorHandlers::onException() to pass correct arguments to Converter::convert()
  • Fixed Errbit::shouldNotify() null access issue with ignore_user_agent
  • Replaced deprecated (integer) cast with (int) in Converter.php
  • Fixed print_r() second parameter to use bool instead of int (PHP 8.3 strict)
  • Removed unused imports across multiple files
  • Deleted obsolete ErrorInterface.php

Test Coverage Improvements (+1200 lines of tests):

  • Extended ErrbitTest.php with 15+ new tests (singleton, configure, onNotify, shouldNotify, ignore_user_agent)
  • Extended ErrorHandlersTest.php with tests for onError, onException, different error types
  • Created BaseErrorTest.php for error class constructors
  • Extended NoticeTest.php with ~25 tests for XML generation, filtering, formatting
  • Extended XmlBuilderTest.php with XmlBuilder-specific tests
  • Created SocketWriterTest.php with connection scheme and payload tests
  • Extended GuzzleWriterTest.php with async/sync write tests

CI/CD Updates:

  • Updated GitHub Actions workflow for PHP 8.2 and 8.3 support

Test Plan

  • Run XDEBUG_MODE=coverage php bin/phpunit --testsuite UnitTests --coverage-text
  • Verify 108 unit tests pass
  • Verify line coverage is ~88%
  • Verify all error classes work with PHP 8.3 strict types

@emgiezet emgiezet self-assigned this Jan 12, 2026
@emgiezet emgiezet merged commit 656ea94 into master Jan 12, 2026
12 of 13 checks passed
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.

1 participant