Checks if provided column data is valid
Returns bool if it's valid
Returns string it it's not valid

@param array $data
@return bool|string
778433
private function _validateColumn(array $data)
    {
        if (!isset($data['label'])) {
            return 'Label key is required.';
        }
        if (!isset($data['index'])) {
            return 'Index key is required.';
        }

        if (isset($data['renderer']) && (!$data['renderer'] instanceof \Closure && !is_string($data['renderer']))) {
            return 'Renderer must be a string or instance of Closure object.';
        }

        if (isset($data['filter']) && !$data['filter'] instanceof \Closure) {
            return 'Filter function must be instance of Closure object.';
        }

        return true;
    }
1326518
protected function isValidConditionData($data)
    {
        if (!array_key_exists('field', $data)) {
            throw new MissingConditionAttributeException('field');
        }
        if (!array_key_exists('operator', $data)) {
            throw new MissingConditionAttributeException('operator');
        }
        if (!array_key_exists('type', $data)) {
            throw new MissingConditionAttributeException('type');
        }
        if (!array_key_exists('value', $data)) {
            throw new MissingConditionAttributeException('value');
        }

        return true;
    }
24494
public function isValid($data) {
        if (!is_array($data)) {
            throw new Zend_Form_Exception(__METHOD__ . ' expects an array');
        }

        $this->_incrementArray($data);
        return parent::isValid($data);
    }
1020648
public function validate(array $data)
    {
        $validator = $this->getValidator();
        if (!$validator->count()) {
            //@codingStandardsIgnoreStart
            $validator = @$this->validator();
        }
        $this->_errors = $validator->errors($data);

        return count($this->_errors) === 0;
    }
624335
public function php($data)
    {
        // Obtain Result (from parent):
        
        $valid = parent::php($data);
        
        // Obtain URL Field:
        
        if ($field = $this->form->Fields()->dataFieldByName($this->urlField)) {
            
            // Detect Value:
            
            if (!$field->Value()) {
                return $valid;
            }
            
            // Attempt Adapter Creation:
            
            try {
                
                $adapter = Embed::create($field->Value());
                
                $valid = true;
                
            } catch (EmbedException $e) {
                
                $this->validationError($this->urlField, $e->getMessage(), ValidationResult::TYPE_ERROR);
                
                $valid = false;
                
            }
            
        } else {
            
            // Cannot Find URL Field:
            
            throw new ValidationException(
                sprintf(
                    _t(__CLASS__ . '.CANNOTFINDURLFIELD', 'Cannot find a field to validate with name "%s"'),
                    $this->urlField
                )
            );
            
        }
        
        // Answer Result:
        
        return $valid;
    }
1329055
private function isSelectColumn($data)
    {
        if (null !== $data && !in_array($data, $this->virtualColumns)) {
            return true;
        }

        return false;
    }
1186004
protected function validate($data)
    {
        $data = $this->validateSegment($data);
        if (! $data) {
            return $data;
        }

        $this->saveInternalEncoding();
        if (! $this->isValidHostLength($data)) {
            $this->restoreInternalEncoding();
            throw new RuntimeException('Invalid hostname, check its length');
        }

        if (! $this->isValidHostPattern($data)) {
            $this->restoreInternalEncoding();
            throw new RuntimeException('Invalid host label, check its content');
        }

        if (! $this->isValidHostLabels($data)) {
            $this->restoreInternalEncoding();
            throw new RuntimeException('Invalid host label counts, check its count');
        }

        $data = $this->sanitizeValue($data);
        $data = explode(
            $this->delimiter,
            $this->punycode->decode(implode($this->delimiter, $data))
        );
        $this->restoreInternalEncoding();

        return $data;
    }
134548
public static function is_valid(array $data, array $validators) {
        $gump = self::get_instance();

        $gump->validation_rules($validators);

        if ($gump->run($data) === false) {
            return $gump->get_errors_array(false);
        } else {
            return true;
        }
    }
54655
protected function parseArrayOfPrimaryData(array $data)
    {
        $isValid = true;
        $result  = null;
        foreach ($data as $primaryData) {
            $parsed = $this->parseSinglePrimaryData($primaryData);
            if ($parsed === null) {
                $isValid = false;
            } else {
                $result[] = $parsed;
            }
        }

        return $isValid === true ? $result : null;
    }
253720
protected function isDataValid($data)
    {
        $this->parser->dataExpire = $this->dataExpire;

        return parent::isDataValid($data);
    }
216935
public static function validate($data)
    {
        if (count(array_intersect_key(array_flip(static::$requiredParams), $data)) === count(static::$requiredParams)) {
            return true;
        }

        throw new InvalidArgumentException();
    }
942780
protected function jsonValidator($data = null):bool
    {
        if (! empty($data)) {
            @json_decode($data);

            return json_last_error() === JSON_ERROR_NONE;
        }

        return false;
    }
1332212
public static function isSerialized($data) {
        if (!is_string($data) || empty($data)) {
            return false;
        }

        return (@unserialize($data) !== false);
    }
648857
public function getIsAllKeysValid(array $data)
    {
        $keys = array_keys($data);
        foreach($keys as $key)
        {
            if(!$this->getIsValidKey($key))
            {
                return false;
            }
        }
        return true;
    }
290206
protected function validateCommand(array &$data)
    {
        if (empty($data['command'])) {
            throw new InvalidArgumentException("'command' property is required");
        }

        if (empty($data['command_arguments'])) {
            $data['command_arguments'] = [];
        }

        if (empty($data['command_environment_variables'])) {
            $data['command_environment_variables'] = [];
        }

        if (empty($data['in_background'])) {
            $data['in_background'] = false;
        }

        if ($data['in_background'] && DIRECTORY_SEPARATOR == '\\') {
            throw new LogicException('Background jobs are not supported on Windows');
        }

        if (empty($data['log_output_to_file'])) {
            $data['log_output_to_file'] = '';
        }
    }
178697
protected static function validateSortByOrder(string $data): string
    {
        $options = array_keys(Options::getSortByOrders());
        if (!in_array($data, $options)) {
            $data = Options::DEFAULT_SORT_BY_ORDER;
        }

        return $data;
    }
1176143
public function validate(array $data)
    {
        try {
            $messages = $this->validateArray($data, $this->nested);

        } catch (\RuntimeException $e) {
            throw (new ValidationException($e->getMessage(), $e->getCode(), $e))->setMessages();
        }

        if (!empty($messages)) {
            throw (new ValidationException())->setMessages($messages);
        }
    }