<?php
namespace App\Transformers;
/**
* this interface must implement from all transformers classes
*
*
*/
/**
* main reason to using transformer is considered
* the differences in the data structure between
* the providers and unify the data
* after getting the result from the provider.
*/
interface ITransformer
{
/**
* all transformers must return same structure
* @param array $item
* @return mixed
*/
/**
* @example no-link-here
*
return [
'hotelName' => $item['hotel'],
'rate' => $item['hotelRate'],
'fare' => $item['hotelFare'],
'amenities' => $item['roomAmenities']
];
*/
public function transform(array $item);
}
|