Skip to content

Commit f37f18d

Browse files
committed
Cleanup for Travis build
1 parent c3f52c3 commit f37f18d

7 files changed

Lines changed: 133 additions & 130 deletions

File tree

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[![Latest Version](https://img.shields.io/github/release/potherca/flysystem-github.svg?style=flat-square)](https://github.com/potherca/flysystem-github/releases)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
5-
[![Build Status](https://img.shields.io/travis/potherca/flysystem-github/master.svg?style=flat-square)](https://travis-ci.org/potherca/flysystem-github)
6-
[![Coverage Status](https://img.shields.io/coveralls/potherca/flysystem-github.svg?style=flat-square)](https://coveralls.io/github/potherca/flysystem-github)
5+
[![Build Status](https://img.shields.io/travis/potherca/flysystem-github.svg?style=flat-square)](https://travis-ci.org/potherca/flysystem-github)
6+
[![Coverage Status](https://coveralls.io/repos/potherca/flysystem-github/badge.svg)](https://coveralls.io/github/potherca/flysystem-github)
77
[![Quality Score](https://img.shields.io/scrutinizer/g/potherca/flysystem-github.svg?style=flat-square)](https://scrutinizer-ci.com/g/potherca/flysystem-github)
88
[![Total Downloads](https://img.shields.io/packagist/dt/potherca/flysystem-github.svg?style=flat-square)](https://packagist.org/packages/potherca/flysystem-github)
99

@@ -27,27 +27,27 @@ limit.
2727
### Basic Usage
2828

2929
```php
30-
use Github\Client as GithubClient;
30+
use Github\Client;
3131
use League\Flysystem\Filesystem;
32-
use Potherca\Flysystem\Github\Client;
32+
use Potherca\Flysystem\Github\Api;
3333
use Potherca\Flysystem\Github\GithubAdapter;
3434
use Potherca\Flysystem\Github\Settings;
3535

3636
$project = 'thephpleague/flysystem';
3737

3838
$settings = new Settings($project);
3939

40-
$client = new Client(new GithubClient(), $settings);
41-
$adapter = new GithubAdapter($client);
40+
$api = new Api(new Client(), $settings);
41+
$adapter = new GithubAdapter($api);
4242
$filesystem = new Filesystem($adapter);
4343
```
4444

4545
### Authentication
4646

4747
```php
48-
use Github\Client as GithubClient;
48+
use Github\Client;
4949
use League\Flysystem\Filesystem;
50-
use Potherca\Flysystem\Github\Client;
50+
use Potherca\Flysystem\Github\Api;
5151
use Potherca\Flysystem\Github\GithubAdapter;
5252
use Potherca\Flysystem\Github\Settings;
5353

@@ -57,19 +57,19 @@ $credentials = [Settings::AUTHENTICATE_USING_TOKEN, '83347e315b8bb4790a48ed6953a
5757

5858
$settings = new Settings($project, $credentials);
5959

60-
$client = new Client(new GithubClient(), $settings);
61-
$adapter = new GithubAdapter($client);
60+
$api = new Api(new Client(), $settings);
61+
$adapter = new GithubAdapter($api);
6262
$filesystem = new Filesystem($adapter);
6363
```
6464

6565
### Cache Usage
6666

6767
```php
68-
use Github\Client as GithubClient;
68+
use Github\Client;
6969
use Github\HttpClient\CachedHttpClient as CachedClient;
7070
use Github\HttpClient\Cache\FilesystemCache as Cache;
7171
use League\Flysystem\Filesystem;
72-
use Potherca\Flysystem\Github\Client;
72+
use Potherca\Flysystem\Github\Api;
7373
use Potherca\Flysystem\Github\GithubAdapter;
7474
use Potherca\Flysystem\Github\Settings;
7575

@@ -81,8 +81,8 @@ $cache = new Cache('/tmp/github-api-cache')
8181
$cacheClient = new CachedClient();
8282
$cacheClient->setCache($cache);
8383

84-
$client = new Client($cacheClient, $settings);
85-
$adapter = new GithubAdapter($client);
84+
$api = new Api($cacheClient, $settings);
85+
$adapter = new GithubAdapter($api);
8686
$filesystem = new Filesystem($adapter);
8787

8888
```
@@ -93,13 +93,17 @@ $filesystem = new Filesystem($adapter);
9393
$ composer test
9494
```
9595

96+
## Security
97+
98+
If you discover any security related issues, please email potherca@gmail.com instead of using the issue tracker.
99+
96100
## Contributing
97101

98102
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
99103

100-
## Security
104+
## Change Log
101105

102-
If you discover any security related issues, please email potherca@gmail.com instead of using the issue tracker.
106+
Please see [CHANGELOG](CHANGELOG.md) for details.
103107

104108
## Credits
105109

src/Client.php renamed to src/Api.php

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

55
use Github\Api\GitData;
66
use Github\Api\Repo;
7-
use Github\Client as GithubClient;
7+
use Github\Client;
88
use Github\Exception\RuntimeException;
99
use League\Flysystem\AdapterInterface;
1010
use League\Flysystem\Util\MimeType;
1111

12-
class Client implements ClientInterface
12+
/**
13+
* Facade class for the Github Api Library
14+
*/
15+
class Api implements ApiInterface
1316
{
1417
////////////////////////////// CLASS PROPERTIES \\\\\\\\\\\\\\\\\\\\\\\\\\\\
1518
const ERROR_NOT_FOUND = 'Not Found';
@@ -33,7 +36,7 @@ class Client implements ClientInterface
3336
const KEY_VISIBILITY = 'visibility';
3437
const ERROR_NO_NAME = 'Could not set name for entry';
3538

36-
/** @var GithubClient */
39+
/** @var Client */
3740
private $client;
3841
/** @var SettingsInterface */
3942
private $settings;
@@ -76,7 +79,7 @@ private function getRepositoryContent()
7679
}
7780

7881
//////////////////////////////// PUBLIC API \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
79-
final public function __construct(GithubClient $client, SettingsInterface $settings)
82+
final public function __construct(Client $client, SettingsInterface $settings)
8083
{
8184
/* @NOTE: If $settings contains `credentials` but not an `author` we are
8285
* still in `read-only` mode.
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<?php
2-
/**
3-
* Created by PhpStorm.
4-
* User: ben
5-
* Date: 18/07/15
6-
* Time: 21:36
7-
*/
2+
83
namespace Potherca\Flysystem\Github;
94

10-
interface ClientInterface
5+
interface ApiInterface
116
{
127
const KEY_CONTENTS = 'contents';
138

src/GithubAdapter.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ class GithubAdapter extends AbstractAdapter
2121
const VISIBILITY_PRIVATE = 'private';
2222
const VISIBILITY_PUBLIC = 'public';
2323

24-
/** @var ClientInterface */
25-
private $client;
24+
/** @var ApiInterface */
25+
private $api;
2626

2727
/**
28-
* @return ClientInterface
28+
* @return ApiInterface
2929
*/
30-
final public function getClient()
30+
final public function getApi()
3131
{
32-
return $this->client;
32+
return $this->api;
3333
}
3434

3535
/**
36-
* @param ClientInterface $client
36+
* @param ApiInterface $api
3737
*/
38-
public function __construct(ClientInterface $client)
38+
public function __construct(ApiInterface $api)
3939
{
40-
$this->client = $client;
40+
$this->api = $api;
4141
}
4242

4343
/**
@@ -52,7 +52,7 @@ public function __construct(ClientInterface $client)
5252
public function write($path, $contents, Config $config)
5353
{
5454
throw new Exception('Write action are not (yet) supported');
55-
//@TODO: return $this->getClient()->create($path, $contents);
55+
//@TODO: return $this->getApi()->create($path, $contents);
5656
}
5757

5858
/**
@@ -67,7 +67,7 @@ public function write($path, $contents, Config $config)
6767
public function update($path, $contents, Config $config)
6868
{
6969
throw new Exception('Write action are not (yet) supported');
70-
// @TODO: return $this->getClient()->update($path, $contents);
70+
// @TODO: return $this->getApi()->update($path, $contents);
7171
}
7272

7373
/**
@@ -81,7 +81,7 @@ public function update($path, $contents, Config $config)
8181
public function rename($path, $newpath)
8282
{
8383
throw new Exception('Write action are not (yet) supported');
84-
// @TODO: return $this->getClient()->rename($path, $newPath);
84+
// @TODO: return $this->getApi()->rename($path, $newPath);
8585
}
8686

8787
/**
@@ -95,7 +95,7 @@ public function rename($path, $newpath)
9595
public function copy($path, $newpath)
9696
{
9797
throw new Exception('Write action are not (yet) supported');
98-
// @TODO: return $this->getClient()->copy($path, $newPath);
98+
// @TODO: return $this->getApi()->copy($path, $newPath);
9999
}
100100

101101
/**
@@ -108,7 +108,7 @@ public function copy($path, $newpath)
108108
public function delete($path)
109109
{
110110
throw new Exception('Write action are not (yet) supported');
111-
// @TODO: return $this->getClient()->delete($path);
111+
// @TODO: return $this->getApi()->delete($path);
112112
}
113113

114114
/**
@@ -121,7 +121,7 @@ public function delete($path)
121121
public function deleteDir($dirname)
122122
{
123123
throw new Exception('Write action are not (yet) supported');
124-
// @TODO: return $this->getClient()->deleteDir($dirname);
124+
// @TODO: return $this->getApi()->deleteDir($dirname);
125125
}
126126

127127
/**
@@ -135,7 +135,7 @@ public function deleteDir($dirname)
135135
public function createDir($dirname, Config $config)
136136
{
137137
throw new Exception('Write action are not (yet) supported');
138-
// @TODO: return $this->getClient()->createDir($dirname);
138+
// @TODO: return $this->getApi()->createDir($dirname);
139139
}
140140

141141
/**
@@ -160,7 +160,7 @@ public function setVisibility($path, $visibility)
160160
*/
161161
public function has($path)
162162
{
163-
return $this->getClient()->exists($path);
163+
return $this->getApi()->exists($path);
164164
}
165165

166166
/**
@@ -172,7 +172,7 @@ public function has($path)
172172
*/
173173
public function read($path)
174174
{
175-
return [ClientInterface::KEY_CONTENTS => $this->getClient()->getFileContents($path)];
175+
return [ApiInterface::KEY_CONTENTS => $this->getApi()->getFileContents($path)];
176176
}
177177

178178
/**
@@ -185,7 +185,7 @@ public function read($path)
185185
*/
186186
public function listContents($path = '/', $recursive = false)
187187
{
188-
return $this->getClient()->getRecursiveMetadata($path, $recursive);
188+
return $this->getApi()->getRecursiveMetadata($path, $recursive);
189189
}
190190

191191
/**
@@ -197,7 +197,7 @@ public function listContents($path = '/', $recursive = false)
197197
*/
198198
public function getMetadata($path)
199199
{
200-
return $this->getClient()->getMetaData($path);
200+
return $this->getApi()->getMetaData($path);
201201
}
202202

203203
/**
@@ -209,7 +209,7 @@ public function getMetadata($path)
209209
*/
210210
public function getSize($path)
211211
{
212-
return $this->getClient()->getMetaData($path);
212+
return $this->getApi()->getMetaData($path);
213213
}
214214

215215
/**
@@ -221,7 +221,7 @@ public function getSize($path)
221221
*/
222222
public function getMimetype($path)
223223
{
224-
return ['mimetype' => $this->getClient()->guessMimeType($path)];
224+
return ['mimetype' => $this->getApi()->guessMimeType($path)];
225225
}
226226

227227
/**
@@ -233,7 +233,7 @@ public function getMimetype($path)
233233
*/
234234
public function getTimestamp($path)
235235
{
236-
return $this->getClient()->getLastUpdatedTimestamp($path);
236+
return $this->getApi()->getLastUpdatedTimestamp($path);
237237
}
238238

239239
/**
@@ -246,7 +246,7 @@ public function getTimestamp($path)
246246
public function getVisibility($path)
247247
{
248248
$recursive = false;
249-
$metadata = $this->getClient()->getRecursiveMetadata($path, $recursive);
249+
$metadata = $this->getApi()->getRecursiveMetadata($path, $recursive);
250250
return $metadata[0];
251251
}
252252
}

src/Settings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace Potherca\Flysystem\Github;
44

5-
use Github\Client as GithubClient;
5+
use Github\Client;
66

77
class Settings implements SettingsInterface
88
{
99
////////////////////////////// CLASS PROPERTIES \\\\\\\\\\\\\\\\\\\\\\\\\\\\
10-
const AUTHENTICATE_USING_TOKEN = GithubClient::AUTH_URL_TOKEN;
11-
const AUTHENTICATE_USING_PASSWORD = GithubClient::AUTH_HTTP_PASSWORD;
10+
const AUTHENTICATE_USING_TOKEN = Client::AUTH_URL_TOKEN;
11+
const AUTHENTICATE_USING_PASSWORD = Client::AUTH_HTTP_PASSWORD;
1212

1313
const BRANCH_MASTER = 'master';
1414
const REFERENCE_HEAD = 'HEAD';

0 commit comments

Comments
 (0)