Skip to content

Match class names case-insensitively in lookup keys - #50

Merged
TomasVotruba merged 1 commit into
mainfrom
case-insensitive-class-names
Nov 14, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
case-insensitive-class-names

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

PHP class names are case-insensitive, but lookups matched them case-sensitively, so new foo(1) for class Foo or use App\foo missed.

  • add phpast.ClassKey and lowercase the class part of keys in aggregate, symbols (enums, class consts) and inherit (classes, parents, interfaces)
  • constant and enum case names stay case-sensitive
  • written type text keeps its original case
  • object types differing only in case collapse into one, so no \Foo|\foo union
  • method-name keys are left as-is, separate PR

PHP class names are case-insensitive, so new foo(1) for class Foo or
use App\foo must hit the same entry. Lowercase the class part of the
aggregate, symbols and inherit keys via phpast.ClassKey, keep the written
case in added type text, and drop duplicate object types that differ
only in case.
@TomasVotruba
TomasVotruba force-pushed the case-insensitive-class-names branch from 9194b5f to 59df5ac Compare November 14, 2026 19:58
@TomasVotruba
TomasVotruba enabled auto-merge (squash) November 14, 2026 19:58
@TomasVotruba
TomasVotruba merged commit 68917d8 into main Nov 14, 2026
4 checks passed
@TomasVotruba
TomasVotruba deleted the case-insensitive-class-names branch November 14, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant