Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| ParsedProperty | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| payloadHash | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace ImovelZapAi\Importing\Application\Data; |
| 6 | |
| 7 | final readonly class ParsedProperty |
| 8 | { |
| 9 | /** |
| 10 | * @param list<ParsedMedia> $media |
| 11 | * @param array<string, string> $raw |
| 12 | */ |
| 13 | public function __construct( |
| 14 | public int $index, |
| 15 | public ?string $externalId, |
| 16 | public ?string $title, |
| 17 | public ?string $transactionType, |
| 18 | public ?string $propertyType, |
| 19 | public ?string $publicationType, |
| 20 | public ?string $listPrice, |
| 21 | public ?string $rentalPrice, |
| 22 | public ?string $description, |
| 23 | public ?string $detailUrl, |
| 24 | public ?string $country, |
| 25 | public ?string $state, |
| 26 | public ?string $city, |
| 27 | public ?string $neighborhood, |
| 28 | public ?string $address, |
| 29 | public ?string $streetNumber, |
| 30 | public ?string $complement, |
| 31 | public ?string $postalCode, |
| 32 | public ?string $latitude, |
| 33 | public ?string $longitude, |
| 34 | public ?string $bedrooms, |
| 35 | public ?string $bathrooms, |
| 36 | public ?string $suites, |
| 37 | public ?string $garage, |
| 38 | public ?string $livingArea, |
| 39 | public ?string $lotArea, |
| 40 | public array $media, |
| 41 | public array $raw, |
| 42 | ) {} |
| 43 | |
| 44 | public function payloadHash(): string |
| 45 | { |
| 46 | return hash('sha256', json_encode($this->raw, JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR)); |
| 47 | } |
| 48 | } |