Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 98e99fa

Browse files
author
Raül Pérez
committed
Merge branch 'release/0.0.5'
2 parents 799a8bd + 9cec458 commit 98e99fa

15 files changed

Lines changed: 545 additions & 272 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ vendor
33
cover
44
*.phar
55
composer.lock
6+
build

.travis.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,25 @@ php:
33
- 5.4
44
- 5.5
55
- 5.6
6-
- hhvm
76
- nightly
8-
install:
9-
- composer update
10-
- make lint
7+
cache:
8+
directories:
9+
- vendor
10+
- $HOME/.composer/cache
11+
before_script:
12+
# - sudo apt-get install python-software-properties # 12.04
13+
# - sudo add-apt-repository -y ppa:duh/golang
14+
# - sudo apt-get update
15+
# - sudo apt-get install golang
16+
# - export GOROOT=`go env GOROOT` && export GOPATH=$HOME/go
17+
# - go get -u github.com/nats-io/gnatsd
18+
# - gnats="$GOPATH/bin/gnatsd"
19+
# - $gnats &
20+
- make deps
21+
script:
22+
- make cs
23+
- mkdir -p build/logs
24+
- make test
25+
after_script:
26+
- php vendor/bin/coveralls
27+
- php vendor/bin/coveralls -v

AUTHORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Raül Pérez <repejota@gmail.com> - http://repejota.com - @repejota
2+
Adrià Cidre <adria.cidre@gmail.com> - http://oridoki.com - @adriacidre
3+
José Gil <josgilmo@gmail.com> - @josgilmo
4+
Gorka López de Torre <glopezdetorre@gmail.com> - http://gorka.io - @glopezdetorre

Makefile

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
lint:
2-
find src -name *.php -exec php -l {} \;
3-
find tests -name *.php -exec php -l {} \;
4-
find examples -name *.php -exec php -l {} \;
1+
cs: lint
2+
./vendor/bin/phpcbf --standard=PSR2 src tests examples
3+
./vendor/bin/phpcs --standard=PSR2 --warning-severity=0 src tests examples
54

65
test:
76
./vendor/bin/phpunit
87

98
cover:
109
./vendor/bin/phpunit --coverage-html ./cover
1110

12-
cs:
13-
./phpcbf.phar src
14-
./phpcbf.phar tests
15-
./phpcbf.phar examples
16-
./vendor/bin/phpcs src tests examples
11+
lint:
12+
find src -name *.php -exec php -l {} \;
13+
find tests -name *.php -exec php -l {} \;
14+
find examples -name *.php -exec php -l {} \;
15+
16+
deps:
17+
wget -q https://getcomposer.org/composer.phar -O ./composer.phar
18+
chmod +x composer.phar
19+
php composer.phar install
20+
21+
dist-clean:
22+
rm -rf vendor
23+
rm -f composer.phar
24+
rm -f composer.lock
1725

18-
.PHONY: lint test cs cover
26+
.PHONY: lint test cs cover deps dist-clean

README.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ phpnats
66
* Master: [![Build Status](https://travis-ci.org/repejota/phpnats.png?branch=master)](https://travis-ci.org/repejota/phpnats)
77
* Develop: [![Build Status](https://travis-ci.org/repejota/phpnats.png?branch=develop)](https://travis-ci.org/repejota/phpnats)
88

9-
**Insight**
9+
**Coverage**
1010

11-
* [![SensioLabsInsight](https://insight.sensiolabs.com/projects/3fb84121-278d-489f-8394-d95c3e3b05d2/mini.png)](https://insight.sensiolabs.com/projects/3fb84121-278d-489f-8394-d95c3e3b05d2)
11+
* Master: [![Coverage Status](https://coveralls.io/repos/repejota/phpnats/badge.svg?branch=master)](https://coveralls.io/r/repejota/phpnats?branch=master)
12+
* Develop: [![Coverage Status](https://coveralls.io/repos/repejota/phpnats/badge.svg?branch=develop)](https://coveralls.io/r/repejota/phpnats?branch=develop)
1213

14+
Introduction
15+
------------
1316

1417
A PHP client for the [NATS messaging system](https://nats.io).
1518

@@ -28,7 +31,7 @@ Usage
2831
### Basic Usage
2932

3033
```php
31-
$client = new \Nats\Connection(verbose=True);
34+
$client = new \Nats\Connection();
3235
$client->connect();
3336

3437
# Simple Publisher
@@ -45,13 +48,46 @@ $client->subscribe("foo", $callback);
4548
$client->wait(1);
4649
```
4750

51+
Developer's Information
52+
-----------------------
4853

49-
Tests
50-
-----
54+
### Tests
5155

5256
Tests are in the `tests` folder.
5357
To run them, you need `PHPUnit` and execute `make test`.
5458

59+
### Code Quality
60+
61+
We are using [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer/docs)
62+
to ensure our code follow an high quality standard.
63+
64+
To perform an analysis of the code execute `make cs`.
65+
66+
67+
Creators
68+
--------
69+
70+
**Raül Pérez**
71+
72+
- <https://twitter.com/repejota>
73+
- <https://github.com/repejota>
74+
75+
**Adrià Cidre**
76+
77+
- <https://twitter.com/adriacidre>
78+
- <https://github.com/adriacidre>
79+
80+
**José Gil**
81+
82+
- <https://twitter.com/josgilmo>
83+
- <https://github.com/josgilmo>
84+
85+
**Gorka López de Torre**
86+
87+
- <https://twitter.com/glopezdetorre>
88+
- <https://github.com/glopezdetorre>
89+
90+
5591

5692
License
5793
-------

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.4
1+
0.0.5

composer.json

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,39 @@
44
"type": "library",
55
"minimum-stability": "dev",
66
"license": "MIT",
7-
"authors": [{
8-
"name": "Raül Pérez",
9-
"email": "repejota@gmail.com",
10-
"homepage": "http://repejota.com"
11-
}],
127
"require": {
138
},
149
"require-dev": {
1510
"phpunit/phpunit": "4.7.*",
16-
"phpspec/prophecy-phpunit": "^1.0@dev",
17-
"zerkalica/phpcs": "dev-master"
11+
"satooshi/php-coveralls": "dev-master",
12+
"cocur/background-process": "dev-master",
13+
"squizlabs/php_codesniffer": "~2.0"
1814
},
15+
"authors": [
16+
{
17+
"name": "Raül Pérez",
18+
"email": "repejota@gmail.com",
19+
"homepage": "http://www.repejota.com",
20+
"role": "Developer"
21+
},
22+
{
23+
"name": "Adrià Cidre",
24+
"email": "adria.cidre@gmail.com",
25+
"homepage": "http://oridoki.com",
26+
"role": "Developer"
27+
},
28+
{
29+
"name": "José Gil",
30+
"email": "josgilmo@gmail.com",
31+
"role": "Developer"
32+
},
33+
{
34+
"name": "Gorka López de Torre",
35+
"email": "glopezdetorre@gmail.com",
36+
"homepage": "http://gorka.io",
37+
"role": "Developer"
38+
}
39+
],
1940
"autoload": {
2041
"psr-4": {
2142
"Nats\\": "src"

examples/authconnect.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Connection example
4+
*
5+
* PHP version 5
6+
*
7+
* @category Script
8+
* @package Nats
9+
* @author Raül Përez <repejota@gmail.com>
10+
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
11+
* @link https://github.com/repejota/phpnats
12+
*/
13+
require_once "../vendor/autoload.php";
14+
15+
$c = new Nats\Connection();
16+
$c->connect("localhost", 4222, "foo", "bar");
17+
$c->close();

examples/connect.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
*/
1313
require_once "../vendor/autoload.php";
1414

15-
const HOST = "localhost";
16-
const PORT = 4222;
17-
18-
echo "Server: nats://" . HOST . ":" . PORT . PHP_EOL;
1915
$c = new Nats\Connection();
20-
echo "Connecting ..." . PHP_EOL;
2116
$c->connect();
22-
echo "Disconnecting ..." . PHP_EOL;
2317
$c->close();

phpunit.xml renamed to phpunit.xml.dist

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@
99
processIsolation="false"
1010
stopOnFailure="false"
1111
syntaxCheck="false">
12+
1213
<testsuites>
1314
<testsuite name="PHPNats Test Suite">
14-
<directory suffix=".php">./tests/</directory>
15+
<directory suffix=".php">./tests/Unit/</directory>
1516
</testsuite>
1617
</testsuites>
18+
<logging>
19+
<log type="coverage-clover" target="build/logs/clover.xml"/>
20+
<log type="coverage-html" target="./build/coverage" lowUpperBound="35"
21+
highLowerBound="70"/>
22+
</logging>
1723
</phpunit>

0 commit comments

Comments
 (0)