src/Encoder/ArrayEncoder.php
private function canOmitKey($key, & $nextIndex)
    {
        $result = $key === $nextIndex;

        if (\is_int($key)) {
            $nextIndex = max($key + 1, $nextIndex);
        }

        return $result;
    }
private function canOmitKey($key, & $nextIndex)
    {
        $result = $key === $nextIndex;

        if (\is_int($key)) {
            $nextIndex = max($key + 1, $nextIndex);
        }

        return $result;
    }
private function canOmitKey ( $ key , & $ nextIndex ) { $ result = $ key === $ nextIndex ; if ( \ is_int ( $ key ) ) { $ nextIndex = max ( $ key + 1 , $ nextIndex ) ; } return $ result ; }
Tells if the key can be omitted from array output based on expected index.
@param int|string $key Current array key
@param int $nextIndex Next expected key that can be omitted
@return bool True if the key can be omitted, false if not
Tells if the key can be omitted from array output based on expected index .