Skip to content

Commit 47037c1

Browse files
committed
Travis: build phpdoc and cleanup travis.yml
1 parent d1ef51f commit 47037c1

File tree

4 files changed

+73
-27
lines changed

4 files changed

+73
-27
lines changed

.travis.yml

Lines changed: 65 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,76 @@
11
sudo: false
22
language: php
33

4-
php:
5-
- 5.3.3
6-
- 5.3
7-
- 5.4
8-
- 5.5
9-
- 5.6
10-
- 7.0
11-
- nightly
12-
- hhvm
4+
cache:
5+
directories:
6+
- $HOME/.composer/cache
7+
- $HOME/.local
8+
- $HOME/ocular.phar
9+
- $HOME/phpDocumentor.phar
1310

14-
install:
15-
- if [ "$TRAVIS_PHP_VERSION" = "5.3.3" ]; then composer config -g disable-tls true; composer config -g secure-http false; fi
16-
- composer install -n
11+
env:
12+
global:
13+
- CODE_COVERAGE="0"
14+
- PHPDOC="0"
15+
16+
matrix:
17+
fast_finish: true
18+
include:
19+
- php: 5.3.3
20+
- php: 5.3
21+
- php: 5.4
22+
env:
23+
- CODE_COVERAGE="1"
24+
- php: 5.5
25+
- php: 5.6
26+
env:
27+
- PHPDOC="1"
28+
- php: 7.0
29+
env:
30+
- CODE_COVERAGE="1"
31+
- php: nightly
32+
- php: hhvm
33+
allow_failures:
34+
- php: nightly
1735

18-
before_script:
19-
- CODE_COVERAGE=`echo $TRAVIS_PHP_VERSION | grep -v "hhvm" | wc -l`
36+
install:
37+
- if [ "${CODE_COVERAGE}" == "0" ]; then
38+
phpenv config-rm xdebug.ini || return 0;
39+
fi
40+
- if [ "${CODE_COVERAGE}" == "1" ]; then
41+
wget -q -N -t 3 --retry-connrefused 'https://scrutinizer-ci.com/ocular.phar' || return 0;
42+
fi
43+
- if [ "${PHPDOC}" == "1" ]; then
44+
wget -q -N -t 3 --retry-connrefused 'https://github.com/phpDocumentor/phpDocumentor2/releases/download/v2.9.0/phpDocumentor.phar' || return 0;
45+
composer require --no-update --dev "evert/phpdoc-md:~0.2.0" || return 0;
46+
fi
47+
- if [ "${TRAVIS_PHP_VERSION}" == "5.3.3" ]; then
48+
composer config -g disable-tls true &&
49+
composer config -g secure-http false;
50+
fi
51+
- composer install -n
2052

2153
script:
22-
- if [ "$CODE_COVERAGE" = "1" ]; then php vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.clover; else php vendor/bin/phpunit --verbose; fi
54+
- if [ "$CODE_COVERAGE" == "1" ]; then
55+
php vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.clover;
56+
else
57+
php vendor/bin/phpunit --verbose;
58+
fi
2359

2460
after_script:
25-
- if [ "$CODE_COVERAGE" = "1" ]; then wget "https://scrutinizer-ci.com/ocular.phar"; fi
26-
- if [ "$CODE_COVERAGE" = "1" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
27-
28-
matrix:
29-
fast_finish: true
30-
allow_failures:
31-
- php: nightly
61+
- if [ "${CODE_COVERAGE}" == "1" ]; then
62+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover;
63+
fi
64+
- if [ "${PHPDOC}" == "1" ]; then
65+
git clone "https://${CI_USER_TOKEN}@github.com/marc-mabe/php-enum.wiki.git" &&
66+
php phpDocumentor.phar -d src -t docs/ --template="xml" &&
67+
php vendor/bin/phpdocmd --lt '%c' --index 'Home.md' docs/structure.xml php-enum.wiki/ &&
68+
cp php-enum.wiki/Home.md php-enum.wiki/_Sidebar.md &&
69+
cd php-enum.wiki/ &&
70+
git add . &&
71+
git commit -m "auto generated PHP doc" &&
72+
git push origin master:master;
73+
fi
3274

3375
notifications:
34-
email: false
76+
email: false

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ It's an abstract class that needs to be extended to use it.
2626

2727
# Usage
2828

29+
## PHPDoc
30+
31+
You can find auto-generated PHP documentation in the [wiki](https://github.com/marc-mabe/php-enum/wiki).
32+
2933
## Basics
3034

3135
```php
@@ -72,7 +76,7 @@ It's an abstract class that needs to be extended to use it.
7276

7377
## Type-Hint
7478

75-
```php
79+
```php
7680
use MabeEnum\Enum;
7781

7882
class User
@@ -163,7 +167,7 @@ Internally the ```EnumMap``` is based of ```SplObjectStorage```.
163167

164168
An ```EnumSet``` groups enumerators of the same enumeration type together.
165169

166-
Internally it's based on a bit set of a binary string.
170+
Internally it's based on a bitset of a binary string.
167171

168172
Enumerators will be ordered by the ordinal number.
169173

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"extra": {
3939
"branch-alias": {
40-
"dev-master": "2.2-dev",
40+
"dev-master": "2.3-dev",
4141
"dev-1.x": "1.3-dev"
4242
}
4343
}

src/EnumSet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use InvalidArgumentException;
88

99
/**
10-
* EnumSet implementation in base of an integer bit set
10+
* This EnumSet is based on a bitset of a binary string.
1111
*
1212
* @link http://github.com/marc-mabe/php-enum for the canonical source repository
1313
* @copyright Copyright (c) 2015 Marc Bennewitz

0 commit comments

Comments
 (0)