Set a new decoder instance
@param string $name Decoder unique name
@param string $decoder Decoder class name with namespace
@throws \OtherCode\Rest\Exceptions\ModuleNotFoundException
@return $this
337110
public function setDecoder($name, $decoder = null)
    {
        if (!isset($decoder)) {
            $decoder = '\OtherCode\Rest\Modules\Decoders\\' . strtoupper($name) . 'Decoder';
        }

        if (class_exists($decoder, true)) {
            $this->registerModule($name, new $decoder($this->response), 'after');
        } else {
            throw new \OtherCode\Rest\Exceptions\ModuleNotFoundException('Decoder ' . $name . ' not found!');
        }
        return $this;
    }
1082395
public function setName($name) {
    if (($pos = mb_strrpos($name,'.')) !== FALSE) {
      $this->name = mb_substr($name, 0, $pos);
      $this->extension = mb_substr($name, $pos+1);
    } else {
      $this->name = $name;
    }
    
    return $this;
  }
633782
public function extend(string $name, callable $resolver)
    {
        if ($resolver instanceof Closure) {
            $this->extensions[$name] = $resolver->bindTo($this, $this);
        } else {
            $this->extensions[$name] = $resolver;
        }
    }
1004596
public function setCode( $name )
	{
		if ( $name == $this->getCode() ) { return; }

		$this->_values['code'] = (string) $name;
		$this->_modified = true;
	}
503013
public function setOption($name, $value)
    {
        if (!is_null($this->new)) {
            //====================================================================//
            // Impact Block Data Array
            $this->new->option[$name] = $value;
        }

        return $this;
    }
364412
public function setError($name, $error)
    {
        if (!$this->getInputFilter() instanceof ErrorMessageInterface) {
            throw new NotSupportedException(sprintf(
                'Method %s::%s() is not supported.',
                get_class($this->getInputFilter()),
                __FUNCTION__
            ));
        }
        $this->getInputFilter()->setMessage($name, $error);
        return $this;
    }
537203
public function addMiddleware($name)
    {
        //Support middleware in comoponents
        //pattern => App\Components\Example\Middleware\@Example;
        $parts = explode('@', $name);
        if (strcasecmp($parts[0], $name) === 0) {
            //If namespace not givent then continue to defaukt
            $namespace = "App\Middleware\\";
            $middleware = $namespace.$name;
        } else {
            //If given then continue to provided namespace
            $namespace = $parts[0];
            $middleware = $namespace.$parts[1];
        }
        $middleware_object = new $middleware();
        if (class_exists($middleware)) {
            if (method_exists($middleware_object, 'before') && method_exists($middleware_object, 'after')) {
                return $middleware;
            } else {
                throw new \Exception('Middleware methods before and after not exists', 500);
            }
        } else {
            throw new \Exception("Middleware Class {$middleware} not found", 500);
        }
    }
896623
function Decoder (opts) {
  if (!(this instanceof Decoder)) {
    return new Decoder(opts);
  }
  Transform.call(this, opts);
  var ret;

  ret = binding.mpg123_new(opts ? opts.decoder : null);
  if (Buffer.isBuffer(ret)) {
    this.mh = ret;
  } else {
    throw new Error('mpg123_new() failed: ' + ret);
  }

  ret = binding.mpg123_open_feed(this.mh);
  if (MPG123_OK != ret) {
    throw new Error('mpg123_open_feed() failed: ' + ret);
  }
  debug('created new Decoder instance');
}
734303
public T decoder(Decoder d) {
        if (!decoders.contains(d)) {
            decoders.add(d);
        }
        return derived.cast(this);
    }
875690
public function set(string $name, string $value)
    {
        $this->values[$name] = $value;
        return $this;
    }
100774
public function setParam($name, $value)
	{
		if (null === $this->params)
		{
			$this->params = $this->loadParams();
		}

		$this->params->set($name, $value);

		return $this;
	}
1018682
public function using(string $name): self
    {
        if (!isset($this->providers[$name])) {
            throw ProviderNotRegistered::create($name ?? '', $this->providers);
        }

        $this->provider = $this->providers[$name];

        return $this;
    }
609301
private function CreateNamespace(&$name)
    {
        if($name == "")
            $name = "\\";

        if(!isset($this->namespaces[$name]))
            $this->namespaces[$name] = new NamespaceElement($name);
    }
224665
public function addMatcher($name, $matcher)
    {
        if (is_callable($matcher)) {
            $this->matchers[$name] = $matcher;
        }

        return $this;
    }
1103907
public function createValidator(string $name): ValidatorInterface
    {
        if (isset($this->validators[$name])) {
            return $this->validators[$name];
        }

        if (($validator = $this->getValidatorDefine($name)) !== false) {
            if (Assert::string($validator)) {
                if (Assert::namespace($validator)) {
                    $namespace = $validator;
                } else {
                    $namespace = '\\One\\Validation\\Validators\\' . $validator;
                }

                $this->validators[$name] = Reflection::newInstance(
                    $namespace,
                    [ $this ]
                );

                unset($namespace);
            } elseif (Assert::array($validator)) {
                $this->validators[$name] = CustomValidator::createFromArray($this, $validator);
            } else {
                $this->validators[$name] = CustomValidator::createFromClosure($this, $validator);
            }

            return $this->validators[$name];
        }

        throw new ValidationException(sprintf('Validator "%s" not found', $name));
    }
664977
public function addDecoder(DecoderInterface $decoder)
    {
        $mimeTypes = $decoder->getMimeType();
        if ($this->isSupportedMimeType($mimeTypes[0])) {
            return; // we already have the decoder loaded!
        }
        $this->supportedMimeTypes = array_merge($this->supportedMimeTypes, $mimeTypes);
        foreach ($mimeTypes as $type) {
            $this->decoders[$type] = $decoder;
        }
    }
843874
public function set($name, $value): self
    {
        if (!\is_array($value)) {
            $value = ['value' => (string)$value];
        }

        parent::set($name, \array_replace($this->defaults, $value));

        return $this;
    }