public function __construct(Client $client, $name) { $this->_client = $client; if (!is_scalar($name)) { throw new InvalidException('Index name should be a scalar type'); } $this->_name = (string) $name; }