original_string: public function is_participant(string $id_chat, string $id_user = null): ?bool
    {
      if ( $this->check() ){
        return (bool)$this->db->count('bbn_chats_users', [
          'id_chat' => $id_chat,
          'id_user' => $id_user ?: $this->user->get_id()
        ]);
      }
      return null;
    }
code: public function is_participant(string $id_chat, string $id_user = null): ?bool
    {
      if ( $this->check() ){
        return (bool)$this->db->count('bbn_chats_users', [
          'id_chat' => $id_chat,
          'id_user' => $id_user ?: $this->user->get_id()
        ]);
      }
      return null;
    }
code_tokens: public function is_participant ( string $ id_chat , string $ id_user = null ) : ? bool { if ( $ this -> check ( ) ) { return ( bool ) $ this -> db -> count ( 'bbn_chats_users' , [ 'id_chat' => $ id_chat , 'id_user' => $ id_user ? : $ this -> user -> get_id ( ) ] ) ; } return null ; }
docstring: Checks whether the given user is participant of the given chat.
  
  @param string $id_chat
  @param string $id_user
  @return bool|null
docstring_tokens: Checks whether the given user is participant of the given chat .