Check if the csv file is valid

@return bool
431536
public function validateFile(): bool
    {
        return Validator::make(
            ['fileType' => finfo_file(finfo_open(FILEINFO_MIME_TYPE), $this->importer->getFilePath())],
            ['fileType' => 'required|string:text/plain|string:text/csv']
        )->passes();
    }
729815
public function isValid() {
		
		$params = $this -> getParameters();
		$file 	= $this -> getFile();

		if(false === isset($params[0])) {
			return trigger_error(sprintf('Missing argument 1 for %s', __METHOD__), E_USER_ERROR);
		}

		if(false === ('-' . intval($params[0]) == '-' . $params[0])) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($params[0])), E_USER_ERROR);
		}

		if(false === isset($params[1])) {
			return trigger_error(sprintf('Missing argument 2 for %s', __METHOD__), E_USER_ERROR);
		}

		if(false === ('-' . intval($params[1]) == '-' . $params[1])) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($params[1])), E_USER_ERROR);
		}

		$dimensions = @getimagesize($file['tmp_name']);

		if(true === is_array($dimensions)) {

			if($dimensions[0] === $params[0] && $dimensions[1] === $params[1]) {
				return true;
			}
		}

		return false;
	}
1374888
public function isValid()
    {
        /**
         * First, check if the upload is valid or not
         */
        if (!parent::isValid()) {
            return false;
        }

        $value = $this->field->getValue();

        // if here, we know that the field is uploaded.

        // check if it's an image, and get it's size
        $size = @getimagesize($value['tmp_name']);
        if ($size === false) {
            $this->setErrorMessage($this->messages['not_an_image']);
            return false;
        }
        list ($width, $height) = $size;

        /**
         * Validate the aspect ratio.
         */
        if (!$this->validateAspectRatio($width, $height)) {
            return false;
        }


        /**
         * Validate the proportions
         */
        if (!$this->validateSize($width, $height)) {
            return false;
        }

        // if here, everything is ok!
        return true;
    }
84709
public function isValid()
    {
        $localSign = generate_sign($this->getNotify()->except('sign')->all(), $this->merchant->key, 'md5');

        return $localSign === $this->getNotify()->get('sign');
    }
319937
public function valid()
    {

        if ($this->container['typeId'] === null) {
            return false;
        }
        if ($this->container['quantity'] === null) {
            return false;
        }
        if ($this->container['locationId'] === null) {
            return false;
        }
        if ($this->container['locationType'] === null) {
            return false;
        }
        $allowedValues = $this->getLocationTypeAllowableValues();
        if (!in_array($this->container['locationType'], $allowedValues)) {
            return false;
        }
        if ($this->container['itemId'] === null) {
            return false;
        }
        if ($this->container['locationFlag'] === null) {
            return false;
        }
        $allowedValues = $this->getLocationFlagAllowableValues();
        if (!in_array($this->container['locationFlag'], $allowedValues)) {
            return false;
        }
        if ($this->container['isSingleton'] === null) {
            return false;
        }
        return true;
    }
1346268
public function valid()
    {
        if ($this->container['maxDockableShipVolume'] === null) {
            return false;
        }
        if ($this->container['name'] === null) {
            return false;
        }
        if ($this->container['officeRentalCost'] === null) {
            return false;
        }
        if ($this->container['reprocessingEfficiency'] === null) {
            return false;
        }
        if ($this->container['reprocessingStationsTake'] === null) {
            return false;
        }
        if ($this->container['services'] === null) {
            return false;
        }
        if ($this->container['stationId'] === null) {
            return false;
        }
        if ($this->container['systemId'] === null) {
            return false;
        }
        if ($this->container['typeId'] === null) {
            return false;
        }
        return true;
    }
1041038
final protected function validateFile () : bool
	{
		$file = $this->file;
		// Perform error checking on the file parameter parsed in
		if (!$file || empty($file) || !is_array($file)):
			// Error: nothing uploaded or wrong argument usage
			$this->error = "No file was uploaded.";
			return FALSE;
		endif;
		// Check if file is not empty
		if (!isset($file) || !is_uploaded_file($file['tmp_name'])):
			// Error: in file upload
			$this->error = "Uploaded file is Missing.";
			return FALSE;
		endif;
		// Check if file doesn't contain any error
		if ($file['error'] != 0):
			// Error: report what php says went wrong
			$this->error = $this->fileUploadErrors[$file['error']];
			return FALSE;
		endif;
		return TRUE;
	}
1177560
public function isValid(): bool
    {
        $uris = [];
        foreach ($this->members as $member) {
            $uri = $member->uri;
            if ($uri) {
                if (isset($uris[$uri])) {
                    return false;
                } else {
                    $uris[$uri] = true;
                }
            }
        }
        return true;
    }
347982
public function isValid()
    {
        $now = new \DateTime('now', new \DateTimeZone('UTC'));
        $timestamp = clone $this->timestamp;

        return $timestamp->add(new \DateInterval($this->validFor)) >= $now;
    }
531875
protected function _isValidFormat()
	{
		// Read sample data (first 2 KB will do)
		$data = fread($this->_fileHandle, 2048);

		// Count delimiters in file
		$delimiterCount = substr_count($data, ';');
		if ($delimiterCount < 1) {
			return FALSE;
		}

		// Analyze first line looking for ID; signature
		$lines = explode("\n", $data);
		if (substr($lines[0],0,4) != 'ID;P') {
			return FALSE;
		}

		return TRUE;
	}
29178
public function valid(): bool
    {
        if ($this->cacheFilesIterator === null) {
            $this->rewind();
        }
        return $this->cacheFilesIterator->valid();
    }
5477
public function valid() : bool
    {
        if ($this->privateErrors()) {
            return false;
        }
        foreach ((array)$this as $element) {
            if (is_string($element)) {
                continue;
            }
            if (!$element->getElement()->valid()) {
                return false;
            }
        }
        return true;
    }
56420
protected function _isValidFormat()
	{
		//	Reading 2048 bytes should be enough to validate that the format is HTML
		$data = fread($this->_fileHandle, 2048);
		if ((strpos($data, '<') !== FALSE) &&
			(strlen($data) !== strlen(strip_tags($data)))) {
			return TRUE;
		}

		return FALSE;
	}
297150
public function valid()
    {
        if ($this->flags & SplFileObject::READ_AHEAD) {
            return $this->current() !== false;
        }

        return !feof($this->stream);
    }
162782
public function isValid()
    {
        // these schemes are allowed
        $allowedSchemes = $this->getAllowedSchemes();

        // get the field value
        $url = $this->field->getValue();


        // not required and empty? Then its valid
        if ($this->isNotRequiredAndEmpty($url)) {
            return true;
        }

        if ($this->getMaxLength() && strlen($url) > $this->getMaxLength()) {
            // Over maximum length.
            return false;
        }

        // do simple validation
        if (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_SCHEME_REQUIRED)) {
            return false;
        }

        // check if we have a tld
        if (!$this->isSkipTldCheck() && !preg_match('#\.[a-z]{2,}$#', parse_url($url, PHP_URL_HOST))) {
            return false;
        }

        // further validation is required.
        if (in_array(parse_url($url, PHP_URL_SCHEME), $allowedSchemes)) {
            return true;
        }

        return false;
    }
1342823
public function preValidate(): bool
    {
        $this->errors = [];

        if (!\is_array($this->parsedfile)) {
            $this->errors[] = 'Incorrect format parsed file';

            return false;
        }

        $r = $this->readUNHmessageNumber();
        if (!$r && isset($this->errors[0]) && $this->errors[0] == 'Segment "UNH" is ambiguous') {
            $this->errors = [];
            $this->errors[] = 'File has multiple messages';

            return false;
        }

        return true;
    }
6290
public function isValid()
    {
        $row = $this->getActulRow();
        return ($row[$this->column] > $this->value) ? true : false;
    }