Skip to content

Commit 9c84d3c

Browse files
author
Vasyl Sovyak
committed
- Fix for generate_doc.php to generate correct namespaces for "extends" and "implements"
- Regenerated docs with applied fix in generator.
1 parent 8f05497 commit 9c84d3c

21 files changed

+30
-24
lines changed

ext/doc/Cassandra.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,12 @@ final class Cassandra {
379379
/**
380380
* The current version of the extension.
381381
*/
382-
const VERSION = '1.3.1';
382+
const VERSION = '1.3.2';
383383

384384
/**
385385
* The version of the cpp-driver the extension is compiled against.
386386
*/
387-
const CPP_DRIVER_VERSION = '2.7.0';
387+
const CPP_DRIVER_VERSION = '2.9.0';
388388

389389
/**
390390
* Creates a new cluster builder for constructing a Cluster object.

ext/doc/Cassandra/Cluster/Builder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ public function withSchemaMetadata($enabled) { }
323323
* reverse IP lookup. This is useful for authentication (Kerberos) or
324324
* encryption SSL services that require a valid hostname for verification.
325325
*
326+
* Important: It's possible that the underlying C/C++ driver does not
327+
* support hostname resolution. A PHP warning will be emitted if the driver
328+
* does not support hostname resolution.
329+
*
326330
* @param bool $enabled whether the driver uses hostname resolution.
327331
*
328332
* @return Builder self

ext/doc/Cassandra/Exception/DomainException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Cassandra domain exception.
2323
*/
24-
class DomainException extends \DomainException implements Exception {
24+
class DomainException extends \DomainException implements \Cassandra\Exception {
2525

2626
/**
2727
* @param mixed $message

ext/doc/Cassandra/Exception/InvalidArgumentException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Cassandra invalid argument exception.
2323
*/
24-
class InvalidArgumentException extends \InvalidArgumentException implements Exception {
24+
class InvalidArgumentException extends \InvalidArgumentException implements \Cassandra\Exception {
2525

2626
/**
2727
* @param mixed $message

ext/doc/Cassandra/Exception/LogicException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Cassandra logic exception.
2323
*/
24-
class LogicException extends \LogicException implements Exception {
24+
class LogicException extends \LogicException implements \Cassandra\Exception {
2525

2626
/**
2727
* @param mixed $message

ext/doc/Cassandra/Exception/RangeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Cassandra domain exception.
2323
*/
24-
class RangeException extends \RangeException implements Exception {
24+
class RangeException extends \RangeException implements \Cassandra\Exception {
2525

2626
/**
2727
* @param mixed $message

ext/doc/Cassandra/Exception/RuntimeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Cassandra runtime exception.
2323
*/
24-
class RuntimeException extends \RuntimeException implements Exception {
24+
class RuntimeException extends \RuntimeException implements \Cassandra\Exception {
2525

2626
/**
2727
* @param mixed $message

ext/doc/Cassandra/RetryPolicy/DefaultPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
*
2929
* In all other cases the error will be returned.
3030
*/
31-
final class DefaultPolicy implements RetryPolicy {
31+
final class DefaultPolicy implements \Cassandra\RetryPolicy {
3232

3333
}

ext/doc/Cassandra/RetryPolicy/DowngradingConsistency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
* Important: This policy may attempt to retry requests with a lower
4040
* consistency level. Using this policy can break consistency guarantees.
4141
*/
42-
final class DowngradingConsistency implements RetryPolicy {
42+
final class DowngradingConsistency implements \Cassandra\RetryPolicy {
4343

4444
}

ext/doc/Cassandra/RetryPolicy/Fallthrough.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
/**
2222
* A retry policy that never retries and allows all errors to fallthrough.
2323
*/
24-
final class Fallthrough implements RetryPolicy {
24+
final class Fallthrough implements \Cassandra\RetryPolicy {
2525

2626
}

ext/doc/Cassandra/RetryPolicy/Logging.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* A retry policy that logs the decisions of its child policy.
2323
*/
24-
final class Logging implements RetryPolicy {
24+
final class Logging implements \Cassandra\RetryPolicy {
2525

2626
/**
2727
* Creates a new Logging retry policy.

ext/doc/Cassandra/TimestampGenerator/Monotonic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
* exceeded then a warning is logged and timestamps stop incrementing until
2828
* the next clock tick.
2929
*/
30-
final class Monotonic implements TimestampGenerator {
30+
final class Monotonic implements \Cassandra\TimestampGenerator {
3131

3232
}

ext/doc/Cassandra/TimestampGenerator/ServerSide.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
/**
2222
* A timestamp generator that allows the server-side to assign timestamps.
2323
*/
24-
final class ServerSide implements TimestampGenerator {
24+
final class ServerSide implements \Cassandra\TimestampGenerator {
2525

2626
}

ext/doc/Cassandra/Type/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* A class that represents the list type. The list type contains the type of the
2323
* elements contain in the list.
2424
*/
25-
final class Collection extends Type {
25+
final class Collection extends \Cassandra\Type {
2626

2727
private function __construct() { }
2828

ext/doc/Cassandra/Type/Custom.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* A class that represents a custom type.
2323
*/
24-
final class Custom extends Type {
24+
final class Custom extends \Cassandra\Type {
2525

2626
private function __construct() { }
2727

ext/doc/Cassandra/Type/Map.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* A class that represents the map type. The map type contains two types that
2323
* represents the types of the key and value contained in the map.
2424
*/
25-
final class Map extends Type {
25+
final class Map extends \Cassandra\Type {
2626

2727
private function __construct() { }
2828

ext/doc/Cassandra/Type/Scalar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* A class that represents a primitive type (e.g. `varchar` or `bigint`)
2323
*/
24-
final class Scalar extends Type {
24+
final class Scalar extends \Cassandra\Type {
2525

2626
private function __construct() { }
2727

ext/doc/Cassandra/Type/Set.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* A class that represents the set type. The set type contains the type of the
2323
* elements contain in the set.
2424
*/
25-
final class Set extends Type {
25+
final class Set extends \Cassandra\Type {
2626

2727
private function __construct() { }
2828

ext/doc/Cassandra/Type/Tuple.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* A class that represents the tuple type. The tuple type is able to represent
2323
* a composite type of one or more types accessed by index.
2424
*/
25-
final class Tuple extends Type {
25+
final class Tuple extends \Cassandra\Type {
2626

2727
private function __construct() { }
2828

ext/doc/Cassandra/Type/UserType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* A class that represents a user type. The user type is able to represent a
2323
* composite type of one or more types accessed by name.
2424
*/
25-
final class UserType extends Type {
25+
final class UserType extends \Cassandra\Type {
2626

2727
private function __construct() { }
2828

ext/doc/generate_doc.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,9 @@ function writeClass($doc, $file, $class) {
392392
$parentClass = $class->getParentClass();
393393
if ($parentClass) {
394394
$parentClassName = $parentClass->getName();
395-
if (startsWith($parentClassName, $namespace)) {
396-
$parentClassName = $parentClass->getShortName();
395+
if (startsWith($parentClassName, $namespace) && $parentClassName !== $namespace) {
396+
$replacement = $namespace . '\\';
397+
$parentClassName = substr_replace($parentClassName, '', 0, strlen($replacement));
397398
} else {
398399
$parentClassName = "\\" . $parentClassName;
399400
}
@@ -409,8 +410,9 @@ function writeClass($doc, $file, $class) {
409410
continue;
410411
}
411412
$interfaceName = $interface->getName();
412-
if (startsWith($interfaceName, $namespace)) {
413-
$interfaceName = $interface->getShortName();
413+
if (startsWith($interfaceName, $namespace) && $interfaceName !== $namespace) {
414+
$replacement = $namespace . '\\';
415+
$interfaceName = substr_replace($interfaceName, '', 0, strlen($replacement));
414416
} else {
415417
$interfaceName = "\\" . $interfaceName;
416418
}

0 commit comments

Comments
 (0)