From 5e6144a8521d3cbc790d2444c4e543f129642ba4 Mon Sep 17 00:00:00 2001 From: Emanuele Minotto Date: Sat, 9 Jul 2016 12:50:45 +0200 Subject: [PATCH 1/5] Fixed coding style --- lib/Doctrine/KeyValueStore/Storage/ArrayStorage.php | 11 +++++------ .../Storage/WindowsAzureTableStorage.php | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/Doctrine/KeyValueStore/Storage/ArrayStorage.php b/lib/Doctrine/KeyValueStore/Storage/ArrayStorage.php index cee54b8..843fab2 100644 --- a/lib/Doctrine/KeyValueStore/Storage/ArrayStorage.php +++ b/lib/Doctrine/KeyValueStore/Storage/ArrayStorage.php @@ -20,7 +20,6 @@ namespace Doctrine\KeyValueStore\Storage; -use Doctrine\DBAL\Connection; use Doctrine\KeyValueStore\NotFoundException; /** @@ -79,7 +78,7 @@ public function insert($storageName, $key, array $data) */ public function update($storageName, $key, array $data) { - if (!isset($this->data[$storageName])) { + if (! isset($this->data[$storageName])) { $this->data[$storageName] = []; } @@ -93,11 +92,11 @@ public function update($storageName, $key, array $data) */ public function delete($storageName, $key) { - if (!isset($this->data[$storageName])) { + if (! isset($this->data[$storageName])) { return; } - if (!isset($this->data[$storageName][serialize($key)])) { + if (! isset($this->data[$storageName][serialize($key)])) { return; } @@ -113,11 +112,11 @@ public function delete($storageName, $key) */ public function find($storageName, $key) { - if (!isset($this->data[$storageName])) { + if (! isset($this->data[$storageName])) { throw new NotFoundException(); } - if (!isset($this->data[$storageName][serialize($key)])) { + if (! isset($this->data[$storageName][serialize($key)])) { throw new NotFoundException(); } diff --git a/lib/Doctrine/KeyValueStore/Storage/WindowsAzureTableStorage.php b/lib/Doctrine/KeyValueStore/Storage/WindowsAzureTableStorage.php index b0b9ae8..d43475f 100644 --- a/lib/Doctrine/KeyValueStore/Storage/WindowsAzureTableStorage.php +++ b/lib/Doctrine/KeyValueStore/Storage/WindowsAzureTableStorage.php @@ -183,7 +183,7 @@ public function createTable($tableName) $tableNode->appendChild($dom->createTextNode($tableName)); $xml = $dom->saveXML(); - $url = $this->baseUrl . '/Tables'; + $url = $this->baseUrl . '/Tables'; $response = $this->request('POST', $url, $xml, $headers); if ($response->getStatusCode() != 201) { From 16c1bc3d3d1e9ddc89f26d461a1fb21dd8d37e8c Mon Sep 17 00:00:00 2001 From: Emanuele Minotto Date: Sat, 9 Jul 2016 12:51:14 +0200 Subject: [PATCH 2/5] Use travis cache --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 597b002..a019700 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ services: - mongodb - redis-server +cache: + directories: + - $HOME/.composer/cache + php: - 5.5 - 5.6 @@ -15,7 +19,7 @@ before_install: - composer self-update install: - - composer --prefer-source install + - composer install --prefer-dist --no-interaction --no-progress script: - vendor/bin/phpunit --verbose From 22af505cacd6bbff6bf55a9b8f287698005c3670 Mon Sep 17 00:00:00 2001 From: Emanuele Minotto Date: Sat, 9 Jul 2016 12:51:30 +0200 Subject: [PATCH 3/5] Remove notifications --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index a019700..2b0ee52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,3 +23,6 @@ install: script: - vendor/bin/phpunit --verbose + +notifications: + email: false From 5ecca2e0e27d6eef33320cbfcdfed117cddcd6c3 Mon Sep 17 00:00:00 2001 From: Emanuele Minotto Date: Sat, 9 Jul 2016 12:51:59 +0200 Subject: [PATCH 4/5] Force coding style --- .travis.yml | 3 +++ composer.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2b0ee52..e99a9c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,9 @@ before_install: install: - composer install --prefer-dist --no-interaction --no-progress +before_script: + - vendor/bin/php-cs-fixer -v fix --diff --dry-run + script: - vendor/bin/phpunit --verbose diff --git a/composer.json b/composer.json index 5d7ae4c..997e3be 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ "doctrine/couchdb": "^1.0.0-beta4", "phpunit/phpunit": "^4.8|^5.0", "aws/aws-sdk-php": "^3.8", - "riak/riak-client": "dev-master" + "riak/riak-client": "dev-master", + "friendsofphp/php-cs-fixer": "^1.11" }, "suggest": { "aws/aws-sdk-php": "to use the DynamoDB storage", From 6faf4497554ac5a04be7ea9db603c564e752096a Mon Sep 17 00:00:00 2001 From: Emanuele Minotto Date: Sat, 9 Jul 2016 12:52:30 +0200 Subject: [PATCH 5/5] Include code coverage (with coveralls) --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e99a9c9..b3a40e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,13 +19,17 @@ before_install: - composer self-update install: + - composer require satooshi/php-coveralls:~0.6@stable --no-update - composer install --prefer-dist --no-interaction --no-progress before_script: - vendor/bin/php-cs-fixer -v fix --diff --dry-run script: - - vendor/bin/phpunit --verbose + - vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.clover + +after_script: + - if [[ $TRAVIS_PHP_VERSION != "5.6" && $TRAVIS_PULL_REQUEST == "false" ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi notifications: email: false