[ 'code' => ' [ '$keys' => 'list', ], ], 'arrayKeysOfKeyedArrayReturnsNonEmptyListOfStrings' => [ 'code' => ' "bar"]); ', 'assertions' => [ '$keys' => 'non-empty-list', ], ], 'arrayKeysOfListReturnsNonEmptyListOfInts' => [ 'code' => ' [ '$keys' => 'non-empty-list>', ], ], 'arrayKeysOfKeyedStringIntArrayReturnsNonEmptyListOfIntsOrStrings' => [ 'code' => ' "bar", 42]); ', 'assertions' => [ '$keys' => 'non-empty-list', ], ], 'arrayKeysOfArrayConformsToArrayKeys' => [ 'code' => ' */ function getKeys(array $array) { return array_keys($array); } ', ], 'arrayKeysOfKeyedArrayConformsToCorrectLiteralStringList' => [ 'code' => ' */ function getKeys() { return array_keys(["foo" => 42, "bar" => 42]); } ', ], 'arrayKeysOfLiteralListConformsToCorrectLiteralOffsets' => [ 'code' => ' */ function getKeys() { return array_keys(["foo", "bar"]); } ', ], 'arrayKeyFirstOfLiteralListConformsToCorrectLiteralOffsets' => [ 'code' => ' [ 'code' => ' [ 'code' => ' $array * @return list */ function getKeys(array $array) { return array_keys($array); } ', 'error_message' => 'InvalidReturnStatement', ], 'arrayKeysOfStringKeyedArrayDoesntConformToIntList' => [ 'code' => ' */ function getKeys() { return array_keys(["foo" => 42, "bar" => 42]); } ', 'error_message' => 'InvalidReturnStatement', ], ]; } }