public function get(int $index): string
    {
        if (! array_key_exists($index, $this->messages)) {
            throw new \OutOfBoundsException('Message does not exists');
        }
        return $this->messages[$index];
    }
public function get(int $index): string
    {
        if (! array_key_exists($index, $this->messages)) {
            throw new \OutOfBoundsException('Message does not exists');
        }
        return $this->messages[$index];
    }
public function get ( int $ index ) : string { if ( ! array_key_exists ( $ index , $ this -> messages ) ) { throw new \ OutOfBoundsException ( 'Message does not exists' ) ; } return $ this -> messages [ $ index ] ; }
Get a message by index

@param int $index
@return string
@throws \OutOfBoundsException if the message does not exists
Get a message by index