original_string: public function detailWithAddresses($id)
      {
          $dealer = $this->detail($id);
  
          if ($dealer->dealersToAddresses) {
              $addressesId = array_map(function($value) {
                  return $value['addressId'];
              }, $dealer->dealersToAddresses);
  
              $addresses = $this->client->addresses()
                  ->ids(array_values($addressesId))
                  ->all();
  
              $dealer->addresses = $addresses;
          }
  
          return $dealer;
      }
code: public function detailWithAddresses($id)
      {
          $dealer = $this->detail($id);
  
          if ($dealer->dealersToAddresses) {
              $addressesId = array_map(function($value) {
                  return $value['addressId'];
              }, $dealer->dealersToAddresses);
  
              $addresses = $this->client->addresses()
                  ->ids(array_values($addressesId))
                  ->all();
  
              $dealer->addresses = $addresses;
          }
  
          return $dealer;
      }
code_tokens: public function detailWithAddresses ( $ id ) { $ dealer = $ this -> detail ( $ id ) ; if ( $ dealer -> dealersToAddresses ) { $ addressesId = array_map ( function ( $ value ) { return $ value [ 'addressId' ] ; } , $ dealer -> dealersToAddresses ) ; $ addresses = $ this -> client -> addresses ( ) -> ids ( array_values ( $ addressesId ) ) -> all ( ) ; $ dealer -> addresses = $ addresses ; } return $ dealer ; }
docstring: Detail dealer information with additional request to addresses
  @param $id
  @return Dealer
  @throws \GuzzleHttp\Exception\GuzzleException
docstring_tokens: Detail dealer information with additional request to addresses