Create a new spy verifier.

@param Spy|null $spy The spy, or null to create an anonymous spy.

@return SpyVerifier The newly created spy verifier.
558652
public function create(Spy $spy = null): SpyVerifier
    {
        if (!$spy) {
            $spy = $this->spyFactory->create();
        }

        return new SpyVerifier(
            $spy,
            $this->matcherFactory,
            $this->matcherVerifier,
            $this->generatorVerifierFactory,
            $this->iterableVerifierFactory,
            $this->callVerifierFactory,
            $this->assertionRecorder,
            $this->assertionRenderer
        );
    }
1298683
public function createLogger($channel)
    {
        Cascade::loadConfigFromArray($this->config);
        $logger = Cascade::getLogger($channel);
        $logger->pushProcessor(new PsrLogMessageProcessor());
        return $logger;
    }
1121544
public function createBot($token, $secret = null)
    {
        $this->bot = new Bot($token);
        $this->bot->setSecret($secret);

        return $this;
    }
971791
public static function init($key = null, $secret = null) {
        $patrol = new Patrol;

        if ($key && $secret) {
            $patrol->setApiKey($key);
            $patrol->setApiSecret($secret);
        }

        return $patrol;
    }
593600
public function create($pointer = null)
    {
        if (null === $pointer) {
            return new Pointer;
        }

        return new Pointer($this->parseAtoms($pointer));
    }
1109134
public static <R, T> Function<T, R> spy1st(Function<T, R> function, Box<T> param) {
        return spy(function, Box.<R>empty(), param);
    }
727442
public function create(string $locale = FakerFactory::DEFAULT_LOCALE): FakerGenerator
    {
        $locale = str_replace('-', '_', $locale);

        return tap(FakerFactory::create($locale), function (FakerGenerator $faker) use ($locale) {
            $this->dispatcher->triggerEvent('afterFakerCreated', ['faker' => $faker, 'locale' => $locale]);
        });
    }
226609
public static function create($userIdentifier, $secretKey, $logger = null)
    {
        $client = self::initializeHttpClient(self::ENDPOINT_URL);

        return new self($userIdentifier, $secretKey, $client, $logger);
    }
488582
function(fn) {
        // Save off the existing spy method as __functionName
        var newName = '__' + fn;
        self[newName] = self[fn];

        // This is the actual function that will be called when,
        // for example, calledWith() is invoked
        return function() {
          var func = self[newName];
          
          // If this thing is a function, invoke it with all arguments;
          // otherwise, just grab the value of the property.
          var val = typeof func === 'function' ? func.apply(condition, arguments) : func;

          // Negate and return
          return !val;
        };
      }
230453
public function createLogger($channel)
    {
        if (!$this->app) {
            throw new \RuntimeException('No application instance provided.');
        }

        $logger = new Logger($channel);
        $level = $this->coreLevel;
        if (!in_array($channel, Channels::getCoreChannels())) {
            $level = Logger::DEBUG;
        }

        $handler = $this->createHandler($level);

        $logger->pushHandler($handler);
        $logger->pushProcessor($this->app->make(PsrLogMessageProcessor::class));
        $logger->pushProcessor($this->app->make(Concrete5UserProcessor::class));

        return $logger;
    }
925169
def recruit(spy)
      raise AlreadyStubbedError if @spies[spy.object_id]
      check_spy!(spy)
      @spies[spy.object_id] = spy
    end
250464
protected function createSwiftSigner($signature)
    {
        if (!isset($signature['type'])) {
            throw new InvalidConfigException('Signature configuration should contain "type" key');
        }
        switch (strtolower($signature['type'])) {
            case 'dkim' :
                $domain = ArrayHelper::getValue($signature, 'domain', null);
                $selector = ArrayHelper::getValue($signature, 'selector', null);
                if (isset($signature['key'])) {
                    $privateKey = $signature['key'];
                } elseif (isset($signature['file'])) {
                    $privateKey = file_get_contents(Yii::getAlias($signature['file']));
                } else {
                    throw new InvalidConfigException("Either 'key' or 'file' signature option should be specified");
                }
                return new \Swift_Signers_DKIMSigner($privateKey, $domain, $selector);
            case 'opendkim' :
                $domain = ArrayHelper::getValue($signature, 'domain', null);
                $selector = ArrayHelper::getValue($signature, 'selector', null);
                if (isset($signature['key'])) {
                    $privateKey = $signature['key'];
                } elseif (isset($signature['file'])) {
                    $privateKey = file_get_contents(Yii::getAlias($signature['file']));
                } else {
                    throw new InvalidConfigException("Either 'key' or 'file' signature option should be specified");
                }
                return new \Swift_Signers_OpenDKIMSigner($privateKey, $domain, $selector);
            default:
                throw new InvalidConfigException("Unrecognized signature type '{$signature['type']}'");
        }
    }
459206
private function createLogger(): LoggerInterface
    {
        $container = $this->iocContainer();
        if (empty($container) || !$container->has(LogsInterface::class)) {
            return new NullLogger();
        }

        //We are using class name as log channel (name) by default
        return $container->get(LogsInterface::class)->getLogger(static::class);
    }
1151273
public static function create(Closure $callback = null)
    {
        if (self::$instance === null) {
            self::$instance = new self();
        }

        if ($callback instanceof Closure) {
            return $callback(self::$instance);
        }

        return self::$instance;
    }
434305
public function agent($arg = null)
    {
        $agent = new Agent();

        if ($arg) {
            return $agent->is($arg);
        }
        
        return new Agent();
    }
996208
public static function tryParse(string $scheme): ?SchemeInterface
    {
        if (!self::myParse($scheme, $result, $type, $defaultPort)) {
            return null;
        }

        return new self($result, $type, $defaultPort);
    }
1297652
public static <R, T> Function<T, R> spyRes(Function<T, R> function, Box<R> result) {
        return spy(function, result, Box.<T>empty());
    }