![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/bundles/CoreBundle/Update/ |
<?php namespace Mautic\CoreBundle\Update; use Mautic\CoreBundle\Update\Step\StepInterface; class StepProvider { /** * @var StepInterface[] */ private array $initialSteps = []; /** * @var StepInterface[] */ private array $finalSteps = []; public function addStep(StepInterface $step): void { if ($step->shouldExecuteInFinalStage()) { $this->finalSteps[] = $step; return; } $this->initialSteps[] = $step; } /** * @return StepInterface[] */ public function getInitialSteps(): array { return $this->orderSteps($this->initialSteps); } /** * @return StepInterface[] */ public function getFinalSteps(): array { return $this->orderSteps($this->finalSteps); } /** * @return StepInterface[] */ private function orderSteps(array $steps): array { usort($steps, fn (StepInterface $step1, StepInterface $step2): int => $step1->getOrder() <=> $step2->getOrder()); return $steps; } }