Skip to content

Commit 574c4fb

Browse files
author
mikefero
committed
doc: Updates to documentation and consistency formatting for stubs
1 parent 89afaf8 commit 574c4fb

33 files changed

+228
-119
lines changed

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
Features:
44

5-
* Persistent Sessions (can be disabled via `Cassandra\Cluster\Builder::withPersistentSessions()`).
5+
* Persistent sessions (can be disabled via `Cassandra\Cluster\Builder::withPersistentSessions()`).
66
* Windows support.
77
* Configurable log location (via `cassandra.log` ini setting).
88
* Configurable log level (via `cassandra.log_level` ini setting).
9-
* Upgraded to CPP driver v2.0.
9+
* Upgraded to C/C++ driver v2.0.
1010
* Added math functions to numeric types and `Cassandra\Numeric` interface.
1111
* All classes moved into the extension.
12+
* Added stub files for IDEs.
1213

1314
Bug Fixes:
1415

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ help the maintainer to fix the bug that you've discovered quicker:
77

88
* [Use the PHP Driver Jira](https://datastax-oss.atlassian.net/projects/PHP) to report all issues and bugs.
99
* Include the version of the Driver, PHP and Cassandra or DSE in your Jira ticket.
10+
* Include the Driver dependency versions as well (e.g. libuv, C/C++ Driver, ...etc)
1011
* Include a complete stack trace of the failure as well as any available logs.
1112
* Include any additional information you think is relevant - the description of
1213
your setup, any non-default Driver configuration, etc.

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@ upcoming releases.
2222

2323
## What's new in v1.0.0.beta:
2424

25-
* Persistent Sessions.
25+
* Persistent sessions.
2626
* Windows support.
27+
* Configurable logger (file/syslog and level).
2728
* Math functions for numeric types and `Cassandra\Numeric` interface.
2829
* All classes moved into the extension.
30+
* Upgraded to use the C/C++ driver v2.0.
31+
* Added stub files for IDEs.
2932

3033
## Planned
3134

3235
* Ability to configure connection pooling.
33-
* Ability to configure latency aware load balancing
36+
* Ability to configure latency aware load balancing.
3437
* Expose [Schema Metadata](http://datastax.github.io/cpp-driver/api/struct_cass_session/#1afc51badec695483e4cde43ae0fc1e876).
3538

3639
## Quick Start
@@ -64,10 +67,9 @@ Cassandra's native protocol. The current version works with:
6467
* Apache Cassandra versions 1.2, 2.0 and partially 2.1
6568
* DataStax Enterprise 3.1, 3.2, 4.0 and 4.5
6669
* PHP 5.3+
70+
* Compilers: GCC 4.1.2+, Clang 3.4+, and MSVC 2010/2012/2013
6771

68-
__NOTE__: Apache Cassandra 2.1 support is limited to the Cassandra 2.0 API, e.g. no user-defined types.
69-
70-
__NOTE__: Windows support is planned for a later, more stable release.
72+
__NOTE__: Apache Cassandra 2.1 support is limited to the Cassandra 2.0 API (native protocol v2), e.g. no user-defined types.
7173

7274
## Contributing
7375

@@ -93,13 +95,14 @@ vagrant up
9395
vagrant ssh
9496
```
9597

96-
Once you've logged in to the vagrant vm, run:
98+
Once you've logged in to the vagrant VM, run:
9799

98100
```bash
99101
cd /usr/local/src/php-driver
100102
./bin/behat
101103
./bin/phpunit
102104
```
105+
103106
## Copyright
104107

105108
Copyright 2015 DataStax, Inc.

ext/doc/Cassandra/Bigint.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@
2424
final class Bigint implements Numeric
2525
{
2626
/**
27-
* Creates a new 64bit integer
27+
* Creates a new 64bit integer.
28+
*
2829
* @param string $value integer value as a string
2930
*/
3031
public function __construct($value) {}
3132

3233
/**
33-
* Returns the integer value
34+
* Returns the integer value.
35+
*
3436
* @return string integer value
3537
*/
3638
public function value() {}
3739

3840
/**
39-
* Returns string representation of the integer value
41+
* Returns string representation of the integer value.
42+
*
4043
* @return string integer value
4144
*/
4245
public function __toString() {}

ext/doc/Cassandra/Blob.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@
2424
final class Blob
2525
{
2626
/**
27-
* Creates a new bytes array
27+
* Creates a new bytes array.
28+
*
2829
* @param string $bytes any bytes
2930
*/
3031
public function __construct($bytes) {}
3132

3233
/**
33-
* Returns bytes as a hex string
34+
* Returns bytes as a hex string.
35+
*
3436
* @return string bytes as hexadecimal string
3537
*/
3638
public function bytes() {}
3739

3840
/**
39-
* Returns bytes as a hex string
41+
* Returns bytes as a hex string.
42+
*
4043
* @return string bytes as hexadecimal string
4144
*/
4245
public function __toString() {}

ext/doc/Cassandra/Cluster/Builder.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public function withContactPoints($host) {}
7474
/**
7575
* Specify a different port to be used when connecting to the cluster.
7676
*
77+
* @throws Cassandra\Exception\InvalidArgumentException
78+
*
7779
* @param int $port a number between 1 and 65535
7880
*
7981
* @return Builder self
@@ -101,7 +103,7 @@ public function withDatacenterAwareRoundRobinLoadBalancingPolicy($localDatacente
101103
/**
102104
* Enable token aware routing.
103105
*
104-
* @param bool $enabled Whether to enable token aware routing
106+
* @param bool $enabled Whether to enable token aware routing (optional)
105107
*
106108
* @return Builder self
107109
*/
@@ -144,9 +146,10 @@ public function withRequestTimeout($timeout) {}
144146
public function withSSL(SSLOptions $options) {}
145147

146148
/**
147-
* Enable persistent sessions and clusters
149+
* Enable persistent sessions and clusters.
148150
*
149-
* @param bool $enabled whether to enable persistent sessions and clusters.
151+
* @param bool $enabled whether to enable persistent sessions and clusters
152+
* (optional)
150153
*
151154
* @return Builder self
152155
*/

ext/doc/Cassandra/Collection.php

+15-6
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,49 @@
2424
final class Collection implements \Countable, \IteratorAggregate
2525
{
2626
/**
27-
* Creates a new collection of a given type
27+
* Creates a new collection of a given type.
28+
*
2829
* @param string $type one of `Cassandra::TYPE_*`
2930
*/
3031
public function __construct($type) {}
3132

3233
/**
33-
* The type of this collection
34+
* The type of this collection.
35+
*
3436
* @return string one of `Cassandra::TYPE_*`
3537
*/
3638
public function type() {}
3739

3840
/**
39-
* Array of values in this collection
41+
* Array of values in this collection.
42+
*
4043
* @return array values
4144
*/
4245
public function values() {}
4346

4447
/**
45-
* Adds one or more values to this collection
48+
* Adds one or more values to this collection.
49+
*
4650
* @param mixed $value,... one or more values to add
51+
*
4752
* @return int total number of values in this collection
4853
*/
4954
public function add($value) {}
5055

5156
/**
52-
* Retrieves the value at a given index
57+
* Retrieves the value at a given index.
58+
*
5359
* @param int $index Index
60+
*
5461
* @return mixed|null Value
5562
*/
5663
public function get($index) {}
5764

5865
/**
59-
* Finds index of a value in this collection
66+
* Finds index of a value in this collection.
67+
*
6068
* @param mixed $value Value
69+
*
6170
* @return int|null Index
6271
*/
6372
public function find($value) {}

ext/doc/Cassandra/Decimal.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,27 @@ final class Decimal implements Numeric
3636
* $this->assertEquals("1313123123234234234234234234123", $decimal->value());
3737
* ~~~
3838
*
39-
*
4039
* @param string $value Any decimal string
4140
*/
4241
public function __construct($value) {}
4342

4443
/**
45-
* String representation of this decimal
44+
* String representation of this decimal.
45+
*
4646
* @return string Decimal value
4747
*/
4848
public function __toString() {}
4949

5050
/**
51-
* Numeric value of this decimal as string
51+
* Numeric value of this decimal as string.
52+
*
5253
* @return string Numeric value
5354
*/
5455
public function value() {}
5556

5657
/**
57-
* Scale of this decimal as int
58+
* Scale of this decimal as int.
59+
*
5860
* @return int Scale
5961
*/
6062
public function scale() {}

ext/doc/Cassandra/Exception/DomainException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
use Cassandra\Exception;
2222

2323
/**
24-
* Cassandra-specific domain exception
24+
* Cassandra-specific domain exception.
2525
*/
2626
class DomainException extends \DomainException implements Exception {}

ext/doc/Cassandra/Exception/InvalidArgumentException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
use Cassandra\Exception;
2222

2323
/**
24-
* Cassandra-specific invalid argument exception
24+
* Cassandra-specific invalid argument exception.
2525
*/
2626
class InvalidArgumentException extends \InvalidArgumentException implements Exception {}

ext/doc/Cassandra/Exception/LogicException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
use Cassandra\Exception;
2222

2323
/**
24-
* Cassandra-specific logic exception
24+
* Cassandra-specific logic exception.
2525
*/
2626
class LogicException extends \LogicException implements Exception {}

ext/doc/Cassandra/Exception/ReadTimeoutException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
namespace Cassandra\Exception;
2020

2121
/**
22-
* ReadTimeoutException is raised when coordinator failed to receive acks from
23-
* the required number of replica nodes in time during a read.
22+
* ReadTimeoutException is raised when a coordinator failed to receive acks
23+
* from the required number of replica nodes in time during a read.
2424
* @see https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v1.spec#L709-L726 Description of ReadTimeout error in the native protocol spec
2525
*/
2626
class ReadTimeoutException extends ExecutionException {}

ext/doc/Cassandra/Exception/RuntimeException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
use Cassandra\Exception;
2222

2323
/**
24-
* Cassandra-specific runtime exception
24+
* Cassandra-specific runtime exception.
2525
*/
2626
class RuntimeException extends \RuntimeException implements Exception {}

ext/doc/Cassandra/Exception/ServerException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace Cassandra\Exception;
2020

2121
/**
22-
* Server exception is raised when something unexpected happend on the server.
22+
* ServerException is raised when something unexpected happend on the server.
2323
* This exception is most likely due to an Apache Cassandra bug.
2424
* **NOTE** This exception and all its children are generated on the server.
2525
*/

ext/doc/Cassandra/Exception/TimeoutException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace Cassandra\Exception;
2020

2121
/**
22-
* Timeout exception, this is generally raised with future did not resolved
22+
* TimeoutException is generally raised when a future did not resolve
2323
* within a given time interval.
2424
*/
2525
class TimeoutException extends RuntimeException {}

ext/doc/Cassandra/Exception/TruncateException.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
namespace Cassandra\Exception;
2020

2121
/**
22-
* TruncateException is raised when something went wrong during table truncation.
22+
* TruncateException is raised when something went wrong during table
23+
* truncation.
2324
*/
2425
class TruncateException extends ExecutionException {}

ext/doc/Cassandra/Exception/UnavailableException.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
namespace Cassandra\Exception;
2020

2121
/**
22-
* UnavailableException is raised when coordinator detected that there aren't
23-
* enough replica nodes available to fulfill the request. Request has not even
24-
* been forwarded to the replica nodes in this case.
22+
* UnavailableException is raised when a coordinator detected that there aren't
23+
* enough replica nodes available to fulfill the request.
24+
*
25+
* NOTE: Request has not even been forwarded to the replica nodes in this case.
2526
* @see https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v1.spec#L667-L677 Description of the Unavailable error in the native protocol v1 spec.
2627
*/
2728
class UnavailableException extends ExecutionException {}

ext/doc/Cassandra/Exception/WriteTimeout.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
namespace Cassandra\Exception;
2020

2121
/**
22-
* WriteTimeoutException is raised when coordinator failed to receive acks from
23-
* the required number of replica nodes in time during a write.
22+
* WriteTimeoutException is raised when a coordinator failed to receive acks
23+
* from the required number of replica nodes in time during a write.
2424
* @see https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v1.spec#L683-L708 Description of WriteTimeout error in the native protocol spec
2525
*/
2626
class WriteTimeoutException extends ExecutionException {}

ext/doc/Cassandra/ExecutionOptions.php

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
final class ExecutionOptions
3030
{
3131
/**
32+
* Creates a new options object for execution.
33+
*
3234
* @throws Cassandra\Exception\InvalidArgumentException
3335
*
3436
* array['arguments'] array An array or positional or named arguments

ext/doc/Cassandra/Float.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@
2424
final class Float implements Numeric
2525
{
2626
/**
27-
* Creates a new float
27+
* Creates a new float.
28+
*
2829
* @param string $value float value as a string
2930
*/
3031
public function __construct($value) {}
3132

3233
/**
33-
* Returns the float value
34+
* Returns the float value.
35+
*
3436
* @return string float value
3537
*/
3638
public function value() {}
3739

3840
/**
39-
* Returns string representation of the float value
41+
* Returns string representation of the float value.
42+
*
4043
* @return string float value
4144
*/
4245
public function __toString() {}

0 commit comments

Comments
 (0)