Open EmilMassey opened 2 years ago
I'm unable to use shape with nullable non-empty-string (as well as union(null(), non_empty_string()). I'm not sure if the issue is in the extension or in the phpstan itself.
union(null(), non_empty_string()
/** @param array{foo: non-empty-string, bar: non-empty-string|null} $arr */ function test(array $arr) {} $arr = shape([ 'foo' => non_empty_string(), 'bar' => nullable(non_empty_string()), ])->coerce($input); test($arr);
Expects: array{foo: non-empty-string, bar: non-empty-string|null}, array{foo: non-empty-string, bar: string|null}. given
array{foo: non-empty-string, bar: non-empty-string|null}
array{foo: non-empty-string, bar: string|null}.
I'm unable to use shape with nullable non-empty-string (as well as
union(null(), non_empty_string()
). I'm not sure if the issue is in the extension or in the phpstan itself.Expects:
array{foo: non-empty-string, bar: non-empty-string|null}
,array{foo: non-empty-string, bar: string|null}.
given