Sets a configurator to call after the service is fully initialized.

@param string|array $configurator A PHP callable

@return $this
518346
public function setConfigurator($configurator)
    {
        $this->changes['configurator'] = true;

        if (is_string($configurator) && false !== strpos($configurator, '::')) {
            $configurator = explode('::', $configurator, 2);
        }

        $this->configurator = $configurator;

        return $this;
    }
868465
public function addConfigurationSetting($name, $value)
    {
        $this->checkConnectionUp("Cannot set configuration once a connection is made with the server.")
            ->configurator->set($name, $value);

        return $this;
    }
197278
public function setWrapperFormat(string $wrapper): self
    {
        $this->compilerOptions['wrapper'] = $wrapper;
        $this->schemaCompilerOptions['wrapper'] = $wrapper;
        return $this;
    }
1092642
public function addValidator(Validator $validator) : ValidationCheckerInterface
    {
        $this->validated = false;
        $validator->setValidationSet($this);
        array_push($this->validators, $validator);
        return $this;
    }
480288
public function constructUsing($objectCreator)
	{
		if ($objectCreator instanceof \Closure) {
			$objectCreator = new ClosureObjectCreator($objectCreator);
		}
		if (!$objectCreator instanceof ObjectCreatorInterface) {
			throw new PapperConfigurationException('Argument objectCreator must be closure or instance of Papper\ObjectCreatorInterface');
		}
		$this->typeMap->setObjectCreator($objectCreator);
	}
282169
public function setConfigurators(array $configurators): self
    {
        foreach ($configurators as $configurator) {
            $isValid = $this->checkPublicStaticCallable($configurator, [LimoncelloContainerInterface::class]);
            if ($isValid === false) {
                throw new LogicException($this->getCallableToCacheMessage());
            }
        }

        $this->configurators = $configurators;

        return $this;
    }
47724
public static function initialize($configuration = NULL)
	{
		if($configuration) {
			self::setConfiguration($configuration);
		}

		if(!self::$configuration instanceof Configuration) {
			throw new InvalidConfigurationException("Consumerr is not properly configured.");
		}
		if(self::$enabled) {
			self::log("Multiple calls to initialize - ignore");
			return FALSE;
		}

		if (self::$configuration->isClientDisabled()) {
			self::log('Client IP is disabled by current configuration.');

			return FALSE; //nothing to do here
		}
		if (self::$configuration->isCliDisabled()) {
			self::log('CLI is disabled by current configuration.');

			return FALSE; //nothing to do here
		}
		self::$enabled = TRUE;
		self::getTime();

		$errorPage = self::$configuration->getErrorPage();
		if ($errorPage !== false) {
			ErrorHandler::register($errorPage);
		}

		if (!self::isConsole()) {
			if (self::$configuration->isAsyncEnabled()) {
				ob_start();
			}

			self::getAccess()->setUrl(
				(isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'off') ? 'https://' : 'http://')
				. (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''))
				. $_SERVER['REQUEST_URI']
			);

			if (isset($_SERVER['SERVER_NAME'])) {
				self::getAccess()->setServerName($_SERVER['SERVER_NAME']);
			}

			if (isset($_SERVER['REMOTE_ADDR'])) {
				self::getAccess()->setRemoteAddr($_SERVER['REMOTE_ADDR']);
			}

			if (isset($_SERVER['SCRIPT_NAME'])) {
				self::getAccess()->setName($_SERVER['SCRIPT_NAME']);
			}

			if (isset($_SERVER['REQUEST_METHOD'])) {
				self::getAccess()->setMethod($_SERVER['REQUEST_METHOD']);
			}
			
			if (function_exists('getallheaders')) {
				self::getAccess()->setHeaders(getallheaders());
			}


			if (isset($_SERVER['HTTP_USER_AGENT'])) {
				self::getAccess()->setUserAgent($_SERVER['HTTP_USER_AGENT']);
			}
		} else {
			self::getAccess()->setName(self::getCliArguments());
			self::getAccess()->setBackgroundJob(TRUE);
		}

		self::registerSenderShutdownHandler();

		return TRUE;
	}
239830
public function setConfig($key, $value)
    {
        if (! is_object($value) || ! $value instanceof ConfigurableService) {
            $value = new ConfigurationService(array(ConfigurationService::OPTION_CONFIG => $value));
        }
        $value->setHeader($this->getConfigHeader($key));
        $this->registerService($this->getId().'/'.$key, $value);
        return true;
    }
667365
public function setOption(string $name, $value): Configurator
    {
        $this->validateName($name);
        $this->config[$name] = $value;

        return $this;
    }
573535
public function setSubscriber($subscriber)
    {
        $this->_subscriber = $subscriber;

        if ($subscriber->persisted()) {
            $this->actorId = $this->_subscriber->id;
        } else {
            $this->set('actorId', PHP_INT_MAX);
        }

        $this->getRepository()->getSpace()->setSaveOrder($this, $this->_subscriber);

        return $this;
    }
455637
static public void addConfigurator(ClientConfigurator<?> configurator) {
    if (!HttpClientConfigurator.class.isInstance(configurator) && !OkHttpClientConfigurator.class.isInstance(configurator)) {
      throw new IllegalArgumentException(
        "Configurator must implement OkHttpClientConfigurator"
      );
    }

    clientConfigurator = configurator;
  }
1202215
public static function setLoader($loader) {
    if (!$loader) {
      self::$_loader = NULL;
      return;
    }
    if ($loader instanceof FluentDOM\Loadable) {
      self::$_loader = $loader;
      return;
    }
    throw new FluentDOM\Exceptions\InvalidArgument(
      'loader', [Loadable::class]
    );
  }
148080
function setInitializers($options)
    {
        foreach ($options as $key => $v) {
            if (!(is_array($v) || $v instanceof iContainerInitializer))
                $v = array($key => $v);

            $this->addInitializer($v);
        }

        return $this;
    }
43913
public static function configurator()
    {
        //====================================================================//
        // Configuration Array Already Exists
        //====================================================================//
        if (isset(self::core()->configurator)) {
            return self::core()->configurator;
        }

        //====================================================================//
        // Load Configurator Class Name from Configuration
        $className = self::configuration()->Configurator;
        //====================================================================//
        // No Configurator Defined
        if (!is_string($className) || empty($className)) {
            return new NullConfigurator();
        }
        //====================================================================//
        // Validate Configurator Class Name
        if (false == self::validate()->isValidConfigurator($className)) {
            return new NullConfigurator();
        }

        //====================================================================//
        // Initialize Configurator
        self::core()->configurator = new $className();

        return self::core()->configurator;
    }
104671
public function setValidationRules(Validator $validator, array $options = []) : Validator
    {
        $options = array_merge($this->defaultOptions, $this->fixOptions($options));

        $provider = $this->config->getProvider('validationRules');
        $validator = (new $provider($this->config))->provide($validator, $options);
        if (! $validator instanceof Validator) {
            throw new RuntimeException(
                sprintf('Provider returned value must be an instance of %s.', Validator::class)
            );
        }

        return $validator;
    }
818723
public static function createFromClosure(Validator $validator, callable $callback): self
    {
        $self = new static($validator);

        $self->setCallback(function (array $attributes, string $name, array $parameters) use ($callback) {
            return $callback($attributes, $name, $parameters);
        });

        return $self;
    }
221024
public function setValidator($validator)
    {
        $this->callBeforeListeners('setValidator', [$validator]);
        $this->validator = $validator;
        $this->callAfterListeners('setValidator', [$validator]);
    }