Skip to content

Commit

Permalink
Merge pull request #22 from upwork/v1.2.5
Browse files Browse the repository at this point in the history
v1.3.0
  • Loading branch information
mnovozhylov committed May 25, 2018
2 parents d2f33a9 + 91c0ce0 commit 56fd692
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 219 deletions.
1 change: 1 addition & 0 deletions .tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./vendor/phpunit/phpunit/phpunit.php --stderr
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ language: php
php:
- "5.6"
- "5.5"
- "5.4"
- "5.3"
- hhvm

before_script:
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 1.3.0
* Stop supporting deprecated Teamrooms API
* Migrate Workdiaries, Workdays and Snapshots API to v3

## 1.2.4
* fix a typo in the README
* Readline ignores \n - add space between authorization URL and the second part of the promt
Expand Down
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "upwork/php-upwork",
"description": "PHP bindings for Upwork API",
"version": "v1.2.4",
"version": "v1.3.0",
"type": "library",
"keywords": ["upwork", "php", "api"],
"homepage": "http://www.upwork.com",
"time": "2017-02-15",
"time": "2018-05-24",
"license": "Apache-2.0",
"authors": [
{
Expand All @@ -23,7 +23,9 @@
"wiki": "http://developers.upwork.com"
},
"suggest": {
"ext-oauth": "This extension from PECL provides OAuth consumer and provider bindings. See more under http://www.php.net/oauth"
"ext-oauth": "This extension from PECL provides OAuth consumer and provider bindings. See more under http://www.php.net/oauth",
"apigen/apigen": "dev-master",
"roave/better-reflection": "dev-master"
},
"require": {
"php": ">=5.3.3",
Expand Down
Binary file modified docs/docs.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Upwork/API/AuthTypes/AbstractOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ abstract class AbstractOAuth
*/
static protected $_secret = null;
/**
* @var oauth_token, shared request token (temporary)
* @var oauth_token shared request token (temporary)
*/
static protected $_requestToken = null;
/**
Expand Down
61 changes: 3 additions & 58 deletions src/Upwork/API/Routers/Snapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,61 +42,6 @@ public function __construct(ApiClient $client)
parent::$_epoint = self::ENTRY_POINT;
}

/**
* Get snapshot info
*
* @param string $company Company
* @param string $username Username
* @param string $ts Timestamp
* @return object
*/
public function get($company, $username, $ts)
{
ApiDebug::p(__FUNCTION__);

$response = $this->_client->get('/team/v1/snapshots/' . $company . '/' . $username . '/' . $ts);
ApiDebug::p('found response info', $response);

return $response;
}

/**
* Update snapshot
*
* @param string $company Company
* @param string $username Username
* @param string $ts Timestamp
* @param array $params Parameters
* @return object
*/
public function update($company, $username, $ts, $params)
{
ApiDebug::p(__FUNCTION__);

$response = $this->_client->put('/team/v1/snapshots/' . $company . '/' . $username . '/' . $ts, $params);
ApiDebug::p('found response info', $response);

return $response;
}

/**
* Delete snapshot
*
* @param string $company Company
* @param string $username Username
* @param string $ts Timestamp
* @return object
*/
public function delete($company, $username, $ts)
{
ApiDebug::p(__FUNCTION__);

$response = $this->_client->delete('/team/v1/snapshots/' . $company . '/' . $username . '/' . $ts);
ApiDebug::p('found response info', $response);

return $response;
}

/**
* Get snapshot info by specific contract
*
Expand All @@ -108,7 +53,7 @@ public function getByContract($contractId, $ts)
{
ApiDebug::p(__FUNCTION__);

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

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

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

return $response;
Expand All @@ -143,7 +88,7 @@ public function deleteByContract($contractId, $ts)
{
ApiDebug::p(__FUNCTION__);

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

return $response;
Expand Down
76 changes: 0 additions & 76 deletions src/Upwork/API/Routers/Teams.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Upwork/API/Routers/Workdays.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getByCompany($company, $fromDate, $tillDate, $params = array())
{
ApiDebug::p(__FUNCTION__);

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

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

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

return $response;
Expand Down
7 changes: 3 additions & 4 deletions src/Upwork/API/Routers/Workdiary.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,15 @@ public function __construct(ApiClient $client)
* Get Workdiary
*
* @param string $company Company ID
* @param string $username User ID
* @param string $date Date
* @param array $params (Optional) Parameters
* @return object
*/
public function get($company, $username, $date, $params = array())
public function get($company, $date, $params = array())
{
ApiDebug::p(__FUNCTION__);

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

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

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

return $response;
Expand Down
4 changes: 2 additions & 2 deletions tests/Upwork/API/Routers/Hr/MilestonesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testActivate()
public function testApprove()
{
$router = new \Upwork\API\Routers\Hr\Milestones($this->_client);
$response = $router->approve(array());
$response = $router->approve('1234', array());

$this->_checkResponse($response);
}
Expand All @@ -87,7 +87,7 @@ public function testApprove()
public function testDelete()
{
$router = new \Upwork\API\Routers\Hr\Milestones($this->_client);
$response = $router->delete(array());
$response = $router->delete('1234');

$this->_checkResponse($response);
}
Expand Down
33 changes: 0 additions & 33 deletions tests/Upwork/API/Routers/SnapshotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,6 @@ public function setUp()
parent::setUp();
}

/**
* @test
*/
public function testGet()
{
$router = new \Upwork\API\Routers\Snapshot($this->_client);
$response = $router->get('company', 'username', '1234567890');

$this->_checkResponse($response);
}

/**
* @test
*/
public function testUpdate()
{
$router = new \Upwork\API\Routers\Snapshot($this->_client);
$response = $router->update('company', 'username', '1234567890', array());

$this->_checkResponse($response);
}

/**
* @test
*/
public function testDelete()
{
$router = new \Upwork\API\Routers\Snapshot($this->_client);
$response = $router->delete('company', 'username', '1234567890');

$this->_checkResponse($response);
}

/**
* @test
*/
Expand Down
37 changes: 0 additions & 37 deletions tests/Upwork/API/Routers/TeamsTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Upwork/API/Routers/WorkdiaryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function setUp()
public function testGet()
{
$router = new \Upwork\API\Routers\Workdiary($this->_client);
$response = $router->get('company', 'username', '20140101', array());
$response = $router->get('company', '20140101', array());

$this->_checkResponse($response);
}
Expand Down

0 comments on commit 56fd692

Please sign in to comment.