Skip to content

Commit 1dc2ac1

Browse files
author
Márk Sági-Kazár
committed
Update package files
Fix tests path Update style ci
1 parent 8e3a96e commit 1dc2ac1

12 files changed

+101
-142
lines changed

Diff for: .editorconfig

-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ indent_size = 4
77
indent_style = space
88
insert_final_newline = true
99
trim_trailing_whitespace = true
10-
11-
# we diverge from the yml 2 spaces convention of php-http in favor of the symfony code style.

Diff for: .gitattributes

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
spec/ export-ignore
2+
Tests/ export-ignore
13
.editorconfig export-ignore
24
.gitattributes export-ignore
35
.gitignore export-ignore
6+
.php_cs export-ignore
47
.scrutinizer.yml export-ignore
8+
.styleci.yml export-ignore
59
.travis.yml export-ignore
610
CONTRIBUTING.md export-ignore
7-
Tests/ export-ignore
11+
phpspec.yml.ci export-ignore
12+
phpspec.yml.dist export-ignore
13+
phpunit.xml.dist export-ignore

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
.puli/
2+
build/
13
vendor/
24
composer.lock
5+
phpspec.yml
6+
phpunit.xml

Diff for: .php_cs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
/*
4+
* In order to make it work, fabpot/php-cs-fixer and sllh/php-cs-fixer-styleci-bridge must be installed globally
5+
* with composer.
6+
*
7+
* @link https://github.com/Soullivaneuh/php-cs-fixer-styleci-bridge
8+
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer
9+
*/
10+
11+
use SLLH\StyleCIBridge\ConfigBridge;
12+
13+
return ConfigBridge::create();

Diff for: .scrutinizer.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
filter:
2-
exclude_paths: [vendor/*, Tests/*]
2+
paths: [src/*]
33
checks:
4-
php:
5-
code_rating: true
6-
duplication: true
4+
php:
5+
code_rating: true
6+
duplication: true
77
tools:
8-
external_code_coverage: true
9-
php_code_sniffer:
10-
config:
11-
standard: "PSR2"
8+
external_code_coverage: true

Diff for: .styleci.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
preset: symfony
2+
3+
finder:
4+
exclude:
5+
- "spec"
6+
- "Tests"
7+
- "Resources"
8+
path:
9+
- "./"
10+
11+
enabled:
12+
- short_array_syntax

Diff for: .travis.yml

+33-23
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,48 @@
11
language: php
22

3+
sudo: false
4+
5+
cache:
6+
directories:
7+
- $HOME/.composer/cache
8+
39
php:
4-
- 5.5
5-
- 5.6
6-
- 7.0
7-
- hhvm
10+
- 5.5
11+
- 5.6
12+
- 7.0
13+
- hhvm
814

915
env:
10-
global:
11-
- TEST_COMMAND="composer test"
12-
matrix:
13-
- SYMFONY_VERSION=3.0.*
14-
- SYMFONY_VERSION=2.8.*
15-
- SYMFONY_VERSION=2.7.*
16+
global:
17+
- TEST_COMMAND="composer test"
18+
matrix:
19+
- SYMFONY_VERSION=3.0.*
20+
- SYMFONY_VERSION=2.8.*
21+
- SYMFONY_VERSION=2.7.*
22+
23+
branches:
24+
except:
25+
- /^analysis-.*$/
1626

1727
matrix:
18-
fast_finish: true
19-
allow_failures:
20-
- php: hhvm
21-
- env: SYMFONY_VERSION=3.0.*
22-
- php: 5.5
23-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" && COVERAGE=true && TEST_COMMAND="composer test-ci" && SYMFONY_VERSION=2.7.*
28+
fast_finish: true
29+
allow_failures:
30+
- php: hhvm
31+
- env: SYMFONY_VERSION=3.0.*
32+
- php: 5.5
33+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_VERSION=2.7.*
2434

2535
before_install:
26-
- travis_retry composer self-update
27-
- wget https://github.com/puli/cli/releases/download/1.0.0-beta9/puli.phar && chmod +x puli.phar
36+
- travis_retry composer self-update
37+
- wget https://github.com/puli/cli/releases/download/1.0.0-beta9/puli.phar && chmod +x puli.phar
2838

2939
install:
30-
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
31-
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction
40+
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
41+
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction
3242

3343
script:
34-
- $TEST_COMMAND
44+
- $TEST_COMMAND
3545

3646
after_success:
37-
- if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
38-
- if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi
47+
- if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
48+
- if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi

Diff for: CONTRIBUTING

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please see http://docs.php-http.org/en/latest/development/contributing.html

Diff for: CONTRIBUTING.md

-85
This file was deleted.

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015 PHP HTTP Team <[email protected]>
1+
Copyright (c) 2015-2016 PHP HTTP Team <[email protected]>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Diff for: README.md

+21-18
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ composer require php-http/httplug-bundle
1919
```
2020

2121
Enable the bundle in your kernel:
22-
22+
2323
``` php
2424
<?php
2525
// app/AppKernel.php
@@ -37,32 +37,32 @@ public function registerBundles()
3737

3838
The usage documentation is split into two parts. First we explain how to configure the bundle in an application. The second part is for developing reusable Symfony bundles that depend on an HTTP client defined by the Httplug interface.
3939

40-
For information how to write applications with the services provided by this bundle, have a look at the [Httplug documentation](http://docs.httplug.io).
40+
For information how to write applications with the services provided by this bundle, have a look at the [Httplug documentation](http://docs.php-http.org).
41+
4142

4243
### Use in Applications
4344

4445
#### Custom services
4546

46-
4747
| Service id | Description |
4848
| ---------- | ----------- |
4949
| httplug.message_factory | Service* that provides the `Http\Message\MessageFactory`
5050
| httplug.uri_factory | Service* that provides the `Http\Message\UriFactory`
5151
| httplug.stream_factory | Service* that provides the `Http\Message\StreamFactory`
5252
| httplug.client.[name] | This is your Httpclient that you have configured. With the configuration below the name would be `acme_client`.
5353
| httplug.client | This is the first client configured or a client named `default`.
54-
| httplug.plugin.content_length <br> httplug.plugin.decoder<br> httplug.plugin.error<br> httplug.plugin.logger<br> httplug.plugin.redirect<br> httplug.plugin.retry | These are build in plugins that lives in the `php-http/plugins` package. These servcies are not public and may only be used when configure HttpClients or services.
54+
| httplug.plugin.content_length <br> httplug.plugin.decoder<br> httplug.plugin.error<br> httplug.plugin.logger<br> httplug.plugin.redirect<br> httplug.plugin.retry | These are build in plugins that lives in the `php-http/plugins` package. These servcies are not public and may only be used when configure HttpClients or services.
5555

5656
\* *These services are always an alias to another service. You can specify your own service or leave the default, which is the same name with `.default` appended. The default services in turn use the service discovery mechanism to provide the best available implementation. You can specify a class for each of the default services to use instead of discovery, as long as those classes can be instantiated without arguments.*
5757

5858
If you need a more custom setup, define the services in your application configuration and specify your service in the `main_alias` section. For example, to add authentication headers, you could define a service that decorates the service `httplug.client.default` with a plugin that injects the authentication headers into the request and configure `httplug.main_alias.client` to the name of your service.
5959

6060
```yaml
6161
httplug:
62-
clients:
62+
clients:
6363
acme_client: # This is the name of the client
6464
factory: 'httplug.factory.guzzle6'
65-
65+
6666
main_alias:
6767
client: httplug.client.default
6868
message_factory: httplug.message_factory.default
@@ -71,33 +71,34 @@ httplug:
7171
classes:
7272
# uses discovery if not specified
7373
client: ~
74-
message_factory: ~
74+
message_factory: ~
7575
uri_factory: ~
7676
stream_factory: ~
7777
```
7878
79+
7980
#### Configure your client
8081
81-
You can configure your clients with some good default options. The clients are later registered as services.
82+
You can configure your clients with some good default options. The clients are later registered as services.
8283
8384
```yaml
8485
httplug:
85-
clients:
86-
my_guzzle5:
86+
clients:
87+
my_guzzle5:
8788
factory: 'httplug.factory.guzzle5'
8889
config:
89-
# These options are given to Guzzle without validation.
90+
# These options are given to Guzzle without validation.
9091
defaults:
9192
base_uri: 'http://google.se/'
9293
verify_ssl: false
9394
timeout: 4
9495
headers:
9596
Content-Type: 'application/json'
96-
acme:
97+
acme:
9798
factory: 'httplug.factory.guzzle6'
9899
config:
99100
base_uri: 'http://google.se/'
100-
101+
101102
```
102103

103104
```php
@@ -106,21 +107,22 @@ $httpClient = $this->container->get('httplug.client.my_guzzle5');
106107
$httpClient = $this->container->get('httplug.client.acme');
107108
```
108109

110+
109111
#### Plugins
110112

111-
You can configure the clients with plugins.
113+
You can configure the clients with plugins.
112114

113115
```yaml
114116
// services.yml
115117
acme_plugin:
116-
class: Acme\Plugin\MyCustonPlugin
118+
class: Acme\Plugin\MyCustonPlugin
117119
arguments: ["%api_key%"]
118120
```
119121
```yaml
120122
// config.yml
121123
httpug:
122-
clients:
123-
acme:
124+
clients:
125+
acme:
124126
factory: 'httplug.factory.guzzle6'
125127
plugins: ['acme_plugin' , 'httplug.plugin.logger']
126128
config:
@@ -134,6 +136,7 @@ Rather than code against specific HTTP clients, you want to use the Httplug `Cli
134136

135137
The only steps they need is `require` one of the adapter implementations in their projects `composer.json` and instantiating the HttplugBundle in their kernel.
136138

139+
137140
## Testing
138141

139142
``` bash
@@ -143,7 +146,7 @@ $ composer test
143146

144147
## Contributing
145148

146-
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
149+
Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html).
147150

148151

149152
## Security

Diff for: composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
"description": "Symfony bundle to integrate the Httplug generic HTTP client into Symfony",
44
"type": "symfony-bundle",
55
"keywords": ["http", "discovery", "adapter", "message", "factory", "bundle", "httplug", "php-http"],
6-
"homepage": "http://php-http.org",
6+
"homepage": "http://httplug.io",
77
"license": "MIT",
88
"authors": [
99
{
1010
"name": "David Buchmann",
1111
"email": "[email protected]"
1212
}
1313
],
14-
"minimum-stability": "dev",
15-
"prefer-stable": true,
1614
"require": {
1715
"php": ">=5.5",
1816
"php-http/discovery": "^0.6.3",
@@ -43,5 +41,7 @@
4341
"branch-alias": {
4442
"dev-master": "1.0-dev"
4543
}
46-
}
44+
},
45+
"minimum-stability": "dev",
46+
"prefer-stable": true
4747
}

0 commit comments

Comments
 (0)