Ejemplo n.º 1
0
 /**
  * Get the default chain to use with clients
  *
  * @param ClientInterface $client Client to base the chain on
  *
  * @return self
  */
 public static function getDefaultChain(ClientInterface $client)
 {
     $factories = array();
     if ($description = $client->getDescription()) {
         $factories[] = new ServiceDescriptionFactory($description);
     }
     $factories[] = new ConcreteClassFactory($client);
     return new self($factories);
 }
Ejemplo n.º 2
0
 /**
  * Get the default chain to use with clients
  *
  * @return CompositeFactory
  */
 public static function getDefaultChain(ClientInterface $client)
 {
     $chain = new self();
     $description = $client->getDescription();
     if ($description instanceof ServiceDescription) {
         $chain->add(new ServiceDescriptionFactory($description));
     }
     $chain->add(new ConcreteClassFactory($client));
     return $chain;
 }