Skip to content

Commit 85cd1fd

Browse files
authored
Merge pull request #27 from ionutcalara/master
Refactored to replace the resource soft reserved word
2 parents 1da4f6e + bb0811b commit 85cd1fd

15 files changed

Lines changed: 35 additions & 35 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "paylike/php-api",
33
"description": "PHP SDK to communicate with the Paylike HTTP api",
4-
"version": "1.0.4",
4+
"version": "1.0.5",
55
"license": "MIT",
66
"authors": [
77
{

init.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
require(dirname(__FILE__) . '/src/Exception/NotFound.php');
99
require(dirname(__FILE__) . '/src/Exception/Unauthorized.php');
1010

11-
// Resource
12-
require(dirname(__FILE__) . '/src/Resource/Resource.php');
13-
require(dirname(__FILE__) . '/src/Resource/Apps.php');
14-
require(dirname(__FILE__) . '/src/Resource/Merchants.php');
15-
require(dirname(__FILE__) . '/src/Resource/Transactions.php');
16-
require(dirname(__FILE__) . '/src/Resource/Cards.php');
11+
// Endpoint
12+
require( dirname( __FILE__ ) . '/src/Endpoint/Endpoint.php' );
13+
require( dirname( __FILE__ ) . '/src/Endpoint/Apps.php' );
14+
require( dirname( __FILE__ ) . '/src/Endpoint/Merchants.php' );
15+
require( dirname( __FILE__ ) . '/src/Endpoint/Transactions.php' );
16+
require( dirname( __FILE__ ) . '/src/Endpoint/Cards.php' );
1717

1818
// Response
1919
require(dirname(__FILE__) . '/src/Response/ApiResponse.php');
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace Paylike\Resource;
3+
namespace Paylike\Endpoint;
44

55
/**
66
* Class Apps
77
*
8-
* @package Paylike\Resource
8+
* @package Paylike\Endpoint
99
*/
10-
class Apps extends Resource
10+
class Apps extends Endpoint
1111
{
1212
/**
1313
* @link https://github.com/paylike/api-docs#create-an-app
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace Paylike\Resource;
3+
namespace Paylike\Endpoint;
44

55
/**
66
* Class Cards
77
*
8-
* @package Paylike\Resource
8+
* @package Paylike\Endpoint
99
*/
10-
class Cards extends Resource
10+
class Cards extends Endpoint
1111
{
1212
/**
1313
* @link https://github.com/paylike/api-docs#save-a-card
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<?php
22

3-
namespace Paylike\Resource;
3+
namespace Paylike\Endpoint;
44

55
/**
6-
* Class Resource
6+
* Class Endpoint
77
*
8-
* @package Paylike\Resource
8+
* @package Paylike\Endpoint
99
*/
10-
abstract class Resource
10+
abstract class Endpoint
1111
{
1212
/**
1313
* @var \Paylike\Paylike
1414
*/
1515
protected $paylike;
1616

1717
/**
18-
* Resource constructor.
18+
* Endpoint constructor.
1919
*
2020
* @param $paylike
2121
*/
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22

3-
namespace Paylike\Resource;
3+
namespace Paylike\Endpoint;
44

55
use Paylike\Utils\Cursor;
66

77
/**
88
* Class Merchants
99
*
10-
* @package Paylike\Resource
10+
* @package Paylike\Endpoint
1111
*/
12-
class Merchants extends Resource
12+
class Merchants extends Endpoint
1313
{
1414
/**
1515
* @link https://github.com/paylike/api-docs#create-a-merchant
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22

3-
namespace Paylike\Resource;
3+
namespace Paylike\Endpoint;
44

55
use Paylike\Utils\Cursor;
66

77
/**
88
* Class Transactions
99
*
10-
* @package Paylike\Resource
10+
* @package Paylike\Endpoint
1111
*/
12-
class Transactions extends Resource
12+
class Transactions extends Endpoint
1313
{
1414
/**
1515
* @link https://github.com/paylike/api-docs#create-a-transaction

src/HttpClient/CurlClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private function handleApiError(
242242
$json_resp,
243243
$response_headers);
244244
case 404:
245-
throw new NotFound("Resource not found.",
245+
throw new NotFound("Endpoint not found.",
246246
$response_code, $response_body,
247247
$json_resp,
248248
$response_headers);

src/Paylike.php

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

55
use Paylike\HttpClient\HttpClientInterface;
66
use Paylike\HttpClient\CurlClient;
7-
use Paylike\Resource\Apps;
8-
use Paylike\Resource\Merchants;
9-
use Paylike\Resource\Transactions;
10-
use Paylike\Resource\Cards;
7+
use Paylike\Endpoint\Apps;
8+
use Paylike\Endpoint\Merchants;
9+
use Paylike\Endpoint\Transactions;
10+
use Paylike\Endpoint\Cards;
1111

1212
/**
1313
* Class Paylike

tests/AppsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Paylike\Tests;
44

5-
use Paylike\Resource\Apps;
5+
use Paylike\Endpoint\Apps;
66

77
class AppsTest extends BaseTest
88
{

0 commit comments

Comments
 (0)