diff --git a/src/core/etl/src/Flow/ETL/DataFrame.php b/src/core/etl/src/Flow/ETL/DataFrame.php index c6138fb73..282e624ad 100644 --- a/src/core/etl/src/Flow/ETL/DataFrame.php +++ b/src/core/etl/src/Flow/ETL/DataFrame.php @@ -4,7 +4,6 @@ namespace Flow\ETL; -use function Flow\ETL\DSL\ref; use Flow\ETL\DSL\To; use Flow\ETL\DSL\Transform; use Flow\ETL\Exception\InvalidArgumentException; @@ -27,7 +26,6 @@ use Flow\ETL\Row\Reference; use Flow\ETL\Row\References; use Flow\ETL\Row\Schema; -use Flow\ETL\Row\Sort; use Flow\ETL\Transformer\CallbackRowTransformer; use Flow\ETL\Transformer\CrossJoinRowsTransformer; use Flow\ETL\Transformer\DropDuplicatesTransformer; @@ -610,28 +608,15 @@ public function select(string|Reference ...$entries) : self /** * @lazy - * - * @psalm-suppress DeprecatedClass */ - public function sortBy(Sort|EntryReference ...$entries) : self + public function sortBy(EntryReference ...$entries) : self { $this ->cache($this->context->config->id()) ->run(); $this->pipeline = $this->pipeline->cleanCopy(); - - $sortBy = []; - - foreach ($entries as $entry) { - if ($entry instanceof Sort) { - $sortBy[] = $entry->isAsc() ? ref($entry->name())->asc() : ref($entry->name())->desc(); - } else { - $sortBy[] = $entry; - } - } - - $this->pipeline->source($this->context->config->externalSort()->sortBy(...$sortBy)); + $this->pipeline->source($this->context->config->externalSort()->sortBy(...$entries)); return $this; } diff --git a/src/core/etl/src/Flow/ETL/Row/Sort.php b/src/core/etl/src/Flow/ETL/Row/Sort.php deleted file mode 100644 index e3768f440..000000000 --- a/src/core/etl/src/Flow/ETL/Row/Sort.php +++ /dev/null @@ -1,37 +0,0 @@ -desc() or ref("col")->asc() instead - */ -final class Sort -{ - private function __construct( - private readonly string $column, - private readonly string $order - ) { - } - - public static function asc(string $column) : self - { - return new self($column, 'asc'); - } - - public static function desc(string $column) : self - { - return new self($column, 'desc'); - } - - public function isAsc() : bool - { - return $this->order === 'asc'; - } - - public function name() : string - { - return $this->column; - } -}