-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Problem
The Builder mixin interface defines all methods as instance methods, but it's intended to help static analysis tools discover static method calls on FormatterBuilder.
Current Behavior
Methods in src/Mixin/Builder.php are declared as:
public function area(string $unit): FormatterBuilder;But when using the builder, methods are called statically:
FormatterBuilder::area('m²')Expected Behavior
Methods in Builder should be declared as public static to match the actual usage pattern and help static analysis tools correctly identify these methods:
public static function area(string $unit): FormatterBuilder;Difference Between Builder and Chain Mixins
- Builder mix: Should enable static method calls on
FormatterBuilder(e.g.,FormatterBuilder::area()) - Chain mix: Enables chaining instance methods after a builder is created (e.g.,
$builder->area()->lowercase())
Impact
Static analysis tools (PHPStan, Psalm, IDE autocomplete) cannot discover or validate static method calls on FormatterBuilder because the interface declares them as instance methods.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels