Skip to content

Commit 90d7119

Browse files
committed
Adds the initial code.
0 parents  commit 90d7119

15 files changed

+677
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/vendor/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Cees-Jan Kiewiet & Beau Simensen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# API Client PSR-7 Oauth1
2+
3+
[![Build Status](https://travis-ci.org/php-api-clients/psr7-oauth1.svg?branch=master)](https://travis-ci.org/php-api-clients/psr7-oauth1)
4+
[![Latest Stable Version](https://poser.pugx.org/api-clients/psr7-oauth1/v/stable.png)](https://packagist.org/packages/api-clients/psr7-oauth1)
5+
[![Total Downloads](https://poser.pugx.org/api-clients/psr7-oauth1/downloads.png)](https://packagist.org/packages/api-clients/psr7-oauth1/stats)
6+
[![Code Coverage](https://scrutinizer-ci.com/g/php-api-clients/psr7-oauth1/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/php-api-clients/psr7-oauth1/?branch=master)
7+
[![License](https://poser.pugx.org/api-clients/psr7-oauth1/license.png)](https://packagist.org/packages/api-clients/psr7-oauth1)
8+
[![PHP 7 ready](http://php7ready.timesplinter.ch/php-api-clients/psr7-oauth1/badge.svg)](https://appveyor-ci.org/php-api-clients/psr7-oauth1)
9+
10+
# License
11+
12+
The MIT License (MIT)
13+
14+
Copyright (c) 2016 Cees-Jan Kiewiet & Beau Simensen
15+
16+
Permission is hereby granted, free of charge, to any person obtaining a copy
17+
of this software and associated documentation files (the "Software"), to deal
18+
in the Software without restriction, including without limitation the rights
19+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20+
copies of the Software, and to permit persons to whom the Software is
21+
furnished to do so, subject to the following conditions:
22+
23+
The above copyright notice and this permission notice shall be included in all
24+
copies or substantial portions of the Software.
25+
26+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32+
SOFTWARE.

composer.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "api-clients/psr7-oauth1",
3+
"license": "MIT",
4+
"authors": [
5+
{
6+
"name": "Cees-Jan Kiewiet",
7+
"email": "[email protected]"
8+
},
9+
{
10+
"name": "Beau Simensen",
11+
"email": "[email protected]"
12+
}
13+
],
14+
"require": {
15+
"php": "^7.0 || ^5.5",
16+
"psr/http-message": "^1.0"
17+
},
18+
"autoload": {
19+
"psr-4": {
20+
"ApiClients\\Tools\\Psr7\\Oauth1\\": "src/"
21+
}
22+
},
23+
"autoload-dev": {
24+
"psr-4": {
25+
"ApiClients\\Tests\\Tools\\Psr7\\Oauth1\\": "tests/"
26+
}
27+
},
28+
"config": {
29+
"sort-packages": true,
30+
"platform": {
31+
"php": "5.5.9"
32+
}
33+
}
34+
}

composer.lock

+73
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Definition/AccessToken.php

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace ApiClients\Tools\Psr7\Oauth1\Definition;
4+
5+
class AccessToken implements Token
6+
{
7+
/**
8+
* @var string
9+
*/
10+
private $accessToken;
11+
12+
/**
13+
* @param string $accessToken
14+
*/
15+
public function __construct($accessToken)
16+
{
17+
$this->accessToken = $accessToken;
18+
}
19+
20+
/**
21+
* @return string
22+
*/
23+
public function getAccessToken()
24+
{
25+
return $this->accessToken;
26+
}
27+
28+
/**
29+
* @return string
30+
*/
31+
public function getToken()
32+
{
33+
return (string) $this->accessToken;
34+
}
35+
36+
/**
37+
* @return string
38+
*/
39+
public function __toString()
40+
{
41+
return (string) $this->accessToken;
42+
}
43+
}

src/Definition/ConsumerKey.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace ApiClients\Tools\Psr7\Oauth1\Definition;
4+
5+
class ConsumerKey
6+
{
7+
/**
8+
* @var string
9+
*/
10+
private $consumerKey;
11+
12+
/**
13+
* @param string $consumerKey
14+
*/
15+
public function __construct($consumerKey)
16+
{
17+
$this->consumerKey = $consumerKey;
18+
}
19+
20+
/**
21+
* @return string
22+
*/
23+
public function getConsumerKey()
24+
{
25+
return (string) $this->consumerKey;
26+
}
27+
28+
/**
29+
* @return string
30+
*/
31+
public function __toString()
32+
{
33+
return (string) $this->consumerKey;
34+
}
35+
}

src/Definition/ConsumerSecret.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace ApiClients\Tools\Psr7\Oauth1\Definition;
4+
5+
class ConsumerSecret
6+
{
7+
/**
8+
* @var string
9+
*/
10+
private $consumerSecret;
11+
12+
/**
13+
* @param string $consumerSecret
14+
*/
15+
public function __construct($consumerSecret)
16+
{
17+
$this->consumerSecret = $consumerSecret;
18+
}
19+
20+
/**
21+
* @return string
22+
*/
23+
public function getConsumerSecret()
24+
{
25+
return (string) $this->consumerSecret;
26+
}
27+
28+
/**
29+
* @return string
30+
*/
31+
public function __toString()
32+
{
33+
return (string) $this->consumerSecret;
34+
}
35+
}

src/Definition/RequestToken.php

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace ApiClients\Tools\Psr7\Oauth1\Definition;
4+
5+
class RequestToken implements Token
6+
{
7+
/**
8+
* @var string
9+
*/
10+
private $requestToken;
11+
12+
/**
13+
* @param string $token
14+
*/
15+
public function __construct($requestToken)
16+
{
17+
$this->requestToken = $requestToken;
18+
}
19+
20+
/**
21+
* @return string
22+
*/
23+
public function getRequestToken()
24+
{
25+
return $this->requestToken;
26+
}
27+
28+
/**
29+
* @return string
30+
*/
31+
public function getToken()
32+
{
33+
return (string) $this->requestToken;
34+
}
35+
36+
/**
37+
* @return string
38+
*/
39+
public function __toString()
40+
{
41+
return (string) $this->requestToken;
42+
}
43+
}

src/Definition/Token.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace ApiClients\Tools\Psr7\Oauth1\Definition;
4+
5+
interface Token
6+
{
7+
/**
8+
* @return string
9+
*/
10+
public function getToken();
11+
12+
/**
13+
* @return string
14+
*/
15+
public function __toString();
16+
}

src/Definition/TokenSecret.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace ApiClients\Tools\Psr7\Oauth1\Definition;
4+
5+
class TokenSecret
6+
{
7+
/**
8+
* @var string
9+
*/
10+
private $tokenSecret;
11+
12+
/**
13+
* @param string $tokenSecret
14+
*/
15+
public function __construct($tokenSecret)
16+
{
17+
$this->tokenSecret = $tokenSecret;
18+
}
19+
20+
/**
21+
* @return string
22+
*/
23+
public function getTokenSecret()
24+
{
25+
return (string) $this->tokenSecret;
26+
}
27+
28+
/**
29+
* @return string
30+
*/
31+
public function __toString()
32+
{
33+
return (string) $this->tokenSecret;
34+
}
35+
}

0 commit comments

Comments
 (0)