Skip to content

Conversation

@SplotyCode
Copy link
Contributor

No description provided.


/**
* @param list<int> $array
* @param positive-int $index
Copy link
Contributor

Choose a reason for hiding this comment

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

Could even include 0

* @param list<int> $array
*/
public function guardNotSafe(array $array, int $index) {
if ($index < count($array)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Another test with <=



/**
* @param list<int> $array
Copy link
Contributor

Choose a reason for hiding this comment

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

Another test with array instead of list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants