Closed azjezz closed 3 years ago
new return type providers:
Iter\count
positive-int
$iterable
non-empty-list<_>
non-empty-array<_, _>
int(0)
empty&array<_, _>
int(x)
x
Iter\last
Tv
non-empty-list<Tv>
non-empty-array<_, Tv>
null
array{...}
Iter\first
Str\after
null|lowercase-string
lowercase-string
Str\after_last
Str\after_ci
Str\after_last_ci
Str\before
Str\before_last
Str\before_ci
Str\before_last_ci
Str\Byte\after
Str\Byte\after_last
Str\Byte\after_ci
Str\Byte\after_last_ci
Str\Byte\before
Str\Byte\before_last
Str\Byte\before_ci
Str\Byte\before_last_ci
Str\Grapheme\after
Str\Grapheme\after_last
Str\Grapheme\after_ci
Str\Grapheme\after_last_ci
Str\Grapheme\before
Str\Grapheme\before_last
Str\Grapheme\before_ci
Str\Grapheme\before_last_ci
Str\chunk
non-empty-list<non-empty-string>
$string
non-empty-string
non-empty-list<non-empty-lowercase-string>
non-empty-lowercase-string
Str\Byte\chunk
Str\lowercase
non-falsy-string
Str\Byte\lowercase
Str\repeat
string(x)
$multiplier
Str\slice
Str\Byte\slice
Str\Grapheme\slice
Str\splice
$replacement
Str\Byte\splice
Str\split
Str\Byte\split
Str\uppercase
Str\Byte\uppercase
cc @bendavies, hopefully this solves your issue ( and more ) :)
TODO: add static analysis tests to PSL.
awesome, thanks!
new return type providers:
Iter\count
returnpositive-int
when$iterable
is anon-empty-list<_>
.Iter\count
returnpositive-int
when$iterable
is anon-empty-array<_, _>
.Iter\count
returnint(0)
when$iterable
isempty&array<_, _>
Iter\count
returnint(x)
when$iterable
is anon-empty-list<_>
with a known count, wherex
is the size of$iterable
.Iter\count
returnint(x)
when$iterable
is anon-empty-array<_, _>
with a known count, wherex
is the size of$iterable
.Iter\last
returnTv
when$iterable
is anon-empty-list<Tv>
.Iter\last
returnTv
when$iterable
is anon-empty-array<_, Tv>
.Iter\last
returnnull
when$iterable
isempty&array<_, _>
Iter\last
returnTv
when$iterable
isarray{...}
with at least 1 property.Iter\first
returnTv
when$iterable
is anon-empty-list<Tv>
.Iter\first
returnTv
when$iterable
is anon-empty-array<_, Tv>
.Iter\first
returnnull
when$iterable
isempty&array<_, _>
Iter\first
returnTv
when$iterable
isarray{...}
with at least 1 property.Str\after
returnnull|lowercase-string
when the first argument islowercase-string
.Str\after_last
returnnull|lowercase-string
when the first argument islowercase-string
.Str\after_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\after_last_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\before
returnnull|lowercase-string
when the first argument islowercase-string
.Str\before_last
returnnull|lowercase-string
when the first argument islowercase-string
.Str\before_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\before_last_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Byte\after
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Byte\after_last
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Byte\after_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Byte\after_last_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Byte\before
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Byte\before_last
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Byte\before_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Byte\before_last_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Grapheme\after
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Grapheme\after_last
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Grapheme\after_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Grapheme\after_last_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Grapheme\before
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Grapheme\before_last
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Grapheme\before_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\Grapheme\before_last_ci
returnnull|lowercase-string
when the first argument islowercase-string
.Str\chunk
returnsnon-empty-list<non-empty-string>
if$string
isnon-empty-string
Str\chunk
returnsnon-empty-list<non-empty-lowercase-string>
if$string
isnon-empty-lowercase-string
Str\Byte\chunk
returnsnon-empty-list<non-empty-string>
if$string
isnon-empty-string
Str\Byte\chunk
returnsnon-empty-list<non-empty-lowercase-string>
if$string
isnon-empty-lowercase-string
Str\lowercase
returnsnon-empty-lowercase-string
if$string
isnon-empty-string
ornon-falsy-string
Str\Byte\lowercase
returnsnon-empty-lowercase-string
if$string
isnon-empty-string
ornon-falsy-string
Str\repeat
returnsnon-empty-lowercase-string
if$string
isnon-empty-lowercase-string
Str\repeat
returnsnon-empty-string
if$string
isnon-empty-string
Str\repeat
returnslowercase-string
if$string
islowercase-string
Str\repeat
returnsstring(x)
if$string
is a literal, and$multiplier
is literal, wherex
is the result.Str\slice
returnslowercase-string
if$string
islowercase-string
Str\Byte\slice
returnslowercase-string
if$string
islowercase-string
Str\Grapheme\slice
returnslowercase-string
if$string
islowercase-string
Str\splice
returnslowercase-string
if$string
islowercase-string
and$replacement
islowercase-string
Str\Byte\splice
returnslowercase-string
if$string
islowercase-string
and$replacement
islowercase-string
Str\split
returnsnon-empty-list<non-empty-string>
if$string
isnon-empty-string
Str\split
returnsnon-empty-list<non-empty-lowercase-string>
if$string
isnon-empty-lowercase-string
Str\Byte\split
returnsnon-empty-list<non-empty-string>
if$string
isnon-empty-string
Str\Byte\split
returnsnon-empty-list<non-empty-lowercase-string>
if$string
isnon-empty-lowercase-string
Str\uppercase
returnsnon-empty-string
if$string
isnon-empty-string
Str\Byte\uppercase
returnsnon-empty-string
if$string
isnon-empty-string