@param array $data

@return RejectionReason
180885
public static function createFromData(array $data)
    {
        if (!isset($data['type'])) {
            throw new DomainException(self::MSG_REQUIRED_TYPE);
        }

        if (!in_array($data['type'], self::allowedRejectionTypes(), true)) {
            throw new DomainException(self::MSG_UNSUPPORTED_TYPE);
        }

        return new self($data);
    }
945827
protected function cleanup(array &$data)
    {
        foreach ($data as &$value) {
            if (\is_array($value)) {
                $this->cleanup($value);
            }
        }

        $data = array_filter($data, function ($value) {
            return null !== $value;
        });
    }
895268
public function createRestrictions(array $data)
    {
        return array_map(
            function ($restriction) {
                if ($restriction instanceof Restriction) {
                    return $restriction;
                }

                if (!is_array($restriction)) {
                    throw new DomainException('Incorrect restriction - it must be an array or instance of Restriction.');
                }

                return Restriction::createFromData($restriction);
            },
            $data
        );
    }
732091
public static function createFromArray(array $data): Retry
    {
        return new Retry(
            (string) (trim(trim(strtolower($data['url'] ?? '*')), '/')),
            (string) (trim(strtolower($data['method'] ?? '*'))),
            (int) ($data['retries'] ?? 0),
            (int) ($data['microseconds_between_retries'] ?? self::DEFAULT_MICROSECONDS_BETWEEN_RETRIES)
        );
    }
279450
public function respondWithData(array $data)
    {

        $responseData = $this->getResponseStructure(true, $data, '');
        $response = new JsonResponse($responseData, $this->getStatusCode(), $this->getHeaders());
        return $response;
    }
649025
public function addData(array $data):ErrorResponseBuilder
    {
        $this->data = array_merge($this->data, $data);

        return $this;
    }
1087373
public static function fromArray(array $data)
    {
        return new static(
            $data['uri'],
            $data['title'],
            $data['date'],
            $data['type'],
            $data['content'],
            isset($data['template']) ? $data['template'] : null,
            isset($data['description']) ? $data['description'] : null,
            isset($data['seoTitle']) ? $data['seoTitle'] : null,
            isset($data['excerpt']) ? $data['excerpt'] : null,
            isset($data['isIndex']) ? $data['isIndex'] : false
        );
    }
469557
public function fill(array $data)
    {
        if (isset($data['failures'])) {
            $this->failures = $data['failures'];
        }

        if (isset($data['rules'])) {
            $this->setRules($data['rules']);
        }

        if (isset($data['validator_class'])) {
            $this->setValidatorClass($data['validator_class']);
        }

        return $this;
    }
535982
public static function fromArray(array $data)
    {
        $result = '';
        foreach ($data as $name => $value) {
            $value = StringHelper::toString($value, "'", Serialize::SERIALIZE_JSON);
            $result .= "$name=$value; ";
        }

        return $result === '' ? null : rtrim($result);
    }
165579
public function initFromArray(array $data) {

        if (!empty($data['message'])) {
            return $this;
        }

        return $this->setTime($data[0])
            ->setLow($data[1])
            ->setHigh($data[2])
            ->setOpen($data[3])
            ->setClose($data[4])
            ->setVolume($data[5]);

    }
838384
private static function stripEmptyFiles($data)
    {
        if (!\is_array($data)) {
            return $data;
        }

        $keys = array_keys($data);
        sort($keys);

        if (self::$fileKeys === $keys) {
            if (UPLOAD_ERR_NO_FILE === $data['error']) {
                return null;
            }

            return $data;
        }

        foreach ($data as $key => $value) {
            $data[$key] = self::stripEmptyFiles($value);
        }

        return $data;
    }
216875
public function validate($data) {
    if ($data === NULL) throw $this->emptyException();
    if (!is_array($data)) throw $this->invalidArgument(1, $data, 'Array', __FUNCTION__);
    
    foreach ($this->languages as $lang) {
      if (!array_key_exists($lang, $data)) {
        throw $this->emptyException();
      }
      
      try {
        $data[$lang] = $this->wrappedRule->validate($data[$lang]);
      } catch (EmptyDataException $e) {
        throw $this->emptyException($e);
      }
    }
    
    return $data;
  }
416585
protected final function validateNewData(array $data = null) {
		if ($data === null && isset($this->_formData)) {
			$data = $this->_formData;
		}
		if ($this->rules) {
			return $this->validateData($this->rules, $data);
		}

		return true;
	}
252556
public function make( array $data = null )
    {

        if( !$this->makeableSafetyCheck() ) {
            return null;
        }

        $entity = $this->entityFactory();
        if( $data !== null ) {
            $entity->set(
                $data,
                // as data is a array the second argument doesn't make much sense here
                null,
                // set the inital values and see that the correct input validation happens
                $entity->inputValidate
             );
        }
        return $entity;

    }
1348448
private function parseDocument(array $data)
    {
        $result = null;

        $dataSegment = $this->getArrayValue($data, DocumentInterface::KEYWORD_DATA, null);
        if (empty($dataSegment) === false && is_array($dataSegment) === true) {
            $isProbablySingle = $this->isProbablySingleIdentity($dataSegment);
            $parsed           = $isProbablySingle === true ?
                $this->parseSinglePrimaryData($dataSegment) :
                $this->parseArrayOfPrimaryData($dataSegment);

            if ($parsed !== null) {
                $result = new DocumentObject($parsed);
            }
        } elseif ($dataSegment !== null) {
            $this->errors->addDataError('Invalid element.');
        }

        return $result;
    }
1363732
public function filter(array $data): array
    {
        /* @var array|DataInterface[] $result */
        $result = [];
        foreach ($data as $item) {
            $key = implode('|', $item->getKeys());
            if (!isset($result[$key]) || $result[$key]->getOrder() < $item->getOrder()) {
                $result[$key] = $item;
            }
        }
        return array_values($result);
    }
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;
    }