Skip to content

Commit 56fd692

Browse files
authored
Merge pull request #22 from upwork/v1.2.5
v1.3.0
2 parents d2f33a9 + 91c0ce0 commit 56fd692

14 files changed

+22
-219
lines changed

.tests

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./vendor/phpunit/phpunit/phpunit.php --stderr

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ language: php
33
php:
44
- "5.6"
55
- "5.5"
6-
- "5.4"
7-
- "5.3"
86
- hhvm
97

108
before_script:

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History
22

3+
## 1.3.0
4+
* Stop supporting deprecated Teamrooms API
5+
* Migrate Workdiaries, Workdays and Snapshots API to v3
6+
37
## 1.2.4
48
* fix a typo in the README
59
* Readline ignores \n - add space between authorization URL and the second part of the promt

composer.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "upwork/php-upwork",
33
"description": "PHP bindings for Upwork API",
4-
"version": "v1.2.4",
4+
"version": "v1.3.0",
55
"type": "library",
66
"keywords": ["upwork", "php", "api"],
77
"homepage": "http://www.upwork.com",
8-
"time": "2017-02-15",
8+
"time": "2018-05-24",
99
"license": "Apache-2.0",
1010
"authors": [
1111
{
@@ -23,7 +23,9 @@
2323
"wiki": "http://developers.upwork.com"
2424
},
2525
"suggest": {
26-
"ext-oauth": "This extension from PECL provides OAuth consumer and provider bindings. See more under http://www.php.net/oauth"
26+
"ext-oauth": "This extension from PECL provides OAuth consumer and provider bindings. See more under http://www.php.net/oauth",
27+
"apigen/apigen": "dev-master",
28+
"roave/better-reflection": "dev-master"
2729
},
2830
"require": {
2931
"php": ">=5.3.3",

docs/docs.zip

108 KB
Binary file not shown.

src/Upwork/API/AuthTypes/AbstractOAuth.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ abstract class AbstractOAuth
3737
*/
3838
static protected $_secret = null;
3939
/**
40-
* @var oauth_token, shared request token (temporary)
40+
* @var oauth_token shared request token (temporary)
4141
*/
4242
static protected $_requestToken = null;
4343
/**

src/Upwork/API/Routers/Snapshot.php

+3-58
Original file line numberDiff line numberDiff line change
@@ -42,61 +42,6 @@ public function __construct(ApiClient $client)
4242
parent::$_epoint = self::ENTRY_POINT;
4343
}
4444

45-
/**
46-
* Get snapshot info
47-
*
48-
* @param string $company Company
49-
* @param string $username Username
50-
* @param string $ts Timestamp
51-
* @return object
52-
*/
53-
public function get($company, $username, $ts)
54-
{
55-
ApiDebug::p(__FUNCTION__);
56-
57-
$response = $this->_client->get('/team/v1/snapshots/' . $company . '/' . $username . '/' . $ts);
58-
ApiDebug::p('found response info', $response);
59-
60-
return $response;
61-
}
62-
63-
/**
64-
* Update snapshot
65-
*
66-
* @param string $company Company
67-
* @param string $username Username
68-
* @param string $ts Timestamp
69-
* @param array $params Parameters
70-
* @return object
71-
*/
72-
public function update($company, $username, $ts, $params)
73-
{
74-
ApiDebug::p(__FUNCTION__);
75-
76-
$response = $this->_client->put('/team/v1/snapshots/' . $company . '/' . $username . '/' . $ts, $params);
77-
ApiDebug::p('found response info', $response);
78-
79-
return $response;
80-
}
81-
82-
/**
83-
* Delete snapshot
84-
*
85-
* @param string $company Company
86-
* @param string $username Username
87-
* @param string $ts Timestamp
88-
* @return object
89-
*/
90-
public function delete($company, $username, $ts)
91-
{
92-
ApiDebug::p(__FUNCTION__);
93-
94-
$response = $this->_client->delete('/team/v1/snapshots/' . $company . '/' . $username . '/' . $ts);
95-
ApiDebug::p('found response info', $response);
96-
97-
return $response;
98-
}
99-
10045
/**
10146
* Get snapshot info by specific contract
10247
*
@@ -108,7 +53,7 @@ public function getByContract($contractId, $ts)
10853
{
10954
ApiDebug::p(__FUNCTION__);
11055

111-
$response = $this->_client->get('/team/v2/snapshots/contracts/' . $contractId . '/' . $ts);
56+
$response = $this->_client->get('/team/v3/snapshots/contracts/' . $contractId . '/' . $ts);
11257
ApiDebug::p('found response info', $response);
11358

11459
return $response;
@@ -126,7 +71,7 @@ public function updateByContract($contractId, $ts, $params)
12671
{
12772
ApiDebug::p(__FUNCTION__);
12873

129-
$response = $this->_client->put('/team/v2/snapshots/contracts/' . $contractId . '/' . $ts, $params);
74+
$response = $this->_client->put('/team/v3/snapshots/contracts/' . $contractId . '/' . $ts, $params);
13075
ApiDebug::p('found response info', $response);
13176

13277
return $response;
@@ -143,7 +88,7 @@ public function deleteByContract($contractId, $ts)
14388
{
14489
ApiDebug::p(__FUNCTION__);
14590

146-
$response = $this->_client->delete('/team/v2/snapshots/contracts/' . $contractId . '/' . $ts);
91+
$response = $this->_client->delete('/team/v3/snapshots/contracts/' . $contractId . '/' . $ts);
14792
ApiDebug::p('found response info', $response);
14893

14994
return $response;

src/Upwork/API/Routers/Teams.php

-76
This file was deleted.

src/Upwork/API/Routers/Workdays.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getByCompany($company, $fromDate, $tillDate, $params = array())
5555
{
5656
ApiDebug::p(__FUNCTION__);
5757

58-
$response = $this->_client->get('/team/v2/workdays/companies/' . $company . '/' . $fromDate . ',' . $tillDate, $params);
58+
$response = $this->_client->get('/team/v3/workdays/companies/' . $company . '/' . $fromDate . ',' . $tillDate, $params);
5959
ApiDebug::p('found response info', $response);
6060

6161
return $response;
@@ -74,7 +74,7 @@ public function getByContract($contract, $fromDate, $tillDate, $params = array()
7474
{
7575
ApiDebug::p(__FUNCTION__);
7676

77-
$response = $this->_client->get('/team/v2/workdays/contracts/' . $company . '/' . $fromDate . ',' . $tillDate, $params);
77+
$response = $this->_client->get('/team/v3/workdays/contracts/' . $company . '/' . $fromDate . ',' . $tillDate, $params);
7878
ApiDebug::p('found response info', $response);
7979

8080
return $response;

src/Upwork/API/Routers/Workdiary.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,15 @@ public function __construct(ApiClient $client)
4646
* Get Workdiary
4747
*
4848
* @param string $company Company ID
49-
* @param string $username User ID
5049
* @param string $date Date
5150
* @param array $params (Optional) Parameters
5251
* @return object
5352
*/
54-
public function get($company, $username, $date, $params = array())
53+
public function get($company, $date, $params = array())
5554
{
5655
ApiDebug::p(__FUNCTION__);
5756

58-
$response = $this->_client->get('/team/v1/workdiaries/' . $company . '/' . $username . '/' . $date, $params);
57+
$response = $this->_client->get('/team/v3/workdiaries/companies/' . $company . '/' . $date, $params);
5958
ApiDebug::p('found response info', $response);
6059

6160
return $response;
@@ -73,7 +72,7 @@ public function getByContract($contract, $date, $params = array())
7372
{
7473
ApiDebug::p(__FUNCTION__);
7574

76-
$response = $this->_client->get('/team/v2/workdiaries/contracts/' . $contract . '/' . $date, $params);
75+
$response = $this->_client->get('/team/v3/workdiaries/contracts/' . $contract . '/' . $date, $params);
7776
ApiDebug::p('found response info', $response);
7877

7978
return $response;

tests/Upwork/API/Routers/Hr/MilestonesTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function testActivate()
7676
public function testApprove()
7777
{
7878
$router = new \Upwork\API\Routers\Hr\Milestones($this->_client);
79-
$response = $router->approve(array());
79+
$response = $router->approve('1234', array());
8080

8181
$this->_checkResponse($response);
8282
}
@@ -87,7 +87,7 @@ public function testApprove()
8787
public function testDelete()
8888
{
8989
$router = new \Upwork\API\Routers\Hr\Milestones($this->_client);
90-
$response = $router->delete(array());
90+
$response = $router->delete('1234');
9191

9292
$this->_checkResponse($response);
9393
}

tests/Upwork/API/Routers/SnapshotTest.php

-33
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,6 @@ public function setUp()
1313
parent::setUp();
1414
}
1515

16-
/**
17-
* @test
18-
*/
19-
public function testGet()
20-
{
21-
$router = new \Upwork\API\Routers\Snapshot($this->_client);
22-
$response = $router->get('company', 'username', '1234567890');
23-
24-
$this->_checkResponse($response);
25-
}
26-
27-
/**
28-
* @test
29-
*/
30-
public function testUpdate()
31-
{
32-
$router = new \Upwork\API\Routers\Snapshot($this->_client);
33-
$response = $router->update('company', 'username', '1234567890', array());
34-
35-
$this->_checkResponse($response);
36-
}
37-
38-
/**
39-
* @test
40-
*/
41-
public function testDelete()
42-
{
43-
$router = new \Upwork\API\Routers\Snapshot($this->_client);
44-
$response = $router->delete('company', 'username', '1234567890');
45-
46-
$this->_checkResponse($response);
47-
}
48-
4916
/**
5017
* @test
5118
*/

tests/Upwork/API/Routers/TeamsTest.php

-37
This file was deleted.

tests/Upwork/API/Routers/WorkdiaryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function setUp()
1919
public function testGet()
2020
{
2121
$router = new \Upwork\API\Routers\Workdiary($this->_client);
22-
$response = $router->get('company', 'username', '20140101', array());
22+
$response = $router->get('company', '20140101', array());
2323

2424
$this->_checkResponse($response);
2525
}

0 commit comments

Comments
 (0)