Override data

@param array $specs
@return $this
182180
public function override(array $specs)
    {
        unset($specs['param'], $specs['return'], $specs['throws']);
        foreach($specs as $key => $value) {
            $this->$key = $value;
        }

        return $this;
    }
682726
public function heredocRealOverride($matches)
    {
        $this->record($matches[0], null);
        $this->posShift(strlen($matches[0]));
        // don't need this anymore
        $this->removePattern('HEREDOC_NL');
        assert($this->heredoc !== null);
        $delim = preg_quote($this->heredoc);
        $substr = $this->scanUntil('/^' . $delim . '\\b/m');
        if ($substr !== null) {
            $this->record($substr, 'HEREDOC');
            $delim_ = $this->scan('/' . $delim . '/');
            assert($delim !== null);
            $this->record($delim_, 'DELIMITER');
        } else {
            $this->record($this->rest(), 'HEREDOC');
            $this->terminate();
        }
    }
906736
public static function spec(
        $constraints,
        $defaults = [],
        $required = [],
        $messages = []
    ) {
        return new static(
            Spec::define($constraints, $defaults, $required),
            $messages
        );
    }
19989
final public function reset(array $modified = array())
    {
        $context = $this->getContext();
        $context->modified = $modified;

        if ($this->invokeCommand('before.reset', $context) !== false)
        {
            $this->_actionReset($context);
            $this->invokeCommand('after.reset', $context);
        }

        return $this;
    }
1076551
public function setChanges($changes)
    {
        if ($changes instanceof Records) {
            $this->changes = $changes;
        } else {
            if (is_array($changes)) {
                $changes       = new Records($changes);
                $this->changes = $changes;
            }
        }
        return $this;
    }
886171
public function setRequiredTypes(array $types)
    {
        $this->required = array_merge($this->required, $types);
        $this->requiredTypes = $types;

        return $this;
    }
52583
public function set(array $rules)
    {
        $this->items = array_merge(
            $this->items,
            $this->parseRules($rules)
        );

        return $this;
    }
1050037
public static function fromRuleSet(RuleSet $ruleSet, array $overrideRules = [])
    {
        if (\PHP_VERSION_ID < $ruleSet->targetPhpVersion()) {
            throw new \RuntimeException(\sprintf(
                'Current PHP version "%s is less than targeted PHP version "%s".',
                \PHP_VERSION_ID,
                $ruleSet->targetPhpVersion()
            ));
        }

        $config = new Config($ruleSet->name());

        $config->setRiskyAllowed(true);
        $config->setRules(\array_merge(
            $ruleSet->rules(),
            $overrideRules
        ));

        return $config;
    }
113389
public function setQuery($spec, $value = null) {
        if ((null === $value) && ! is_array($spec)) {
            #require_once 'Zend/Controller/Exception.php';
            throw new Zend_Controller_Exception('Invalid value passed to setQuery(); must be either array of values or key/value pair');
        }
        if ((null === $value) && is_array($spec)) {
            foreach ($spec as $key => $value) {
                $this->setQuery($key, $value);
            }
            return $this;
        }
        $this->GET[(string) $spec] = $value;
        return $this;
    }
848934
public function create(array $spec = [])
    {
        $this->ensureRequiredAttributes($spec);

        $type = $spec['attributes']['type'];
        $name = $spec['attributes']['name'];

        $element = $this->buildElement($type, $name);

        if ($element instanceof ChoiceElementInterface) {
            $element = $this->configureChoiceElement($element, $spec);
        }

        if ($element instanceof LabelAwareInterface) {
            $element = $this->configureLabel($element, $spec);
        }

        if ($element instanceof ErrorAwareInterface) {
            $element = $this->configureErrors($element, $spec);
        }

        if ($element instanceof CollectionElementInterface) {
            $element = $this->configureEollection($element, $spec);
        }

        if ($element instanceof DescriptionAwareInterface) {
            $element = $this->configureDescription($element, $spec);
        }

        $element = $this->configureElement($element, $spec);

        return $element;
    }
769308
public function overwriteWith($data)
    {
        if (is_array($data)) {
            $this->data = $data + $this->data;
        } elseif ($data instanceof Collection) {
            $this->data = $data->toArray() + $this->data;
        } else {
            foreach ($data as $key => $value) {
                $this->data[$key] = $value;
            }
        }

        return $this;
    }
996036
public function setRules(array $rules)
    {
        foreach ($rules as $key => $values) {

            if ((is_array($values) === true && empty($values) === false) || is_callable($values)) {
                $this->rules[$key] = $values;
            } else {
                $this->rules[$key] = trim($values);
            }
        }

        return $this;
    }
1348757
private function setRuleIndexes(array $ruleIndexes): self
    {
        assert($this->debugCheckIndexesExist($ruleIndexes));

        $this->ruleIndexes     = $ruleIndexes;
        $this->ruleMainIndexes = $this->getSerializer()::readRuleMainIndexes($ruleIndexes);

        return $this;
    }
403125
public function scope(...$scopes): self
    {
        $this->scopes = \array_merge($this->scopes, $scopes);

        return $this;
    }
957118
public static function invalidClass($spec)
    {
        if (is_object($spec)) {
            $spec = get_class($spec);
        }

        return new static(sprintf(
            'Configuration class `%s` must implement `%s`',
            $spec,
            ConfigurationInterface::class
        ));
    }
21873
protected function update_last_message( $overrides = [] ) {
		if ( $this->messages->isNotEmpty() ) {
			$this->messages->last()->update( $overrides );
		}

		return $this;
	}
1338973
public function init(array $spec)
    {
        $dl = QRspec::rsDataCodes1($spec);
        $el = QRspec::rsEccCodes1($spec);
        $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);


        $blockNo = 0;
        $dataPos = 0;
        $eccPos = 0;
        for($i=0; $i<QRspec::rsBlockNum1($spec); $i++) {
            $ecc = array_slice($this->ecccode,$eccPos);
            $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el,  $ecc, $rs);
            $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc);

            $dataPos += $dl;
            $eccPos += $el;
            $blockNo++;
        }

        if(QRspec::rsBlockNum2($spec) == 0)
            return 0;

        $dl = QRspec::rsDataCodes2($spec);
        $el = QRspec::rsEccCodes2($spec);
        $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);

        if($rs == NULL) return -1;

        for($i=0; $i<QRspec::rsBlockNum2($spec); $i++) {
            $ecc = array_slice($this->ecccode,$eccPos);
            $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs);
            $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc);

            $dataPos += $dl;
            $eccPos += $el;
            $blockNo++;
        }

        return 0;
    }