Skip to content

Comprehensive Bug Fixes, Late Static Binding, Type Alias Expansion & Line-Drift Hardening - #26

Merged
rcalicdan merged 10 commits into
mainfrom
internal-improvements-5
Aug 14, 2026
Merged

Comprehensive Bug Fixes, Late Static Binding, Type Alias Expansion & Line-Drift Hardening#26
rcalicdan merged 10 commits into
mainfrom
internal-improvements-5

Conversation

@rcalicdan

Copy link
Copy Markdown
Member

Overview

This pull request addresses several edge cases in runtime contract resolution, Abstract Syntax Tree (AST) transformation, and type inheritance. It enhances engine stability across PHP 8.1 through 8.5 and ensures full compatibility with complex framework architectures.

Key Changes

  • AST and Line-Drift Stability: Implemented bounded line-drift compensation in StreamWrapper to preserve exact source line numbers for single-line constructors and methods. Refactored PHP 8.4 property hook injection to maintain expression-level AST structures and avoid parser token corruption.
  • Parameter Shift Disambiguation: Resolved an inheritance mis-mapping bug where parent parameter contracts incorrectly bound to shifted child parameters when new parameters were inserted at position zero.
  • Late Static Binding: Enabled accurate runtime resolution for @return static and generic static<T> on static factory methods and composite structures (such as list<static>).
  • Type Alias and Enum Resolution: Added support for importing @phpstan-type aliases from PHP 8.1 Enums, implemented recursive multi-tier alias expansion, and normalized file paths across operating systems to eliminate Windows cache misses.
  • Callable and Iterable Interception: Added support for PHP 8.0+ named arguments in CallableWrapper, enabled lazy wrapping for collections of callables, and updated ErrorFactory to attribute stack traces directly to userland call sites.

…seEntityFactory and related entity factories for testing
…e BaseGenericFactory and BaseGenericMap for improved generic handling; add comprehensive tests for nested type aliases and late static binding scenarios.
…for exception handling; add AdvancedEdgeCasesTest for comprehensive type validation scenarios
…lidation; enhance error messages for better clarity
…stead of throwing TypeError; enhance DocblockNormalizer to auto-complete return types for callables; add NestedAggregateService for testing; improve tests for GeneratorChecker and LazyIterators.
… add ClassUsingAliasedTraitMethod for trait method aliasing tests; update AdvancedEdgeCasesTest with nested conditional return type tests and trait method aliasing validation.
…ce test cases for optional tuple parameters and lazy callable collections; improve error message assertions in AdvancedEdgeCasesTest.
@rcalicdan
rcalicdan merged commit bddfe72 into main Aug 14, 2026
12 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