Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -1685,6 +1685,22 @@ public static function keyExists($array, $key, $message = '')
}
}

/**
* @psalm-pure
*
* @param array<int, int|string> $keys
Copy link
Contributor

@zerkms zerkms Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array<int, int|string> -> list<int|string>?

or

array<int, int|string> -> array<int|string>?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, it should be list<int|string>

* @param array $array
* @param string $message
*
* @throws InvalidArgumentException
*/
public static function allKeysExist($keys, $array, $message = '')
{
foreach ($keys as $key) {
static::keyExists($array, $key, $message ?: 'Expected the key %s to exist.',);
}
}

/**
* @psalm-pure
*
Expand Down