diff options
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Cluster/Settings.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Cluster/Settings.php | 75 |
1 files changed, 40 insertions, 35 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Cluster/Settings.php b/vendor/ruflin/elastica/lib/Elastica/Cluster/Settings.php index 8166dda3..c597417f 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Cluster/Settings.php +++ b/vendor/ruflin/elastica/lib/Elastica/Cluster/Settings.php @@ -1,29 +1,25 @@ <?php - namespace Elastica\Cluster; use Elastica\Client; use Elastica\Request; /** - * Cluster settings + * Cluster settings. * - * @category Xodoa - * @package Elastica * @author Nicolas Ruflin <spam@ruflin.com> - * @link http://www.elasticsearch.org/guide/reference/api/admin-cluster-update-settings.html + * + * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html */ class Settings { /** - * Client - * * @var \Elastica\Client Client object */ protected $_client = null; /** - * Creates a cluster object + * Creates a cluster object. * * @param \Elastica\Client $client Connection client object */ @@ -33,7 +29,7 @@ class Settings } /** - * Returns settings data + * Returns settings data. * * @return array Settings data (persistent and transient) */ @@ -43,11 +39,12 @@ class Settings } /** - * Returns the current persistent settings of the cluster + * Returns the current persistent settings of the cluster. * * If param is set, only specified setting is return. * - * @param string $setting OPTIONAL Setting name to return + * @param string $setting OPTIONAL Setting name to return + * * @return array|string|null Settings data */ public function getPersistent($setting = '') @@ -59,7 +56,7 @@ class Settings if (isset($settings[$setting])) { return $settings[$setting]; } else { - return null; + return; } } @@ -67,11 +64,12 @@ class Settings } /** - * Returns the current transient settings of the cluster + * Returns the current transient settings of the cluster. * * If param is set, only specified setting is return. * - * @param string $setting OPTIONAL Setting name to return + * @param string $setting OPTIONAL Setting name to return + * * @return array|string|null Settings data */ public function getTransient($setting = '') @@ -90,12 +88,14 @@ class Settings if (isset($settings[$key])) { $settings = $settings[$key]; } else { - return null; + return; } } + return $settings; } - return null; + + return; } } @@ -103,10 +103,11 @@ class Settings } /** - * Sets persistent setting + * Sets persistent setting. + * + * @param string $key + * @param string $value * - * @param string $key - * @param string $value * @return \Elastica\Response */ public function setPersistent($key, $value) @@ -114,17 +115,18 @@ class Settings return $this->set( array( 'persistent' => array( - $key => $value - ) + $key => $value, + ), ) ); } /** - * Sets transient settings + * Sets transient settings. + * + * @param string $key + * @param string $value * - * @param string $key - * @param string $value * @return \Elastica\Response */ public function setTransient($key, $value) @@ -132,19 +134,20 @@ class Settings return $this->set( array( 'transient' => array( - $key => $value - ) + $key => $value, + ), ) ); } /** - * Sets the cluster to read only + * Sets the cluster to read only. * * Second param can be used to set it persistent * - * @param bool $readOnly - * @param bool $persistent + * @param bool $readOnly + * @param bool $persistent + * * @return \Elastica\Response $response */ public function setReadOnly($readOnly = true, $persistent = false) @@ -161,9 +164,10 @@ class Settings } /** - * Set settings for cluster + * Set settings for cluster. + * + * @param array $settings Raw settings (including persistent or transient) * - * @param array $settings Raw settings (including persistent or transient) * @return \Elastica\Response */ public function set(array $settings) @@ -172,7 +176,7 @@ class Settings } /** - * Get the client + * Get the client. * * @return \Elastica\Client */ @@ -182,10 +186,11 @@ class Settings } /** - * Sends settings request + * Sends settings request. + * + * @param array $data OPTIONAL Data array + * @param string $method OPTIONAL Transfer method (default = \Elastica\Request::GET) * - * @param array $data OPTIONAL Data array - * @param string $method OPTIONAL Transfer method (default = \Elastica\Request::GET) * @return \Elastica\Response Response object */ public function request(array $data = array(), $method = Request::GET) |