コード例 #1
0
 /**
  *
  */
 public function testMakeClient()
 {
     $host = '127.0.0.1';
     $port = 9200;
     $client = $this->factory->makeClient($host, $port);
     static::assertInstanceOf(Client::class, $client);
 }
コード例 #2
0
 /**
  * @param array $options
  *
  * @return ESGatewayUserRepo
  */
 public static function buildUserRepo(array $options)
 {
     self::validateOptions($options);
     $factory = new Factory();
     $client = $factory->makeClient($options['host'], $options['port']);
     $type = $factory->makeType($options['index'], $options['type']);
     $persist = new GatewayUserPersist($client, $type);
     $repo = new ESGatewayUserRepo($persist, $factory);
     return $repo;
 }