diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..33ba9dc --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,28 @@ +| Q | A +| ----------------------- | --- +| Bug? | no|yes +| New Feature? | no|yes +| Are you using composer? | no|yes +| Version | Specific version or SHA of a commit + + +#### Actual Behavior + +What is the actual behavior? + + +#### Expected Behavior + +What is the behavior you expect? + + +#### Steps to Reproduce + +What are the steps to reproduce this bug? Please add code examples, +screenshots or links to GitHub repositories that reproduce the problem. + + +#### Possible Solutions + +If you have already ideas how to solve the issue, add them here. +(remove this section if not needed) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..923b9d4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,42 @@ +| Q | A +| --------------- | --- +| Bug fix? | no|yes +| New feature? | no|yes +| BC breaks? | no|yes +| Deprecations? | no|yes +| Related tickets | fixes #X, partially #Y, mentioned in #Z +| License | MIT + + +#### What's in this PR? + +Explain what the changes in this PR do. + + +#### Why? + +Which problem does the PR fix? (remove this section if you linked an issue above) + + +#### Example Usage + +``` php +// If you added new features, show examples of how to use them here +// (remove this section if not a new feature) + +$foo = new Foo(); + +// Now we can do +$foo->doSomething(); +``` + + +#### Checklist + +- [ ] Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix +- [ ] Documentation pull request created (if not simply a bugfix) + + +#### To Do + +- [ ] If the PR is not complete but you want to discuss the approach, list what remains to be done here diff --git a/.gitignore b/.gitignore index 49a1ceb..5854ebc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -phpunit.xml +/build/ composer.lock -vendor index.php +phpunit.xml +/vendor/ diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..46a7560 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,8 @@ +filter: + paths: [src/*] +checks: + php: + code_rating: true + duplication: true +tools: + external_code_coverage: true diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 0000000..515f14c --- /dev/null +++ b/.styleci.yml @@ -0,0 +1,12 @@ +preset: symfony + +finder: + paths: + - "src" + - "tests" + +enabled: + - short_array_syntax + +disabled: + - phpdoc_annotation_without_dot diff --git a/.travis.yml b/.travis.yml index a76064b..607e5bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,35 @@ language: php sudo: false +cache: + directories: + - $HOME/.composer/cache/files + php: - 5.5 - 5.6 - 7.0 - hhvm +env: + global: + - TEST_COMMAND="composer test" + +matrix: + fast_finish: true + include: + - php: 5.5 + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" + before_install: - composer self-update install: - - composer require satooshi/php-coveralls:~0.6@stable - -before_script: - - mkdir -p build/logs + - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction script: - - phpunit --coverage-clover build/logs/clover.xml + - $TEST_COMMAND after_success: - - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;' + - if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi + - if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi diff --git a/Readme.md b/Readme.md index 51bda51..b3b0297 100644 --- a/Readme.md +++ b/Readme.md @@ -1,10 +1,13 @@ # LinkedIn API client in PHP -[![Build Status](https://travis-ci.org/Happyr/LinkedIn-API-client.svg?branch=master)](https://travis-ci.org/Happyr/LinkedIn-API-client) -[![Coverage Status](https://img.shields.io/coveralls/Happyr/LinkedIn-API-client.svg)](https://coveralls.io/r/Happyr/LinkedIn-API-client?branch=master) +[![Latest Version](https://img.shields.io/github/release/Happyr/LinkedIn-API-client.svg?style=flat-square)](https://github.com/Happyr/LinkedIn-API-client/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://img.shields.io/travis/Happyr/LinkedIn-API-client.svg?style=flat-square)](https://travis-ci.org/Happyr/LinkedIn-API-client) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/44c425af-90f6-4c25-b789-4ece28b01a2b/mini.png)](https://insight.sensiolabs.com/projects/44c425af-90f6-4c25-b789-4ece28b01a2b) -[![Latest Stable Version](https://poser.pugx.org/happyr/linkedin-api-client/v/stable.svg)](https://packagist.org/packages/happyr/linkedin-api-client) -[![Monthly Downloads](https://poser.pugx.org/happyr/linkedin-api-client/d/monthly.png)](https://packagist.org/packages/happyr/linkedin-api-client) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Happyr/LinkedIn-API-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/Happyr/LinkedIn-API-client) +[![Quality Score](https://img.shields.io/scrutinizer/g/Happyr/LinkedIn-API-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/Happyr/LinkedIn-API-client) +[![Total Downloads](https://img.shields.io/packagist/dt/happyr/linkedin-api-client.svg?style=flat-square)](https://packagist.org/packages/happyr/linkedin-api-client) + A PHP library to handle authentication and communication with LinkedIn API. The library/SDK helps you to get an access token and when authenticated it helps you to send API requests. You will not get *everything* for free though... You diff --git a/Upgrade.md b/Upgrade.md index 0798615..ac2a382 100644 --- a/Upgrade.md +++ b/Upgrade.md @@ -2,7 +2,12 @@ This document explains how you upgrade from one version to another. -## Upgrade from 0.7.1 to dev-master +## Upgrade from 0.7.1 to 0.7.2 + +### Changes + +* Using `php-http/discovery:1.0` +* Code style changes. ## Upgrade from 0.7.0 to 0.7.1 diff --git a/composer.json b/composer.json index 3ab668a..afd53ee 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "php-http/discovery": "^1.0" }, "require-dev": { + "phpunit/phpunit": "^4.5", "php-http/guzzle5-adapter": "^1.0", "guzzlehttp/psr7": "^1.2", "mockery/mockery": "^0.9", @@ -28,6 +29,10 @@ "autoload": { "psr-4": { "Happyr\\LinkedIn\\": "src/" } }, + "scripts": { + "test": "vendor/bin/phpunit", + "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" + }, "extra": { "branch-alias": { "dev-master": "0.8.x-dev" diff --git a/src/Authenticator.php b/src/Authenticator.php index 2a187d2..c7c9a88 100644 --- a/src/Authenticator.php +++ b/src/Authenticator.php @@ -39,7 +39,7 @@ class Authenticator implements AuthenticatorInterface private $storage; /** - * @var RequestManager + * @var RequestManagerInterface */ private $requestManager; diff --git a/src/Http/ResponseConverter.php b/src/Http/ResponseConverter.php index 475ded5..337cb11 100644 --- a/src/Http/ResponseConverter.php +++ b/src/Http/ResponseConverter.php @@ -12,7 +12,7 @@ class ResponseConverter * Convert a PSR-7 response to a data type you want to work with. * * @param ResponseInterface $response - * @param string $format + * @param string $requestFormat * @param string $dataType * * @return ResponseInterface|\Psr\Http\Message\StreamInterface|\SimpleXMLElement|string