<?php namespace IQDEV\ElasticSearch\Search\Sorting; abstract class SortingPair implements Sorting { public string $by; public string $direction; public function __construct(string $by = '', string $direction = 'asc') { $this->by = $by; $this->direction = $direction; } public function es(): array { return [$this->by => $this->direction]; } }