You are here

class CompositeFactory in AmazonS3 7.2

Same name in this branch
  1. 7.2 src/CompositeFactory.php \Drupal\amazons3\CompositeFactory
  2. 7.2 tests/Stub/CompositeFactory.php \Drupal\amazons3Test\Stub\CompositeFactory

Override CompositeFactory to inject hook calls.

@class CompositeFactory @package Drupal\amazons3

Hierarchy

  • class \Drupal\amazons3\CompositeFactory extends \Guzzle\Service\Command\Factory\CompositeFactory uses \DrupalAdapter\Module

Expanded class hierarchy of CompositeFactory

File

src/CompositeFactory.php, line 15

Namespace

Drupal\amazons3
View source
class CompositeFactory extends \Guzzle\Service\Command\Factory\CompositeFactory {
  use DrupalAdapter\Module;

  /**
   * {@inheritdoc}
   */
  public function factory($name, array $args = array()) {
    $args = array_merge($args, $this
      ->module_invoke_all('amazons3_command_prepare', $name, $args));
    $this
      ->drupal_alter('amazons3_command_prepare', $name, $args);
    $command = parent::factory($name, $args);
    $this
      ->drupal_alter('amazons3_command', $command);
    return $command;
  }

  /**
   * Get the default chain to use with clients
   *
   * @param ClientInterface $client Client to base the chain on
   *
   * @return self
   * @codeCoverageIgnore This is now fixed upstream to use static.
   */
  public static function getDefaultChain(ClientInterface $client) {
    $factories = array();
    if ($description = $client
      ->getDescription()) {
      $factories[] = new ServiceDescriptionFactory($description);
    }
    $factories[] = new ConcreteClassFactory($client);
    return new static($factories);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CompositeFactory::factory public function
CompositeFactory::getDefaultChain public static function Get the default chain to use with clients