Lifts a function to the current Observable and returns a new Observable that when subscribed to will pass
the values of the current Observable through the Operator function.

@param callable $operatorFactory
@return AnonymousObservable
1065
public function lift(callable $operatorFactory)
    {
        return new AnonymousObservable(function (ObserverInterface $observer, SchedulerInterface $schedule) use ($operatorFactory) {
            $operator = $operatorFactory();
            return $operator($this, $observer, $schedule);
        });
    }
1189315
public function getInlineOperator(string $operator): callable
    {
        if (!$this->hasInlineOperator($operator)) {
            throw new OperatorNotFoundException($operator, sprintf('Inline operator "%s" does not exist.', $operator));
        }

        return $this->inlineOperators[$operator];
    }
457809
protected function replaceOperatorForNulLValue(OperatorInterface $Operator, $value)
    {
        if ($value === null) {
            if ($Operator->getType() === Equal::TYPE_NAME) {
                $className = CriteriaBuilder::getOperatorClassNameBySqlOperator(Is::TYPE_AS_SQL);
                $Operator = $this->getFactoryWorker()->buildCriteriaOperator($className);
            } elseif ($Operator->getType() === NotEqual::TYPE_NAME) {
                $className = CriteriaBuilder::getOperatorClassNameBySqlOperator(NotIs::TYPE_AS_SQL);
                $Operator = $this->getFactoryWorker()->buildCriteriaOperator($className);
            }
        }

        return $Operator;
    }
879373
<E> Observable<E> wrapObservable(Observable<E> obs) {
        return obs.subscribeOn(Schedulers.io()).observeOn(Schedulers.io());
    }
80473
public function createService(OAuthServiceFactory $factory)
    {
        $config = $this->config->get('auth.external_concrete5');

        $appId = array_get($config, 'appid');
        $appSecret = array_get($config, 'secret');
        $baseUrl = array_get($config, 'url');

        // Get the callback url
        /** @var Url $callbackUrl */
        $callbackUrl = $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete5/callback/']);
        if ($callbackUrl->getHost() == '') {
            $callbackUrl = $callbackUrl->setHost($this->request->getHost());
            $callbackUrl = $callbackUrl->setScheme($this->request->getScheme());
        }

        // Create a credential object with our ID, Secret, and callback url
        $credentials = new Credentials($appId, $appSecret, (string) $callbackUrl);

        // Create a new session storage object and pass it the active session
        $storage = new SymfonySession($this->session, false);

        $baseApiUrl = new Uri($baseUrl);

        // Create the service using the oauth service factory
        return $factory->createService('external_concrete5', $credentials, $storage, [
            ExternalConcrete5Service::SCOPE_OPENID,
        ], $baseApiUrl);
    }
163002
public static function AddFactory( &$factories)
	{
		foreach ( $factories as /** @var ValueProxyFactory $curr */ $curr )
		{
			if ( count( ValueProxy::$valueFactory ) == ValueProxy::TYPES_MAX )
				throw new InvalidOperationException();

			ValueProxy::$valueFactory[ $curr->GetValueType()->getTypeName() ] = $curr;
		}
		ValueProxy::Bind();
	}
387988
public function mapWithIndex(callable $selector): Observable
    {
        $index = 0;
        return $this->map(function ($value) use ($selector, &$index) {
            return $selector($index++, $value);
        });
    }
47455
public function register(callable $factory): self
    {
        $this->data->register($factory, $this->crtPriority);
        return $this;
    }
370584
public function setOperator($operator)
    {
        if (! array_key_exists($operator, $this->sqlOperators)) {
            throw new FilterOperatorException("Operator [$operator] not found");
        }

        $this->operator = $operator;

        return $this;
    }
928057
public function eventFactory()
    {
        if (null !== $this->eventPrototype) {
            return clone $this->eventPrototype;
        }

        try {
            /** @var ModuleOptions $moduleOptions */
            $moduleOptions = $this->get(ModuleOptions::class);

            $moduleOptionsEventClassName = $moduleOptions->getModuleOptionsEventClassName();
            $r = new ReflectionClass($moduleOptionsEventClassName);

            $eventPrototype = $r->newInstance();
            if (!$eventPrototype instanceof EventInterface) {
                $errMsg = sprintf(
                    'Event of type %s is invalid; must implement %s',
                    (is_object($eventPrototype) ? get_class($eventPrototype) : gettype($eventPrototype)),
                    ModuleOptionsEventInterface::class
                );
                throw new Exception\RuntimeException($errMsg);
            }
            $this->eventPrototype = $eventPrototype;
        } catch (\Exception $e) {
            throw new Exception\InvalidEventException($e->getMessage(), $e->getCode(), $e);
        }

        return clone $this->eventPrototype;
    }
1235961
protected function factory(Factory $factory)
	{
		$factory->setLogger($this->getLogger());

		return $factory->setFactoryManager($this);
	}
954441
public function average(): Observable
    {
        return $this
            ->defaultIfEmpty(Observable::error(new \UnderflowException()))
            ->reduce(function ($a, $x) {
                static $count = 0;
                static $total = 0;

                $count++;
                $total += $x;

                return $total / $count;
            }, 0);
    }
1143623
protected function createObjectFactory()
    {
        try {
            if (isset($this->parameters[SessionParameter::OBJECT_FACTORY_CLASS])) {
                $objectFactoryClass = new $this->parameters[SessionParameter::OBJECT_FACTORY_CLASS];
            } else {
                $objectFactoryClass = $this->createDefaultObjectFactoryInstance();
            }

            if (!($objectFactoryClass instanceof ObjectFactoryInterface)) {
                throw new \RuntimeException('Class does not implement ObjectFactoryInterface!', 1408354119);
            }

            $objectFactoryClass->initialize($this, $this->parameters);

            return $objectFactoryClass;
        } catch (\Exception $exception) {
            throw new \RuntimeException(
                'Unable to create object factory: ' . $exception,
                1408354120
            );
        }
    }
1082577
final protected function templateFactory()
    {
        if ($this->templateFactory === null) {
            throw new RuntimeException(sprintf(
                'Template Factory is not defined for [%s]',
                get_class($this)
            ));
        }

        return $this->templateFactory;
    }
503691
private function extended(callable $factory, callable ...$extensions): callable
    {
        return array_reduce($extensions, function ($factory, $extension) {
            return new Extension($factory, $extension);
        }, $factory);
    }
1129403
public static function fromObservable(ObservableInterface $observable, Deferred $deferred = null)
    {
        $d     = $deferred ?: new Deferred();
        $value = null;

        $observable->subscribe(new CallbackObserver(
            function ($v) use (&$value) {
                $value = $v;
            },
            function ($error) use ($d) {
                $d->reject($error);
            },
            function () use ($d, &$value) {
                $d->resolve($value);
            }
        ));

        return $d->promise();
    }
464089
public function where($column, $operator, $value = null)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->where(...func_get_args());

        return $instance;
    }