Get maintenance history as list of state

@todo Return an arrayIterator
@return array
336331
public function getHistory()
    {
        $history = array(
            1 => new MaintenanceState(json_decode($this->getDriver()->get(self::PREFIX . self::LAST_MODE), true))
        );

        $i = 2;
        while ($data = json_decode($this->getDriver()->get(self::PREFIX . $i), true)) {
            $history[$i] = new MaintenanceState($data);
            $i++;
        }
        return $history;
    }
84989
public function getOldRelations()
    {
        $oldRelations = [];
        foreach ($this->_relations as $relationName) {
            $oldRelations[$relationName] = $this->getOldRelation($relationName);
        }
        return $oldRelations;
    }
155502
public function getHistory()
    {
        $dqb = $this->_em->createQueryBuilder();
        $dqb->select(array('j'))
            ->from('PlaygroundCore\Entity\Cronjob', 'j')
            ->where($dqb->expr()->in('j.status', array(
                self::STATUS_SUCCESS, self::STATUS_MISSED, self::STATUS_ERROR,
            )))
            ->orderBy('j.scheduleTime', 'ASC');

        return $dqb->getQuery()->getResult();
    }
1172404
public function getAll() {
        $system = array();

        $system['contact'] = $this->contact();
        $system['description'] = $this->description();
        $system['location'] = $this->location();
        $system['name'] = $this->name();
        //$system['services'] = $this->services();
        $system['uptime'] = $this->uptime();

        return $system;
    }
41422
public function getAll() : array
    {
        $convertedClaims = [];
        $timeFields = ['exp', 'nbf', 'iat'];

        // Convert date times to timestamps
        foreach ($this->claims as $name => $value) {
            if ($value !== null && in_array($name, $timeFields)) {
                /** @var DateTimeImmutable $value */
                $value = $value->getTimestamp();
            }

            $convertedClaims[$name] = $value;
        }

        if (!isset($this->claims['jti'])) {
            $convertedClaims['jti'] = $this->getId();
        }

        return $convertedClaims;
    }
92459
public function getUpgradeStatusDetails() {
    $storage = $this->getLoggerEntityStorage();
    $total_count = (int) $storage->getQuery()
      ->count()
      ->execute();

    if ($total_count === 0) {
      return [
        'resolved' => 0,
        'conflicts' => 0,
        'total' => 0,
      ];
    }

    $conflicts = (int) $storage->getQuery()
      ->condition('status', 0)
      ->count()
      ->execute();
    return [
      'resolved' => $total_count - $conflicts,
      'conflicts' => $conflicts,
      'total' => $total_count,
    ];
  }
303291
protected function getPersistent()
    {
        $values = [];
        if ($this->getSessionStorage()->has('search')) {
            $values = $this->getSessionStorage()->get('search');
        }

        if (\array_key_exists($this->getEnvironment()->getDataDefinition()->getName(), $values)) {
            return $values[$this->getEnvironment()->getDataDefinition()->getName()];
        }

        return [];
    }
1046562
public function actionIndex()
    {
        $app = Yii::$app;

        if ($app->getRequest()->getIsAjax()) {
            return false;
        }

        return $this->render($app->maintenanceMode->viewPath, [
            'title' => $app->maintenanceMode->title,
            'message' => $app->maintenanceMode->message
        ]);
    }
718705
private function getHistory($right_area, $type)
    {
        $history = [];
        $a_history_area = $right_area->find('div[class="updates '.$type.'"]', 0);
        foreach ($a_history_area->find('.statistics-updates') as $each_history) {
            $temp_history = [];
            $history_data_area = $each_history->find('.data', 0);

            $temp_history['image'] = $this->getHistoryImage($each_history);
            $temp_history['id'] = $this->getHistoryId($history_data_area);
            $temp_history['title'] = $this->getHistoryTitle($history_data_area);
            $temp_history['date'] = $this->getHistoryDate($history_data_area);
            $progress = $this->getHistoryProgress($history_data_area);
            $temp_history = array_merge($temp_history, $progress);

            $history[] = $temp_history;
        }

        return $history;
    }
15171
public static function get_all() {
        $states = array();
        $us = new ReflectionClass('question_state');
        foreach ($us->getStaticProperties() as $name => $notused) {
            $states[] = self::$$name;
        }
        return $states;
    }
976290
protected function getStates()
    {
        //Get the states from the JSON file
        if (sizeof($this->states) == 0) {
            $this->states = json_decode(file_get_contents(__DIR__ . '/Models/states.json'), true);
        }

        //Return the states
        return $this->states;
    }
420726
public function listCronsStatus(): array
    {
        /** @var EdgarCron[] $edgarCrons */
        $edgarCrons = $this->repository->listCrons();
        /** @var CronInterface[] $crons */
        $crons = $this->getCrons();
        $cronAlias = [];

        foreach ($crons as $cron) {
            $cronAlias[$cron->getAlias()] = $cron;
        }

        if ($edgarCrons) {
            foreach ($edgarCrons as $edgarCron) {
                if (isset($cronAlias[$edgarCron->getAlias()])) {
                    $cronAlias[$edgarCron->getAlias()] = $edgarCron;
                }
            }
        }

        return $cronAlias;
    }
831283
function getHistory()
    {
        $scrollback = '';
        $last_attr = $this->base_attr_cell;
        for ($i = 0; $i < count($this->history); $i++) {
            for ($j = 0; $j <= $this->max_x + 1; $j++) {
                $cur_attr = $this->history_attrs[$i][$j];
                $scrollback.= $this->_processCoordinate($last_attr, $cur_attr, isset($this->history[$i][$j]) ? $this->history[$i][$j] : '');
                $last_attr = $this->history_attrs[$i][$j];
            }
            $scrollback.= "\r\n";
        }
        $base_attr_cell = $this->base_attr_cell;
        $this->base_attr_cell = $last_attr;
        $scrollback.= $this->_getScreen();
        $this->base_attr_cell = $base_attr_cell;

        return '<pre width="' . ($this->max_x + 1) . '" style="color: white; background: black">' . $scrollback . '</span></pre>';
    }
299521
public function get_versions() {
        if ($this->versions === null) {
            $policyid = $this->get_policy_id_filter();
            $versionid = $this->get_version_id_filter();
            $this->versions = [];
            foreach ($this->get_avaliable_policies() as $policy) {
                if ($policyid && $policy->id != $policyid) {
                    continue;
                }
                if ($versionid) {
                    if (array_key_exists($versionid, $policy->versions)) {
                        $this->versions[$versionid] = $policy->versions[$versionid];
                        break; // No need to keep searching.
                    }
                } else if ($policy->currentversion) {
                    $this->versions[$policy->currentversion->id] = $policy->currentversion;
                }
            }
        }
        return $this->versions;
    }
973166
public static function getStatusList()
    {
        return [
            TransactionInterface::STATUS_ORDER_UNKNOWN => 'order_unknown',
            TransactionInterface::STATUS_OPEN => 'open',
            TransactionInterface::STATUS_PENDING => 'pending',
            TransactionInterface::STATUS_VALIDATED => 'validated',
            TransactionInterface::STATUS_CANCELLED => 'cancelled',
            TransactionInterface::STATUS_UNKNOWN => 'status_unknown',
            TransactionInterface::STATUS_ERROR_VALIDATION => 'error_validation',
            TransactionInterface::STATUS_WRONG_CALLBACK => 'wrong_callback',
            TransactionInterface::STATUS_WRONG_REQUEST => 'wrong_request',
            TransactionInterface::STATUS_ORDER_NOT_OPEN => 'order_to_open',
        ];
    }
1218299
public function getCurrentPlatformState()
    {
        $data = json_decode($this->getDriver()->get(self::PREFIX . self::LAST_MODE), true);
        if (! $data) {
            throw new \common_exception_NotFound();
        }
        return new MaintenanceState($data);
    }
861866
public static function getStatusList()
    {
        return [
            self::STATUS_OPEN => 'status_open',
            self::STATUS_PENDING => 'status_pending',
            self::STATUS_SENT => 'status_sent',
            self::STATUS_CANCELLED => 'status_cancelled',
            self::STATUS_COMPLETED => 'status_completed',
            self::STATUS_RETURNED => 'status_returned',
        ];
    }