diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2019-11-17 20:45:02 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2019-11-17 20:45:02 +0100 |
commit | 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 (patch) | |
tree | 4d541098d751d5a9acf8c12f6fb9f308ace066ac /vendor/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php | |
download | flyspray-8df3db566a3a937b45ebf11adb90d265e6f5e2d4.tar.xz |
initial checking of customized version 1.0rc9
Diffstat (limited to 'vendor/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php')
-rw-r--r-- | vendor/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/vendor/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php b/vendor/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php new file mode 100644 index 0000000..4fc310a --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php @@ -0,0 +1,40 @@ +<?php + +namespace Guzzle\Service\Builder; + +use Guzzle\Service\Exception\ServiceNotFoundException; + +/** + * Service builder used to store and build clients or arbitrary data. Client configuration data can be supplied to tell + * the service builder how to create and cache {@see \Guzzle\Service\ClientInterface} objects. Arbitrary data can be + * supplied and accessed from a service builder. Arbitrary data and other clients can be referenced by name in client + * configuration arrays to make them input for building other clients (e.g. "{key}"). + */ +interface ServiceBuilderInterface +{ + /** + * Get a ClientInterface object or arbitrary data from the service builder + * + * @param string $name Name of the registered service or data to retrieve + * @param bool|array $throwAway Only pertains to retrieving client objects built using a configuration array. + * Set to TRUE to not store the client for later retrieval from the ServiceBuilder. + * If an array is specified, that data will overwrite the configured params of the + * client if the client implements {@see \Guzzle\Common\FromConfigInterface} and will + * not store the client for later retrieval. + * + * @return \Guzzle\Service\ClientInterface|mixed + * @throws ServiceNotFoundException when a client or data cannot be found by the given name + */ + public function get($name, $throwAway = false); + + /** + * Register a service or arbitrary data by name with the service builder + * + * @param string $key Name of the client or data to register + * @param mixed $service Client configuration array or arbitrary data to register. The client configuration array + * must include a 'class' (string) and 'params' (array) key. + * + * @return ServiceBuilderInterface + */ + public function set($key, $service); +} |