Skip to content

Commit

Permalink
CS fixes and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
oojacoboo committed Sep 15, 2020
1 parent 0c24cef commit e1d75fd
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 56 deletions.
8 changes: 5 additions & 3 deletions src/Client/SubResource/AddressSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

namespace Rentpost\ForteApi\Client\SubResource;

use Rentpost\ForteApi\Model;
use Rentpost\ForteApi\Attribute;

/**
* Addresses
*
* Not implemented - pull requests welcome
*/
class AddressSubResource extends AbstractSubResource
{
}
8 changes: 5 additions & 3 deletions src/Client/SubResource/CustomerSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

namespace Rentpost\ForteApi\Client\SubResource;

use Rentpost\ForteApi\Model;
use Rentpost\ForteApi\Attribute;

/**
* Customers
*
* Not implemented - pull requests welcome
*/
class CustomerSubResource extends AbstractSubResource
{
}
8 changes: 3 additions & 5 deletions src/Client/SubResource/DisputeSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Rentpost\ForteApi\Attribute;
use Rentpost\ForteApi\Filter\DisputeFilter;
use Rentpost\ForteApi\Model;
use Rentpost\ForteApi\UriBuilder\PaginationData;
use Rentpost\ForteApi\UriBuilder\UriBuilder;

/**
Expand All @@ -21,7 +22,6 @@ class DisputeSubResource extends AbstractSubResource
* Finds a dispute
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\DisputeId $disputeId
*/
public function findOne(
Attribute\Id\OrganizationId $organizationId,
Expand All @@ -41,8 +41,6 @@ public function findOne(
* Finds a collection of disputes
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param DisputeFilter|null $filter
* @param PaginationData|null $pagination
*/
public function find(
Attribute\Id\OrganizationId $organizationId,
Expand All @@ -52,9 +50,9 @@ public function find(
{
$uri = UriBuilder::build(
'organizations/%s/disputes/',
[ $organizationId->getValue() ],
[$organizationId->getValue()],
$filter,
$pagination
$pagination,
);

return $this->getHttpClient()->makeModelRequest('get', $uri, Model\DisputeCollection::class);
Expand Down
7 changes: 0 additions & 7 deletions src/Client/SubResource/DocumentSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class DocumentSubResource extends AbstractSubResource
* @note we use the reseller org id here since only resellers need to add documents
*
* @see https://www.forte.net/devdocs/api_resources/forte_api_v3.htm#documents
*
* @param Model\Document $document
* @param Model\Attachment $attachment
*/
public function create(Model\Document $document, Model\Attachment $attachment): Model\Document
{
Expand All @@ -39,10 +36,6 @@ public function create(Model\Document $document, Model\Attachment $attachment):
* Finds a document
*
* @note we use the reseller org id here since only resellers use documents
*
* @param Attribute\Id\DocumentId $documentId
*
* @throws \Rentpost\ForteApi\Exception\LibraryFaultException
*/
public function findOne(Attribute\Id\DocumentId $documentId): Model\Document
{
Expand Down
7 changes: 3 additions & 4 deletions src/Client/SubResource/FundingSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Rentpost\ForteApi\Attribute;
use Rentpost\ForteApi\Filter\FundingFilter;
use Rentpost\ForteApi\Model;
use Rentpost\ForteApi\UriBuilder\PaginationData;
use Rentpost\ForteApi\UriBuilder\UriBuilder;


Expand All @@ -22,7 +23,6 @@ class FundingSubResource extends AbstractSubResource
* Finds a funding
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\FundingId $fundingId
*/
public function findOne(
Attribute\Id\OrganizationId $organizationId,
Expand All @@ -43,7 +43,6 @@ public function findOne(
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param FundingFilter $filter Filter required for this method
* @param PaginationData|null $pagination
*/
public function find(
Attribute\Id\OrganizationId $organizationId,
Expand All @@ -53,9 +52,9 @@ public function find(
{
$uri = UriBuilder::build(
'organizations/%s/fundings',
[ $organizationId->getValue() ],
[$organizationId->getValue()],
$filter,
$pagination
$pagination,
);

return $this->getHttpClient()->makeModelRequest('get', $uri, Model\FundingCollection::class);
Expand Down
4 changes: 2 additions & 2 deletions src/Client/SubResource/LocationSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Rentpost\ForteApi\Attribute;
use Rentpost\ForteApi\Filter\FundingFilter;
use Rentpost\ForteApi\Model;
use Rentpost\ForteApi\UriBuilder\UriBuilder;
use Rentpost\ForteApi\Model\Location;
use Rentpost\ForteApi\UriBuilder\PaginationData;
use Rentpost\ForteApi\UriBuilder\UriBuilder;

/**
* LocationSubResource
Expand All @@ -22,7 +23,6 @@ class LocationSubResource extends AbstractSubResource
* Finds a funding
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\LocationId $locationId
*/
public function findOne(
Attribute\Id\OrganizationId $organizationId,
Expand Down
8 changes: 5 additions & 3 deletions src/Client/SubResource/PayMethodSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

namespace Rentpost\ForteApi\Client\SubResource;

use Rentpost\ForteApi\Model;
use Rentpost\ForteApi\Attribute;

/**
* PayMethods
*
* Not implemented - pull requests welcome
*/
class PayMethodSubResource extends AbstractSubResource
{
}
8 changes: 5 additions & 3 deletions src/Client/SubResource/ScheduleItemSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

namespace Rentpost\ForteApi\Client\SubResource;

use Rentpost\ForteApi\Model;
use Rentpost\ForteApi\Attribute;

/**
* ScheduleItems
*
* Not implemented - pull requests welcome
*/
class ScheduleItemSubResource extends AbstractSubResource
{
}
8 changes: 5 additions & 3 deletions src/Client/SubResource/ScheduleSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

namespace Rentpost\ForteApi\Client\SubResource;

use Rentpost\ForteApi\Model;
use Rentpost\ForteApi\Attribute;

/**
* Schedlues
*
* Not implemented - Pull requests welcome
*/
class ScheduleSubResource extends AbstractSubResource
{
}
1 change: 0 additions & 1 deletion src/Client/SubResource/SettlementSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class SettlementSubResource extends AbstractSubResource
* Find for the organization which is authenticated
*
* @param SettlementFilter $filter Unlike most other find() methods, this one requires filter
* @param PaginationData|null $pagination
*/
public function findForEntireOrganization(
SettlementFilter $filter,
Expand Down
25 changes: 3 additions & 22 deletions src/Client/SubResource/TransactionSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class TransactionSubResource extends AbstractSubResource
* Creates a new transaction
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\LocationId $locationId
* @param Model\Transaction $transaction
*/
public function create(
Attribute\Id\OrganizationId $organizationId,
Expand All @@ -50,8 +48,6 @@ public function create(
* Finds a single transaction
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\LocationId $locationId
* @param Attribute\Id\TransactionId $transactionId
*/
public function findOne(
Attribute\Id\OrganizationId $organizationId,
Expand All @@ -74,8 +70,6 @@ public function findOne(
* seconds to become available. This will wait and retry a few times until it becomes available
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\LocationId $locationId
* @param Attribute\Id\TransactionId $transactionId
*/
public function findOneWait(
Attribute\Id\OrganizationId $organizationId,
Expand Down Expand Up @@ -129,9 +123,6 @@ public function findOneWait(
* Finds all transactions
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\LocationId $locationId
* @param TransactionFilter $filter
* @param PaginationData|null $pagination
*/
public function find(
Attribute\Id\OrganizationId $organizationId,
Expand All @@ -147,7 +138,7 @@ public function find(
$locationId->getValue(),
],
$filter,
$pagination
$pagination,
);

return $this->getHttpClient()->makeModelRequest('get', $uri, Model\TransactionCollection::class);
Expand All @@ -160,9 +151,6 @@ public function find(
* relating to the authenticated Organization.
*
* @param TransactionFilter $filter Unlike most other find() methods, this one requires filter
* @param PaginationData|null $pagination
*
* @return Model\TransactionCollection
*/
public function findForEntireOrganization(
TransactionFilter $filter,
Expand All @@ -177,11 +165,8 @@ public function findForEntireOrganization(

/**
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\LocationId $locationId
* @param Model\Transaction $transactionBeenVoided Note, only the transactionId and
* authorizationCode need to be set for voiding
*
* @return Model\Transaction
*/
public function void(
Attribute\Id\OrganizationId $organizationId,
Expand Down Expand Up @@ -226,10 +211,6 @@ public function void(
* then make another call to void.
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
* @param Attribute\Id\LocationId $locationId
* @param Attribute\Id\TransactionId $transactionIdBeenVoided
*
* @return Model\Transaction
*/
public function voidFromTransactionId(
Attribute\Id\OrganizationId $organizationId,
Expand All @@ -240,13 +221,13 @@ public function voidFromTransactionId(
$transaction = $this->findOne(
$organizationId,
$locationId,
$transactionIdBeenVoided
$transactionIdBeenVoided,
);

return $this->void(
$organizationId,
$locationId,
$transaction
$transaction,
);
}
}

0 comments on commit e1d75fd

Please sign in to comment.