Skip to content

Commit 7d43527

Browse files
Add scrutinizer, update readme, add contributing document, and update composer.json
1 parent 8050513 commit 7d43527

File tree

7 files changed

+105
-17
lines changed

7 files changed

+105
-17
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
/.gitattributes export-ignore
33
/.gitignore export-ignore
44
/.travis.yml export-ignore
5+
/.scrutinizer.yml export-ignore
56
/Makefile export-ignore
67
/NOTE.DEVELOPMENT.NOV.2011.md export-ignore
78
/NOTE.THENETCIRCLE.md export-ignore
89
/README.md export-ignore
910
/benchmark export-ignore
10-
/bin/ci export-ignore
1111
/demo export-ignore
1212
/doc export-ignore
1313
/phpunit.xml export-ignore

.scrutinizer.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
filter:
2+
paths: [PhpAmqpLib/*]
3+
excluded_paths: [tests/*, demo/*, benchmark/*, spec/*]
4+
5+
checks:
6+
php:
7+
remove_extra_empty_lines: true
8+
remove_php_closing_tag: true
9+
remove_trailing_whitespace: true
10+
fix_use_statements:
11+
remove_unused: true
12+
preserve_multiple: false
13+
preserve_blanklines: true
14+
order_alphabetically: true
15+
fix_php_opening_tag: true
16+
fix_linefeed: true
17+
fix_line_ending: true
18+
fix_identation_4spaces: true
19+
fix_doc_comments: true
20+
21+
tools:
22+
external_code_coverage:
23+
timeout: 600
24+
runs: 3

.travis.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,28 @@ php:
88
- 7.0
99
- hhvm
1010
- hhvm-nightly
11-
11+
1212
matrix:
1313
fast_finish: true
1414
allow_failures:
1515
- php: 7.0
1616
- php: hhvm-nightly
17+
include:
18+
- php: 5.3
19+
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
1720

1821
before_script:
19-
- composer install --dev --prefer-source
20-
- ./bin/ci/before_build.sh
22+
- travis_retry composer self-update
23+
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
24+
- sudo rabbitmqctl add_vhost "phpamqplib_testbed"
25+
- sudo rabbitmqctl add_user phpamqplib phpamqplib_password
26+
- sudo rabbitmqctl set_permissions -p "phpamqplib_testbed" phpamqplib ".*" ".*" ".*"
27+
28+
script:
29+
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
2130

22-
script: make test
31+
after_script:
32+
- if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi
2333

2434
services:
2535
rabbitmq

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
We accept contributions via Pull Requests on [Github](https://github.com/videlalvaro/php-amqplib).
6+
7+
8+
## Pull Requests
9+
10+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
11+
12+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
13+
14+
- **Document any change in behaviour** - Make sure the README and any other relevant documentation are kept up-to-date.
15+
16+
- **Consider our release cycle** - We try to follow semver. Randomly breaking public APIs is not an option.
17+
18+
- **Create topic branches** - Don't ask us to pull from your master branch.
19+
20+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
21+
22+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
23+
24+
25+
## Running Tests
26+
27+
``` bash
28+
$ phpunit
29+
```
30+
31+
32+
**Happy coding**!

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# php-amqplib #
22

3-
[![Build Status](https://secure.travis-ci.org/videlalvaro/php-amqplib.png)](http://travis-ci.org/videlalvaro/php-amqplib)
3+
[![Latest Version on Packagist][ico-version]][link-packagist]
4+
[![Software License][ico-license]](LICENSE)
5+
[![Build Status][ico-travis]][link-travis]
6+
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
7+
[![Quality Score][ico-code-quality]][link-code-quality]
8+
[![Total Downloads][ico-downloads]][link-downloads]
49

510
This library is a _pure PHP_ implementation of the AMQP protocol. It's been tested against [RabbitMQ](http://www.rabbitmq.com/).
611

@@ -86,6 +91,10 @@ If you need to listen to the sockets used to connect to RabbitMQ then see the ex
8691
$ php amqp_consumer_non_blocking.php
8792
```
8893

94+
## Change log
95+
96+
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
97+
8998
## Tutorials ##
9099

91100
To not repeat ourselves, if you want to learn more about this library,
@@ -144,11 +153,11 @@ $ch->basic_publish($msg, $exchange);
144153
AMQP imposes no limit on the size of messages; if a very large message is received by a consumer, PHP's memory limit may be reached
145154
within the library before the callback passed to `basic_consume` is called.
146155

147-
To avoid this, you can call the method `setBodySizeLimit(int $bytes)` on your Channel object. Body sizes exceeding this will be truncated,
156+
To avoid this, you can call the method `setBodySizeLimit(int $bytes)` on your Channel object. Body sizes exceeding this will be truncated,
148157
and delivered to your callback with a `$msg->is_truncated` flag set. The property `$msg->body_size` will reflect the true body size of
149158
a received message, which will be higher than `strlen($msg->body)` if the message has been truncated.
150159

151-
Note that all data above the limit is read from the AMQP Channel and immediately discarded, so there is no way to retrieve it within your
160+
Note that all data above the limit is read from the AMQP Channel and immediately discarded, so there is no way to retrieve it within your
152161
callback. If you have another consumer which can handle messages with larger payloads, you can use `basic_reject` or `basic_nack` to tell
153162
the server (which still has a complete copy) to forward it to a Dead Letter Exchange.
154163

@@ -232,6 +241,10 @@ Once your environment is set up you can run your tests like this:
232241
$ make test
233242
```
234243

244+
## Contributing
245+
246+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
247+
235248
## Using AMQP 0.8 ##
236249

237250
If you still want to use the old version of the protocol then you can do it by settings the following constant in your configuration code:
@@ -268,3 +281,18 @@ For bug reports, please use bug tracking system at the project page.
268281
Patches are very welcome!
269282

270283
Author: Vadim Zaliva <[email protected]>
284+
285+
[ico-version]: https://img.shields.io/packagist/v/videlalvaro/php-amqplib.svg?style=flat-square
286+
[ico-license]: https://img.shields.io/badge/license-LGPL-brightgreen.svg?style=flat-square
287+
[ico-travis]: https://img.shields.io/travis/videlalvaro/php-amqplib/master.svg?style=flat-square
288+
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/videlalvaro/php-amqplib.svg?style=flat-square
289+
[ico-code-quality]: https://img.shields.io/scrutinizer/g/videlalvaro/php-amqplib.svg?style=flat-square
290+
[ico-downloads]: https://img.shields.io/packagist/dt/videlalvaro/php-amqplib.svg?style=flat-square
291+
292+
[link-packagist]: https://packagist.org/packages/videlalvaro/php-amqplib
293+
[link-travis]: https://travis-ci.org/videlalvaro/php-amqplib
294+
[link-scrutinizer]: https://scrutinizer-ci.com/g/videlalvaro/php-amqplib/code-structure
295+
[link-code-quality]: https://scrutinizer-ci.com/g/videlalvaro/php-amqplib
296+
[link-downloads]: https://packagist.org/packages/videlalvaro/php-amqplib
297+
[link-author]: https://github.com/videlalvaro
298+
[link-contributors]: ../../contributors

bin/ci/before_build.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"ext-mbstring": "*"
1616
},
1717
"require-dev": {
18-
"phpunit/phpunit": "3.7.*"
18+
"phpunit/phpunit": "^3.7",
19+
"scrutinizer/ocular": "^1.1"
1920
},
2021
"suggest": {
2122
"ext-sockets": "Use AMQPSocketConnection"
@@ -34,7 +35,7 @@
3435
"license": "LGPL-2.1",
3536
"extra": {
3637
"branch-alias": {
37-
"dev-master": "2.4-dev"
38+
"dev-master": "2.7-dev"
3839
}
3940
}
4041
}

0 commit comments

Comments
 (0)