Skip to content

Commit fa8a295

Browse files
authored
implement doc generation with phpDocumentor 3 (prerelease), clean up doc tags (#50)
1 parent 9c1eadb commit fa8a295

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+490
-123
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ composer.phar
66
.vagrant
77
integration-tests/vendor
88
composer.lock
9+
docs/build

.ldrelease/build-docs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd docs
6+
make PHPDOC_ARCHIVE=/home/circleci/ldtools/phpDocumentor.phar # provided in ldcircleci/ld-php-sdk-release image

.ldrelease/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@ publications:
66
- url: https://packagist.org/packages/launchdarkly/server-sdk
77
description: Packagist
88

9+
circleCI:
10+
linux:
11+
image: ldcircleci/ld-php-sdk-release:1 # built in sdks-ci-docker project, contains PHP 7.2 + phpDocumentor
12+
13+
documentation:
14+
githubPages: true
15+
916
sdk:
1017
displayName: "PHP"

.ldrelease/publish-docs.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Releaser will publish the docs to GitHub pages for us if we put a "docs.zip" artifact in ./artifacts
6+
7+
mkdir -p artifacts
8+
pushd docs/build/html
9+
rm -f docs.zip
10+
zip -r docs.zip *
11+
popd
12+
mv docs/build/html/docs.zip artifacts

.ldrelease/update-version.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -e
4+
35
# Update version in LDClient class
46
LDCLIENT_PHP=src/LaunchDarkly/LDClient.php
57
LDCLIENT_PHP_TEMP=${LDCLIENT_PHP}.tmp

docs/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
# PHPDOC_ARCHIVE is overridden in the CircleCI release
3+
PHPDOC_ARCHIVE := $(shell pwd)/build/phpDocumentor.phar
4+
OUTPUT_DIR := $(shell pwd)/build
5+
PHPDOC_URL=https://www.phpdoc.org/phpDocumentor.phar
6+
7+
.PHONY: install html
8+
9+
html: install
10+
rm -rf build/temp build/html
11+
cd .. && php $(PHPDOC_ARCHIVE) --visibility public --title "LaunchDarkly PHP SDK ${LD_RELEASE_VERSION}"
12+
13+
install: $(PHPDOC_ARCHIVE)
14+
15+
$(PHPDOC_ARCHIVE):
16+
mkdir -p build
17+
cd build && unzip ../lib/phpDocumentor.phar.zip

phpdoc.dist.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpdoc>
3+
<parser>
4+
<target>docs/build/temp</target>
5+
</parser>
6+
<transformer>
7+
<target>docs/build/html</target>
8+
</transformer>
9+
<files>
10+
<directory>src</directory>
11+
<ignore>src/LaunchDarkly/Impl/*</ignore>
12+
<ignore>src/LaunchDarkly/Impl/Integrations/*</ignore>
13+
<!-- the @ignore and @internal tags currently not working correctly in phpDocumentor, so we will manually ignore these internal files: -->
14+
<ignore>src/LaunchDarkly/Clause.php</ignore>
15+
<ignore>src/LaunchDarkly/EvalResult.php</ignore>
16+
<ignore>src/LaunchDarkly/EvaluationException.php</ignore>
17+
<ignore>src/LaunchDarkly/EventProcessor.php</ignore>
18+
<ignore>src/LaunchDarkly/EventSerializer.php</ignore>
19+
<ignore>src/LaunchDarkly/FeatureFlag.php</ignore>
20+
<ignore>src/LaunchDarkly/Operators.php</ignore>
21+
<ignore>src/LaunchDarkly/PreloadedFeatureRequester.php</ignore>
22+
<ignore>src/LaunchDarkly/Prerequisite.php</ignore>
23+
<ignore>src/LaunchDarkly/Rollout.php</ignore>
24+
<ignore>src/LaunchDarkly/Rule.php</ignore>
25+
<ignore>src/LaunchDarkly/Segment.php</ignore>
26+
<ignore>src/LaunchDarkly/SegmentRule.php</ignore>
27+
<ignore>src/LaunchDarkly/SemanticVersion.php</ignore>
28+
<ignore>src/LaunchDarkly/Target.php</ignore>
29+
<ignore>src/LaunchDarkly/UnrecoverableHTTPStatusException.php</ignore>
30+
<ignore>src/LaunchDarkly/Util.php</ignore>
31+
<ignore>src/LaunchDarkly/VariationOrRollout.php</ignore>
32+
<ignore>src/LaunchDarkly/WeightedVariation.php</ignore>
33+
</files>
34+
<transformations>
35+
<template name="clean"/>
36+
</transformations>
37+
<title>
38+
LaunchDarkly PHP SDK
39+
</title>
40+
</phpdoc>

src/LaunchDarkly/ApcLDDFeatureRequester.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
use LaunchDarkly\Impl\Integrations\RedisFeatureRequester;
66

77
/**
8-
* Deprecated feature requester from an LDD-populated Redis, with APC caching.
8+
* Deprecated integration class for reading flags from a Redis database, with APC caching.
99
*
10-
* @deprecated Per the docs (http://php.net/manual/en/intro.apc.php):
11-
* "This extension (APC) is considered unmaintained and dead".
10+
* The APC extension (http://php.net/manual/en/intro.apc.php) is no longer maintained and has been
11+
* replaced by APCu. The new Redis integration which uses APCu caching is
12+
* {@link \LaunchDarkly\Integrations\Redis::featureRequester()}.
1213
*
13-
* Install APCu and use {@link \LaunchDarkly\Integrations\Redis::featureRequester()} instead!
14-
*
15-
* @package LaunchDarkly
14+
* @deprecated use Redis::featureRequester()
1615
*/
1716
class ApcLDDFeatureRequester extends RedisFeatureRequester
1817
{

src/LaunchDarkly/ApcuLDDFeatureRequester.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
use LaunchDarkly\Impl\Integrations\RedisFeatureRequester;
77

88
/**
9-
* Feature requester from an LDD-populated redis, with APCu caching.
9+
* Deprecated integration class for reading flags from a Redis database, with APCu caching.
1010
*
1111
* Unlike APC, APCu is actively maintained and is available from php53 to php7.
1212
*
1313
* This class is deprecated. Use {@link \LaunchDarkly\Integrations\Redis::featureRequester()}
1414
* and set the `apc_expiration` option.
1515
*
1616
* @deprecated Use {@link \LaunchDarkly\Integrations\Redis::featureRequester()} and set the `apc_expiration` option.
17-
*
18-
* @package LaunchDarkly
1917
*/
2018
class ApcuLDDFeatureRequester extends RedisFeatureRequester
2119
{

src/LaunchDarkly/Clause.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
namespace LaunchDarkly;
44

5+
/**
6+
* Internal data model class that describes a clause within a feature flag rule or segment rule.
7+
*
8+
* Application code should never need to reference the data model directly.
9+
*
10+
* @ignore
11+
* @internal
12+
*/
513
class Clause
614
{
715
/** @var string */

0 commit comments

Comments
 (0)