@@ -97,16 +97,17 @@ function testNestedConditionalReturn(string $format, mixed $value): mixed
9797 /** @var GenericCollection<?positive-int> $collection */
9898 $ collection = new GenericCollection ();
9999
100- expect (fn () => $ collection ->add (-50 ))
101- ->toThrow (TypeError::class, 'Argument $item (template T = ?positive-int) must be of type positive-int, negative int (-50) given ' );
100+ expect (fn () => $ collection ->add (-50 ))
101+ ->toThrow (TypeError::class, 'Argument $item (template T = ?positive-int) must be of type positive-int, negative int (-50) given ' )
102+ ;
102103 });
103104 });
104105
105106 describe ('Collections of Lazy Callables ' , function () {
106107 test ('executes and validates a list of lazy callable proxies ' , function () {
107108 $ formatters = [
108- fn (int $ id ): string => "id_ {$ id }" ,
109- fn (int $ id ): string => "user# {$ id }" ,
109+ fn (int $ id ): string => "id_ {$ id }" ,
110+ fn (int $ id ): string => "user# {$ id }" ,
110111 ];
111112
112113 $ results = processFormatterList ($ formatters , 42 );
@@ -115,28 +116,31 @@ function testNestedConditionalReturn(string $format, mixed $value): mixed
115116
116117 test ('throws TypeError when a callable in the collection returns an invalid type ' , function () {
117118 $ formatters = [
118- fn (int $ id ): string => "id_ {$ id }" ,
119- fn (int $ id ): string => '' ,
119+ fn (int $ id ): string => "id_ {$ id }" ,
120+ fn (int $ id ): string => '' ,
120121 ];
121122
122- expect (fn () => processFormatterList ($ formatters , 42 ))
123- ->toThrow (TypeError::class, 'Callback $formatters[1] return value must be of type non-empty-string ' );
123+ expect (fn () => processFormatterList ($ formatters , 42 ))
124+ ->toThrow (TypeError::class, 'Callback $formatters[1] return value must be of type non-empty-string ' )
125+ ;
124126 });
125127 });
126128
127129 describe ('Multi-Branch Nested Conditional Return Types ' , function () {
128130 test ('throws TypeError when return value violates nested conditional branch ' , function () {
129- expect (fn () => testNestedConditionalReturn ('float ' , -5.5 ))
130- ->toThrow (TypeError::class, 'Return value must be of type positive-float ' );
131+ expect (fn () => testNestedConditionalReturn ('float ' , -5.5 ))
132+ ->toThrow (TypeError::class, 'Return value must be of type positive-float ' )
133+ ;
131134 });
132135 });
133136
134137 describe ('Trait Method Aliasing (use Trait { old as new; }) ' , function () {
135138 test ('inherits DocBlock contracts when a Trait method is aliased in a class ' , function () {
136139 $ service = new TypePHP \Tests \Fixtures \Services \ClassUsingAliasedTraitMethod ();
137140
138- expect (fn () => $ service ->recordAuditLog (-1 , 'audit_ok ' ))
139- ->toThrow (TypeError::class, 'Argument $level must be of type positive-int ' );
141+ expect (fn () => $ service ->recordAuditLog (-1 , 'audit_ok ' ))
142+ ->toThrow (TypeError::class, 'Argument $level must be of type positive-int ' )
143+ ;
140144 });
141145 });
142146});
0 commit comments