mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2025-01-22 05:11:47 +01:00
fix typing issues (#23)
This commit is contained in:
parent
c3d0cdc062
commit
e8dba9dc81
@ -52,6 +52,10 @@ function sort_with_keys_by(iterable $iterable, callable $scalar_func, ?callable
|
||||
);
|
||||
|
||||
$sorted = sort_with_keys($tuples, $tuple_comparator);
|
||||
/**
|
||||
* @psalm-suppress InvalidArgument
|
||||
* @psalm-suppress MixedArgumentTypeCoercion
|
||||
*/
|
||||
$result = Iter\map_with_key(
|
||||
$sorted,
|
||||
/**
|
||||
|
@ -30,7 +30,7 @@ interface IMutableVector extends IVector, IMutableAccessibleCollection
|
||||
/**
|
||||
* Returns a `IMutableVector` containing the keys of the current `IMutableVector`.
|
||||
*
|
||||
* @psalm-return IMutableVector<T>
|
||||
* @psalm-return IMutableVector<int>
|
||||
*/
|
||||
public function keys(): IMutableVector;
|
||||
|
||||
|
@ -305,7 +305,10 @@ final class MutableVector implements IMutableVector
|
||||
*/
|
||||
public function keys(): MutableVector
|
||||
{
|
||||
return new MutableVector(Arr\keys($this->elements));
|
||||
/** @psalm-var list<int> $keys */
|
||||
$keys = Arr\keys($this->elements);
|
||||
|
||||
return new MutableVector($keys);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,5 +11,8 @@ use Psl\Math;
|
||||
*/
|
||||
function float(): float
|
||||
{
|
||||
return (float) int(0, Math\INT53_MAX) / Math\INT53_MAX;
|
||||
/** @var float|int $result */
|
||||
$result = int(0, Math\INT53_MAX) / Math\INT53_MAX;
|
||||
|
||||
return (float) $result;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ function string(int $length, ?string $alphabet = null): string
|
||||
|
||||
$ret = '';
|
||||
while ($length > 0) {
|
||||
$urandom_length = (int) Math\ceil(2 * $length * $bits / 8.0);
|
||||
$urandom_length = (int) Math\ceil((float) (2 * $length * $bits) / 8.0);
|
||||
$data = bytes($urandom_length);
|
||||
$unpacked_data = 0;
|
||||
$unpacked_bits = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user