Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Force Coding Style #82

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ services:
- mongodb
- redis-server

cache:
directories:
- $HOME/.composer/cache

php:
- 5.5
- 5.6
Expand All @@ -15,7 +19,17 @@ before_install:
- composer self-update

install:
- composer --prefer-source 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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 5 additions & 6 deletions lib/Doctrine/KeyValueStore/Storage/ArrayStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

namespace Doctrine\KeyValueStore\Storage;

use Doctrine\DBAL\Connection;
use Doctrine\KeyValueStore\NotFoundException;

/**
Expand Down Expand Up @@ -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] = [];
}

Expand All @@ -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;
}

Expand All @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down