Checks if data contains neede keye

@param array $data
@throws \Exception
@return \Mailer\Mail\ClassifiedAnswer
328225
public function checkData(array $data) 
	{
		$keys = array('to', 'fullname', 'title', 'activationLink', 'siteurl', 'cdnurl', 'siteName');
		
		foreach($keys as $key) {
			if(!array_key_exists($key, $data)) {
				throw new \Exception('Key not in data');
			}
		}
		
		return $this;
	}
636254
private function checkIfSet($key, array $data)
    {
        $keyExists = array_key_exists($key, $data);

        return $keyExists && $data[$key] !== null && $data[$key] !== '';
    }
992886
protected final function validateUpdateData(array $data = null) {
		if ($data === null && isset($this->_formData)) {
			$data = $this->_formData;
		}
		if ($this->rules) {
			$newRules = [];
			foreach ($data as $key => $v) {
				if (isset($this->rules[ $key ])) {
					$newRules[ $key ] = $this->rules[ $key ];
				}
			}
			if ($newRules) {
				return $this->validateData($newRules, $data);
			}
		}

		return true;
	}
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;
    }
845606
private static function separate(array $data)
    {
        $array = [];

        foreach ($data as $provider) {

            if(($bool = self::isDelim($provider)) === false) {
                $array['required'][] = $provider;
            }
            else {
                if ($bool[1] === 'true') {
                    $array['required'][] = strval($bool[0]);
                } else {
                    $array['hidden'][] = strval($bool[0]);
                }
            }
        }

        return $array;

    }
654973
public function computeCoordinatesByArray(array $data)
    {
        $criteria = [
            'street',
            'postal',
            'city',
            'country',
        ];

        $sortedData = [];

        // keep the right order
        foreach ($criteria as $name) {
            if (isset($data[$name])) {
                $sortedData[] = $data[$name];
            }
        }

        return $this->computeCoordinatesByString(implode(' ', $sortedData));
    }
1142595
public function update(array $data)
    {
        $id = (int) empty($data['id']) ? 0 : $data['id'];
        if ($id <= 0) {
            throw new Exception('Required field id');
        }
        $person_id = empty($data['person_id']) ? 0 : (int) $data['person_id'];
        unset($data['id'], $data['person_id']);
        return $this->rest->put('people/' .
           ($person_id ? $person_id . '/' : '') .  "$this->action/$id", $data);
    }
578464
protected function getMemberFromData(array $data)
    {
        if (!empty($data['Email'])) {
            $uniqueIdentifier = Member::config()->get('unique_identifier_field');
            return Member::get()->filter([$uniqueIdentifier => $data['Email']])->first();
        }
    }
93791
public function check(array $data)
    {
        if (!$this->throwExceptions) {
            return;
        }

        $validator = $this->getValidator();

        $res = $validator->validate($data);

        if (!$res && $e = $validator->createValidationException()) {
            throw $e;
        }

    }
204371
protected function applyPermission(array $data)
    {
        if (!($name = ArrayHelper::get($data, 'name'))) {
            return false;
        }
        if ($permission = $this->authManager->getPermission($name)) {
            return $permission;
        }
        $permission = $this->authManager->createPermission($name);
        $permission->description = ArrayHelper::get($data, 'description', '');
        $permission->ruleName    = ArrayHelper::get($data, 'ruleName',    '');
        if ($this->authManager->add($permission)) {
            return $permission;
        }
        return false;
    }
233387
public function import(array $data)
    {
        $this->clearErrors();
        $result = true;

        foreach ($data as $section) {
            if ($this->importItem($section) === false) {
                $result = false;
            }
        }

        return $result;
    }
238970
protected function validate(array &$data)
    {
        $messages = [];
        if (!empty($data['errors']) && !empty($data['activity']) && !empty($data['requests'])) {
            array_push($messages, ['warning', trans('It is recommended to periodically clean system logs.')]);
        }
        $data = array_merge($data, ['messages' => $messages]);
        return $data;
    }
887403
public static function createFromData(array $data)
    {
        if (!isset($data['method'])) {
            throw new DomainException('Method is required');
        }
        switch ($data['method']) {
            case PaymentMethod::METHOD_PAYMENT_CARD:
                $paymentInstrumentValidation = new PaymentCardValidation($data);

                break;
            default:
                throw new DomainException(
                    sprintf('Unexpected method. Only %s methods support', implode(',', self::$supportMethods))
                );
        }

        return $paymentInstrumentValidation;
    }
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)
            );
        }
    }
468428
protected function HLUpdate(array $data)
    {
        $return = [];
        if (empty($data['NAME'])) {
            throw new Exception('You must set NAME');
        }
        if ($id = $this->HLGetIdByCode($data['NAME'])) {
            $arLoad = $data;
            unset($arLoad['LANGS'], $arLoad['RIGHTS'], $arLoad['NAME']);
            if ($arLoad) {
                $result = HighloadBlockTable::update($id, $arLoad);
                if ($result->isSuccess()) {
                    if (!empty($data['LANGS'])) {
                        $this->HLSetLangs($id, $data['LANGS']);
                    }
                    if (!empty($data['RIGHTS'])) {
                        $this->HLSetRights($id, $data['RIGHTS']);
                    }
                    $return[] = "Update {$data['NAME']} ({$id}) highload block";
                } else {
                    throw new Exception("Can't update {$data['NAME']} ({$id}) highload block: " . implode(', ', $result->getErrorMessages()));
                }
            } elseif (!empty($data['RIGHTS'])) {
                $this->HLSetRights($id, $data['RIGHTS']);
            } elseif (!empty($data['LANGS'])) {
                $this->HLSetLangs($id, $data['LANGS']);
            }
        } else {
            throw new Exception("Hl entity with name {$data['NAME']} does not exist");
        }

        return $return;
    }
732382
public function filter(array $data)
    {
        $filteredData = [];

        foreach ($data as $value) {
            if ($this->match($value)) {
                $filteredData[] = $value;
            }
        }

        return $filteredData;
    }
71362
public function getMessageRecord(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_MESSAGE_RECORD_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errcode']) && !$result['errcode'] ? $result['recordlist'] : false;
    }