Skip to content

Commit ddba3fb

Browse files
committed
Add PHP CS Fixer with PSR2 fixes
1 parent 41f5d77 commit ddba3fb

21 files changed

Lines changed: 36 additions & 39 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ script/*
88
/build
99
/test/reports
1010
.env
11+
/.php_cs
12+
/.php_cs.cache

.php_cs.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
return PhpCsFixer\Config::create()
3+
->setFinder(
4+
PhpCsFixer\Finder::create()
5+
->files()
6+
->in(__DIR__ . '/src')
7+
->in(__DIR__ . '/test')
8+
)
9+
->setRules([
10+
'@PSR2' => true,
11+
]);

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"require-dev": {
2525
"codeless/jugglecode": "1.0",
26+
"friendsofphp/php-cs-fixer": "^2.13",
2627
"php-coveralls/php-coveralls": "2.1",
2728
"phpunit/phpunit": "^4.8.35"
2829
},

src/Bigcommerce/Api/Client.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,56 @@ class Client
1515
*
1616
* @var string
1717
*/
18-
static private $store_url;
18+
private static $store_url;
1919

2020
/**
2121
* Username to connect to the store API with
2222
*
2323
* @var string
2424
*/
25-
static private $username;
25+
private static $username;
2626

2727
/**
2828
* API key
2929
*
3030
* @var string
3131
*/
32-
static private $api_key;
32+
private static $api_key;
3333

3434
/**
3535
* Connection instance
3636
*
3737
* @var Connection
3838
*/
39-
static private $connection;
39+
private static $connection;
4040

4141
/**
4242
* Resource class name
4343
*
4444
* @var string
4545
*/
46-
static private $resource;
46+
private static $resource;
4747

4848
/**
4949
* API path prefix to be added to store URL for requests
5050
*
5151
* @var string
5252
*/
53-
static private $path_prefix = '/api/v2';
53+
private static $path_prefix = '/api/v2';
5454

5555
/**
5656
* Full URL path to the configured store API.
5757
*
5858
* @var string
5959
*/
60-
static public $api_path;
61-
static private $client_id;
62-
static private $store_hash;
63-
static private $auth_token;
64-
static private $client_secret;
65-
static private $stores_prefix = '/stores/%s/v2';
66-
static private $api_url = 'https://api.bigcommerce.com';
67-
static private $login_url = 'https://login.bigcommerce.com';
60+
public static $api_path;
61+
private static $client_id;
62+
private static $store_hash;
63+
private static $auth_token;
64+
private static $client_secret;
65+
private static $stores_prefix = '/stores/%s/v2';
66+
private static $api_url = 'https://api.bigcommerce.com';
67+
private static $login_url = 'https://login.bigcommerce.com';
6868

6969
/**
7070
* Configure the API client with the required settings to access

src/Bigcommerce/Api/ClientError.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
class ClientError extends Error
99
{
10-
1110
public function __toString()
1211
{
1312
return "Client Error ({$this->code}): " . $this->message;

src/Bigcommerce/Api/Connection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ private function followRedirectPath()
340340
}
341341

342342
$this->get($url);
343-
344343
} else {
345344
$errorString = "Too many redirects when trying to follow location.";
346345
throw new NetworkError($errorString, CURLE_TOO_MANY_REDIRECTS);

src/Bigcommerce/Api/Resources/Address.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class Address extends Resource
99
{
10-
11-
}
10+
}

src/Bigcommerce/Api/Resources/DiscountRule.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
*/
1111
class DiscountRule extends Resource
1212
{
13-
1413
}

src/Bigcommerce/Api/Resources/OrderCoupons.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class OrderCoupons extends Resource
99
{
10-
11-
}
10+
}

src/Bigcommerce/Api/Resources/OrderProduct.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class OrderProduct extends Resource
99
{
10-
11-
}
10+
}

0 commit comments

Comments
 (0)