/** * 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); }
/** * 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; }