Runs an __is_array__ test on some $data.
A test format can be set (read Documentation)

@param mixed $data
@param array $failed
@return bool
5341
public function check($data = null, &$failed = array()) {
        if (is_null($data)) $data = $this->data;
        if (!isset($this->format)) $this->format = "array";

        // reset the reporting array
        $failed = array();

        if ($this->getNull()) {
            $valid = (is_null($data) || $this->checkType($data, $failed)) && $this->checkFormat($data, $failed);
        } else {
            $valid = $this->checkType($data, $failed) && $this->checkFormat($data, $failed);
        }
        // save the failures for later checking
        if (!is_array($failed) || is_array($failed) && count($failed) > 0) {
            Structure::$lastFail = $failed;
        }
        return $valid;
    }
645880
public function update(array $data)
    {
        try
        {
            if ( $this->validator->with($data)->validForUpdate() )
            {
                $this->users->update($data['id'], $this->validator->getData());
                return true;
            }
        }
        catch (LoginRequiredException $e)
        {
            $this->validator->add('LoginRequiredException',$e->getMessage());
        }
        catch (PasswordRequiredException $e)
        {
            $this->validator->add('PasswordRequiredException',$e->getMessage());
        }
        catch (UserExistsException $e)
        {
            $this->validator->add('UserExistsException',$e->getMessage());
        }

        return false;
    }
342231
public function update(array $data)
    {
        if ( $this->validator->with($data)->validForUpdate() )
        {
            $data['permissions'] = explode(',', $data['permissions']);
            $this->permission->update($data);
            return true;
        }
        else
        {
            return false;
        }
    }
236862
public function create(array $data)
    {
        try
        {
            if ($this->validator->with($data)->passes())
            {
                $this->groups->create($data);
                return true;
            }
        }
        catch (GroupExistsException $e)
        {
            $this->validator->add('GroupExistsException', $e->getMessage());
        }
        catch (NameRequiredException $e)
        {
            $this->validator->add('NameRequiredException', $e->getMessage());
        }

        return false;
    }
90297
public function setData(array $data)
    {
        $data['TASK'] = $this->task;
        $data['RETRY'] = $this->retry;
        $data['APPLICATION'] = $this->application;

        $this->message = $data;
        return $this;
    }
127311
public static function check(array $data = null)
    {
        if ($data === null) {
            return self::$defaults;
        }
        foreach (self::$defaults as $section => $default) {
            if (array_key_exists($section, $data)) {
                $value = $data[$section];
                if (is_array($default)) {
                    if (!is_array($value)) {
                        throw new InvalidSection($section, 'must be an array');
                    }
                    if (array_values($value) !== $value) {
                        throw new InvalidSection($section, 'must be a numeric array');
                    }
                } elseif (is_array($value)) {
                    throw new InvalidSection($section, 'must be a string');
                }
            } else {
                if (in_array($section, self::$required)) {
                    throw new InvalidSection($section, 'is required, but not specified');
                }
                $data[$section] = $default;
            }
        }
        if (!in_array($data['version'], [3, '3'], true)) {
            throw new UnsupportedVersion($data['version']);
        }
        if (count(array_diff_key($data['sourcesContent'], $data['sources'])) > 0) {
            throw new InvalidSection('sourcesContent', 'does not correspond to sources');
        }
        return $data;
    }
1066593
private function checkRequiredData($data, $isNew)
    {
        $this->checkDataSet($data, 'order', $isNew) && $this->checkDataSet($data['order'], 'id', $isNew);
        $this->checkDataSet($data, 'deliveryAddress', $isNew);
    }
544010
public function get($data, $with = [], $cache = false, $failException = false)
    {
        if (is_null($data)) {
            return;
        }

        if (true === $with || is_int($with)) {
            $cache = $with;
            $with  = [];
        }

        return $this->parseQuery($data, $with, $cache)
            ->failException($failException)
            ->find($data);
    }
1292990
private static function validateUnserializedData(array $data): void
    {
        /** Let's check if there are mandatory fields */
        if (
            false === isset($data['namespace']) ||
            false === isset($data['message'])
        ) {
            throw new \UnexpectedValueException(
                'The serialized data must contains a "namespace" field (indicates the message class) and "message" (indicates the message parameters)'
            );
        }

        /** Let's check if the specified class exists */
        if ('' === $data['namespace'] || false === \class_exists((string) $data['namespace']))
        {
            throw new \UnexpectedValueException(
                \sprintf('Class "%s" not found', $data['namespace'])
            );
        }
    }
563326
protected function validate(array &$data)
    {
        $messages = [];
        if (isset($data['inserts']) && !empty($data['inserts'])) {
            array_push($messages, ['warning', sprintf('Found %s new files. New, not original files may increase the risk of instability.', count($data['inserts']))]);
        }
        if (isset($data['deletes']) && !empty($data['deletes'])) {
            array_push($messages, ['warning', sprintf('%s files has been deleted. Deleting system files may increase the risk of instability.', count($data['deletes']))]);
        }
        if (isset($data['updates']) && !empty($data['updates'])) {
            array_push($messages, ['warning', sprintf('%s files has been changed. File modifications are unacceptable and can increase the risk of instability.', count($data['updates']))]);
        }
        $data = array_merge($data, ['messages' => $messages]);
        return $data;
    }
183030
protected function checkData(array $data)
    {
        if (! isset($data[self::STATUS]) || ! in_array($data[self::STATUS], self::$availableStatus)) {
            throw new \common_Exception(
                __('A maintenance status must have a STATUS: "%s" or "%s"', self::LIVE_MODE, self::OFFLINE_MODE)
            );
        }
    }
1028905
public function error($message, $data = null, $code = 404) {
		$this->_status = static::STATUS_FAIL;
		$this->_message = $message;
		$this->_data = !$data && $data !== false ? null : $data;
		$this->_code = $code;
	}
557754
private function assertArrayValue($value, $message = null)
    {
        if (!is_array($value)) {
            return $this->failedAssert(sprintf('value is an array, got "%s".', is_object($value) ? get_class($value) : gettype($value)), $message);
        }

        return true;
    }
944490
protected function isFailedSuite(array $tests)
    {
        $failed = false;

        foreach ($tests as $test) {
            if ($test['exception']) {
                $failed = true;
                break;
            }
        }

        return $failed;
    }
695743
public function has_data($data=null)
  {
    if ( \is_null($data) ){
      $data = $this->data;
    }
    return ( \is_array($data) && (\count($data) > 0) ) ? 1 : false;
  }
460359
public function validate(&$failed = null)
    {
        $result = $this->getRepository()->getSpace()->validateEntities($failed);
        return !$failed->contains($this);
    }
1120137
public function setFailed($iPaymentId, $aData = []): bool
    {
        $aData['status'] = self::STATUS_FAILED;
        return $this->update($iPaymentId, $aData);
    }