@param string $mode

@throws \InvalidArgumentException

@return \Ajgl\Csv\Io\IoAbstract
340239
protected function setMode($mode)
    {
        $mode = substr((string) $mode, 0, 2);
        if (!in_array($mode, $this->validModes, true)) {
            throw new \InvalidArgumentException("The given mode '$mode' is not valid for the requested operation");
        }
        $this->mode = $mode;

        return $this;
    }
1140045
public function getGitHashRetrieverCommand($mode = null)
    {
        $mode = is_null($mode) ? $this->config->get('build.mode') : $mode;

        return $this->config->get('git.'.$mode);
    }
356781
public function open($file, $mode)
    {
        if (!empty(trim($file)) && !empty(trim($mode))) {
            $this->resource = fopen($file, $this->modes[$mode]);
            $this->file = $file;

            return $this;
        }

        return false;
    }
702322
public function open($mode = 'a') {
        if (is_resource($this->stream)) {
            return $this;
        }
        $this->stream = fopen($this->file->getFullName(), $mode);
        return $this;
    }
587404
public static function convert($content, $mode = ParserAbstract::MODE_STRICT)
    {
        $parser = new self($mode);

        return $parser->parse($content);
    }
726977
final public function map($data, $mode)
    {
        if (null === $data) {
            return $data;
        }

        return $this->doMap($data, $mode);
    }
189484
public function inMode( $mode )
	{
		if ( !is_array($mode) )
		{
			$mode = func_get_args();
		}

		return in_array( $this->reset_mode, $mode );
	}
947193
private function openFile($file, $mode)
    {
        $handle = @fopen($file, $mode);
        if ($handle === false) {
            throw new \InvalidArgumentException("Could not open $file");
        }
        return $handle;
    }
934384
protected function getStream($path, $mode)
    {
        switch ($mode[0]) {
            case 'r':
                $this->needsCowCheck = true;

                return $this->getFilesystem()->readStream($path);

            case 'w':
                $this->needsFlush = true;

                return fopen('php://temp', 'w+b');

            case 'a':
                return $this->getAppendStream($path);

            case 'x':
                return $this->getXStream($path);

            case 'c':
                return $this->getWritableStream($path);
        }

        return false;
    }
1046788
public static function load($mode)
    {
		if (!is_string($mode)){
			throw new InvalidArgumentException('Try to load an irregular mode in the context. The mode must be a string, ' . gettype($mode) . ' given.');
		}
    	else if (empty($mode)){
    		throw new InvalidArgumentException('Cannot load an empty mode in the context.');
    	}
    	
    	if(!in_array($mode, self::$current)){
    		self::$current[] = $mode;
    	}
    }
844818
public function withSSL(int $mode = self::SSL_AUTO): self
    {
        $this->ssl = $mode;

        return $this;
    }
853585
public function getFormatter(FormatInterface $format)
    {
        switch ($format->getType()) {
            case 'csv':
                if ($format instanceof CsvFormatInterface) {
                    return new CsvFormatter($format);
                } else {
                    throw new InvalidArgumentException(
                        "Format indicates it is csv but does not implement CsvFormatInterface"
                    );
                }

            // fallthrough
            case 'json':
                if ($format instanceof JsonFormatInterface) {
                    return new JsonFormatter($format);
                } else {
                    throw new InvalidArgumentexception(
                        "Format indicates it is json but does not implement JsonFormatInterface"
                    );
                }

            // fallthrough
            default:
                throw new InvalidArgumentException("Supplied format: {$format->getType()} is unknown");
        }
    }
786517
public function mrecv($mode = 0)
    {
        if ($this->verbose) {
            $this->getLogger()->debug('PRE RECV: '.$this->id);
        }
        $data = array();
        while (true) {
            $data[] = $this->recv($mode);
            if (!$this->getSockOpt(ZMQ::SOCKOPT_RCVMORE)) {
                break;
            }
        }

        $message = new Message($data);
        if ($this->verbose) {
            $this->getLogger()->debug('RECV: '.$this->id);
            $this->getLogger()->debug($message);
        }

        if (ZMQ::SOCKET_ROUTER === $this->getSocketType()) {
            $message->stripRoutingInformation();
        }

        return $message;
    }
472719
public function setMode($mode = 'and')
    {
        $mode = in_array($mode, ['and', 'or']) ? $mode : 'and';

        $this->mode = $mode;

        return $this;
    }
917538
public function setUnserializeMode($unserializeMode)
    {
        switch ($unserializeMode) {
            case self::STRICT_MODE:
            case self::MEDIUM_STRICT_MODE:
            case self::NON_STRICT_MODE:
                $this->unserializeMode = $unserializeMode;
                break;
            default:
                throw new InvalidArgumentException(sprintf('Non acceptable unserialize mode: "%s"', $unserializeMode));
        }

        return $this;
    }
716480
public function mode($mode = null)
    {
        if (func_num_args() === 0) {
            return $this->_mode;
        }
        $this->_mode = $mode;
        return $this;
    }
397031
protected function with($with = null, $mode = self::MODE_OR)
    {
        if ($with instanceof GenericCollection) {
            $with = $with->toArray();
        }

        if (is_array($with)) {
            return $this->andWith((array) $with, $mode);
        }

        return $with;
    }