Skip to content

Commit

Permalink
Add php-cs-fixer as composer script and make initial fix-style run
Browse files Browse the repository at this point in the history
* Add php-cs-fixer as composer script
* Make initial fix-style run
* Fix indentation on all files
* Add editorconfig file
  • Loading branch information
jasonrhodes authored and richleland committed May 4, 2016
1 parent d96d825 commit d4c3a89
Show file tree
Hide file tree
Showing 30 changed files with 2,100 additions and 1,673 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -50,14 +50,15 @@ Follow the instructions at [xdebug.org](http://xdebug.org/wizard.php)

- Provide documentation for any newly added code.
- Provide tests for any newly added code.
- Follow [PSR-1](http://www.php-fig.org/psr/psr-1/)
- Follow [PSR-2](http://www.php-fig.org/psr/psr-2/) (_will be auto-enforced by php-cs-fixer in a later step_)

1. Create a new branch named after the issue you’ll be fixing (include the issue number as the branch name, example: Issue in GH is #8 then the branch name should be ISSUE-8)
2. Write corresponding tests and code (only what is needed to satisfy the issue and tests please)
1. Write corresponding tests and code (only what is needed to satisfy the issue and tests please)
* Include your tests in the 'test' directory in an appropriate test file
* Write code to satisfy the tests
3. Ensure automated tests pass
4. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to [AUTHORS](https://github.com/SparkPost/php-sparkpost/blob/master/AUTHORS.md).
1. Ensure automated tests pass
1. Run `composer run-script fix-style` to enforce PSR-2 style
1. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to [AUTHORS](https://github.com/SparkPost/php-sparkpost/blob/master/AUTHORS.md).


### Testing
Expand Down
62 changes: 32 additions & 30 deletions composer.json
@@ -1,33 +1,35 @@
{
"name": "sparkpost/php-sparkpost",
"description": "Client library for interfacing with the SparkPost API.",
"license": "Apache 2.0",
"authors": [
{
"name": "SparkPost"
}
],
"minimum-stability": "stable",
"scripts": {
"post-install-cmd": "if [ ! -f 'examples/example-config.json' ]; then echo '{\n\t\"api-key\":\"Your API Key\"\n}' >> examples/example-config.json; fi",
"post-update-cmd": "if [ ! -f 'examples/example-config.json' ]; then echo '{\n\t\"api-key\":\"Your API Key\"\n}' >> examples/example-config.json; fi",
"test": "phpunit ./test/unit/"
},
"require": {
"php": ">=5.5.0",
"egeloen/http-adapter": "*"
},
"require-dev": {
"phpunit/phpunit": "4.3.*",
"guzzlehttp/guzzle": "6.*",
"mockery/mockery": "^0.9.4",
"satooshi/php-coveralls": "dev-master"
},
"autoload": {
"psr-4": {
"SparkPost\\": "lib/SparkPost/",
"SparkPost\\SendGridCompatibility\\": "lib/SendGridCompatibility/",
"SparkPost\\Test\\TestUtils\\": "test/unit/TestUtils/"
}
"name": "sparkpost/php-sparkpost",
"description": "Client library for interfacing with the SparkPost API.",
"license": "Apache 2.0",
"authors": [
{
"name": "SparkPost"
}
],
"minimum-stability": "stable",
"scripts": {
"post-install-cmd": "if [ ! -f 'examples/example-config.json' ]; then echo '{\n\t\"api-key\":\"Your API Key\"\n}' >> examples/example-config.json; fi",
"post-update-cmd": "if [ ! -f 'examples/example-config.json' ]; then echo '{\n\t\"api-key\":\"Your API Key\"\n}' >> examples/example-config.json; fi",
"test": "phpunit ./test/unit/",
"fix-style": "php-cs-fixer fix ."
},
"require": {
"php": ">=5.5.0",
"egeloen/http-adapter": "*"
},
"require-dev": {
"phpunit/phpunit": "4.3.*",
"guzzlehttp/guzzle": "6.*",
"mockery/mockery": "^0.9.4",
"satooshi/php-coveralls": "dev-master",
"fabpot/php-cs-fixer": "^1.11"
},
"autoload": {
"psr-4": {
"SparkPost\\": "lib/SparkPost/",
"SparkPost\\SendGridCompatibility\\": "lib/SendGridCompatibility/",
"SparkPost\\Test\\TestUtils\\": "test/unit/TestUtils/"
}
}
}

0 comments on commit d4c3a89

Please sign in to comment.