Skip to content

Commit 61c990a

Browse files
authored
Merge pull request #73 from adrianwaler/fix-72-remove-code-duplications
#72 BillingAddressTrait and ShippingAddressTrait
2 parents f2e3ed0 + cd3b20e commit 61c990a

20 files changed

+293
-455
lines changed

.scrutinizer.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
build:
2+
nodes:
3+
analysis:
4+
project_setup:
5+
override: true
6+
tests:
7+
override:
8+
- php-scrutinizer-run --enable-security-analysis
9+
filter:
10+
excluded_paths:
11+
- "tests/"
12+
dependency_paths:
13+
- "vendor/"
114
tools:
215
external_code_coverage: true

src/Client/SalesforceClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function doRequest(RequestInterface $request): array
4949
$response = $this->sendRequest($token, $request);
5050
} catch (HttpException $ex) {
5151
// Token is expired or invalid - get new and retry
52-
if ($ex->getCode() !== self::UNAUTHORIZED) {
52+
if (self::UNAUTHORIZED !== $ex->getCode()) {
5353
throw $ex;
5454
}
5555

src/Enum/AbstractOwnership.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
use Eloquent\Enumeration\AbstractEnumeration;
66

7+
/**
8+
* @method static $this OWNERSHIP_PUBLIC()
9+
* @method static $this OWNERSHIP_PRIVATE()
10+
* @method static $this OWNERSHIP_SUBSIDIARY()
11+
* @method static $this OWNERSHIP_OTHER()
12+
*/
713
abstract class AbstractOwnership extends AbstractEnumeration
814
{
915
const OWNERSHIP_PUBLIC = 'Public';

src/Enum/AbstractRating.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
use Eloquent\Enumeration\AbstractEnumeration;
66

7+
/**
8+
* @method static $this HOT()
9+
* @method static $this WARM()
10+
* @method static $this COLD()
11+
*/
712
abstract class AbstractRating extends AbstractEnumeration
813
{
914
const HOT = 'Hot';

src/Enum/AbstractSObjectType.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44

55
use Eloquent\Enumeration\AbstractEnumeration;
66

7+
/**
8+
* @method static $this LEAD()
9+
* @method static $this ACCOUNT()
10+
* @method static $this PRODUCT()
11+
* @method static $this CONTRACT()
12+
* @method static $this ORDER()
13+
* @method static $this PRICEBOOK()
14+
* @method static $this PRICEBOOK_ENTRY()
15+
* @method static $this OPPORTUNITY()
16+
* @method static $this CONTACT()
17+
* @method static $this CASE_SO()
18+
* @method static $this SOLUTION()
19+
*/
720
abstract class AbstractSObjectType extends AbstractEnumeration
821
{
922
const LEAD = 'Lead';

src/Enum/AbstractStatus.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
use Eloquent\Enumeration\AbstractEnumeration;
66

7+
/**
8+
* @method static $this DIFFERENT()
9+
* @method static $this ACKNOWLEDGED()
10+
* @method static $this NOT_FOUND()
11+
* @method static $this INACTIVE()
12+
* @method static $this PENDING()
13+
* @method static $this SELECT_MATCH()
14+
* @method static $this SKIPPED()
15+
*/
716
abstract class AbstractStatus extends AbstractEnumeration
817
{
918
const DIFFERENT = 'Different';

src/Enum/AbstractType.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
use Eloquent\Enumeration\AbstractEnumeration;
66

7+
/**
8+
* @method static $this PROSPECT()
9+
* @method static $this CUSTOMER_DIRECT()
10+
* @method static $this CUSTOMER_CHANNEL()
11+
* @method static $this CHANNEL_PARTNER_OR_RESELLER()
12+
* @method static $this INSTALLATION_PARTNER()
13+
* @method static $this TECHNOLOGY_PARTNER()
14+
* @method static $this OTHER()
15+
*/
716
abstract class AbstractType extends AbstractEnumeration
817
{
918
const PROSPECT = 'Prospect';

src/Enum/ContentType.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
use Eloquent\Enumeration\AbstractEnumeration;
66

7+
/**
8+
* @method static $this JSON()
9+
* @method static $this FORM()
10+
*/
711
class ContentType extends AbstractEnumeration
812
{
913
const JSON = 'application/json';

src/Enum/RequestMethod.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
use Eloquent\Enumeration\AbstractEnumeration;
66

7+
/**
8+
* @method static $this GET()
9+
* @method static $this POST()
10+
* @method static $this PATCH()
11+
* @method static $this DELETE()
12+
*/
713
class RequestMethod extends AbstractEnumeration
814
{
915
const GET = 'GET';

src/Model/AbstractSObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getSystemModstamp()
9393
return $this->systemModstamp;
9494
}
9595

96-
public function setId(string $id): AbstractSObject
96+
public function setId(string $id): self
9797
{
9898
$this->id = $id;
9999

0 commit comments

Comments
 (0)