Set instructions.

@param [[@doctodo param_type:instructions]] $instructions [[@doctodo param_description:instructions]]

@throws Exception [[@doctodo exception_description:Exception]]
333898
public function setInstructions($instructions)
    {
        if (!is_null($this->_instructions)) {
            throw new Exception('Instructions for browser responses can only be set once.');
        }
        $this->_instructions = array_merge($this->_baseInstructions, $instructions);
        if (isset($this->_instructions['id'])) {
            $this->_id = $this->_instructions['id'];
        }
        if (isset($this->_instructions['offset'])) {
            $this->_offset = $this->_instructions['offset'];
        }
        if (isset($this->_instructions['filterQuery'])) {
            $this->filterQuery = $this->_instructions['filterQuery'];
        }

        unset($this->_instructions['id'], $this->_instructions['offset'], $this->_instructions['filterQuery']);
    }
1319515
public Element simulate(final List<Instruction> instructions) {
        lock.lock();
        try {
            returnElement = null;
            return simulateInternal(instructions);
        } finally {
            lock.unlock();
        }
    }
704361
public function setPrecomputeDelta($delta)
    {
        if (!is_int($delta) || $delta < 1 || $delta > 100) {
            throw new Exception('Invalid delta specified. An integer between 1 and 100 is required.');
        }

        $this->precomputeDelta = $delta;
    }
112065
protected function setMethods($methods): void
    {
        if (\is_string($methods)) {
            $methods = [$methods];
        } elseif (!\is_array($methods)) {
            throw new RouterException('Method invalid');
        }

        foreach ($methods as $method) {
            if (!\in_array($method, Request::$methods, true)) {
                throw new RouterException('Method invalid: ' . $method);
            }
        }

        $this->methods = $methods;
    }
1287250
public function setPrefix($prefix)
    {
        switch ($prefix) {
            case 'a': //Access
            case 'c': //Company
            case 'u': //User
            case 'g': //License Groups
            case 'admin':
            case 'status':
            case 'login-logout':
                $this->prefix = '/'.$prefix.'/';
                break;
            case null:
            case '':
            case '/':
                $this->prefix = '';
                break;
            default:
                throw new \Exception(sprintf('Unknown prefix %s', $prefix));
        }
    }
995039
public function setTable($table = '') : void
    {
        if ('' === $table) {
            $table = 'dummy';
        }

        if (is_string($table)) {
            $table = TableRegistry::get($table);
        }

        Assert::isInstanceOf($table, Table::class);

        $this->table = $table;
    }
88902
public function setErrors($errors)
    {
        if (!is_string($errors)) {
            $errors = json_encode($errors);
        }

        $this->errors = $errors;
    }
910927
public function setException(\Exception $exception = null)
    {
        $this->exception = $exception;
        $this->result = self::FAILED;
    }
1150202
public static function setInstance($registry)
    {
        if (self::$_registry !== null) {
            throw new Exception('Registry is already initialized');
        }

        self::setClassName(get_class($registry));
        self::$_registry = $registry;
    }
271374
public function set_campus($campus) {
        $campus = !is_array($campus) ? array($campus) : $campus;

        $this->_campus = array();
        foreach ($campus as $c) {
            $c = strtolower($c);
            if (!in_array($c, array('canterbury', 'medway'))) {
                throw new \Exception("Invalid campus: '{$campus}'.");
            }

            $this->_campus[] = $c;
        }
    }
847253
public function setArray($key, $value)
    {
        if (!$key)
        {
            throw new Exception('key may not be null.');
        }
        if (!is_array($value))
        {
            throw new Exception('Must use set() for non-array values.');
        }
        $this->_performOperation($key, new SetOperation($value));
    }
100769
public function setExtensions( $extensions = array() )
	{
		if( !is_array( $extensions ) )
			throw new InvalidArgumentException( 'Extensions must be given as Array.' );

		$pattern	= "";
		if( count( $extensions ) )
		{
			$extensions	= implode( "|", array_values( $extensions ) );
			$pattern	= '@\.'.$extensions.'$@i';
		}
		$this->pattern	= $pattern;
	}
1196315
public function setCommands(array $commands)
    {
        $names = [];
        foreach ($commands as $command) {
            $names = \array_merge([$command->getName()], $names);
            $names = \array_merge($command->getAliases(), $names);
        }
        $this->commands = $names;
    }
939563
private void printInstruction(String instruction) {
        System.out.println(StringUtils.repeat("-", instruction.length()));
        System.out.println(instruction);
        System.out.println(StringUtils.repeat("-", instruction.length()));
    }
756295
protected function set_algorithm(string $algorithm):void{
		$algorithm = strtoupper($algorithm);

		if(!in_array($algorithm, ['SHA1', 'SHA256', 'SHA512'], true)){
			throw new AuthenticatorException('Invalid algorithm: '.$algorithm);
		}

		$this->algorithm = $algorithm;
	}
1164745
public function set_installer_instance(tool_installaddon_installer $installer) {
        if (is_null($this->installer)) {
            $this->installer = $installer;
        } else {
            throw new coding_exception('Attempting to reset the installer instance.');
        }
    }
322433
public function setCode( $code )
	{
		$this->_checkCode( $code );

		$this->_values['code'] = (string) $code;
		$this->setModified();
	}