Skip to content

Commit daa1a9a

Browse files
committed
Update docs for new interfaces
1 parent 8921dd0 commit daa1a9a

6 files changed

Lines changed: 25 additions & 31 deletions

README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ creates a named alias for each of these services.
4747

4848
This means you have two way of using the defined storages:
4949

50-
* either using autowiring, by typehinting against the `FilesystemInterface` and using the
50+
* either using autowiring, by typehinting against the `FilesystemOperator` and using the
5151
variable name matching one of your storages:
5252

5353
```php
54-
use League\Flysystem\FilesystemInterface;
54+
use League\Flysystem\FilesystemOperator;
5555
5656
class MyService
5757
{
5858
private $storage;
5959
6060
// The variable name $defaultStorage matters: it needs to be the camelized version
6161
// of the name of your storage.
62-
public function __construct(FilesystemInterface $defaultStorage)
62+
public function __construct(FilesystemOperator $defaultStorage)
6363
{
6464
$this->storage = $defaultStorage;
6565
}
@@ -71,13 +71,13 @@ This means you have two way of using the defined storages:
7171
The same goes for controllers:
7272

7373
```php
74-
use League\Flysystem\FilesystemInterface;
74+
use League\Flysystem\FilesystemOperator;
7575
7676
class MyController
7777
{
7878
// The variable name $defaultStorage matters: it needs to be the camelized version
7979
// of the name of your storage.
80-
public function index(FilesystemInterface $defaultStorage)
80+
public function index(FilesystemOperator $defaultStorage)
8181
{
8282
// ...
8383
}
@@ -87,22 +87,16 @@ This means you have two way of using the defined storages:
8787
* or using manual injection, by injecting the service named `default.storage` inside
8888
your services.
8989

90-
Once you have a FilesystemInterface, you can call methods from the
91-
[Filesystem API](https://flysystem.thephpleague.com/docs/usage/filesystem-api/)
90+
Once you have a FilesystemOperator, you can call methods from the
91+
[Filesystem API](https://flysystem.thephpleague.com/v2/docs/usage/filesystem-api/)
9292
to interact with your storage.
9393

9494
## Full documentation
9595

96-
1. [Getting started](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/1-getting-started.md)
96+
1. [Getting started](https://flysystem.thephpleague.com/v2/docs/getting-started/)
9797
2. Cloud storage providers:
98-
[Azure](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#azure),
9998
[AsyncAws S3](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#asyncaws-s3),
10099
[AWS S3](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#aws-s3),
101-
[DigitalOcean Spaces](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#digitalocean-spaces),
102-
[Scaleway Object Storage](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#scaleway-object-storage),
103-
[Google Cloud Storage](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#google-cloud-storage),
104-
[Rackspace](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#rackspace),
105-
[WebDAV](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#webdav)
106100
3. [Interacting with FTP and SFTP servers](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/3-interacting-with-ftp-and-sftp-servers.md)
107101
4. [Caching metadata in Symfony cache](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/4-caching-metadata-in-symfony-cache.md)
108102
5. [Using a lazy adapter to switch storage backend using an environment variable](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/5-using-lazy-adapter-to-switch-at-runtime.md)

docs/1-getting-started.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ creates a named alias for each of these services.
4040

4141
This means you have two way of using the defined storages:
4242

43-
* either using autowiring, by typehinting against the `FilesystemInterface` and using the
43+
* either using autowiring, by typehinting against the `FilesystemOperator` and using the
4444
variable name matching one of your storages:
4545

4646
```php
47-
use League\Flysystem\FilesystemInterface;
47+
use League\Flysystem\FilesystemOperator;
4848
4949
class MyService
5050
{
5151
private $storage;
5252
5353
// The variable name $defaultStorage matters: it needs to be the camelized version
5454
// of the name of your storage.
55-
public function __construct(FilesystemInterface $defaultStorage)
55+
public function __construct(FilesystemOperator $defaultStorage)
5656
{
5757
$this->storage = $defaultStorage;
5858
}
@@ -64,13 +64,13 @@ This means you have two way of using the defined storages:
6464
The same goes for controllers:
6565

6666
```php
67-
use League\Flysystem\FilesystemInterface;
67+
use League\Flysystem\FilesystemOperator;
6868
6969
class MyController
7070
{
7171
// The variable name $defaultStorage matters: it needs to be the camelized version
7272
// of the name of your storage.
73-
public function index(FilesystemInterface $defaultStorage)
73+
public function index(FilesystemOperator $defaultStorage)
7474
{
7575
// ...
7676
}
@@ -80,8 +80,8 @@ This means you have two way of using the defined storages:
8080
* or using manual injection, by injecting the service named `default.storage` inside
8181
your services.
8282

83-
Once you have a FilesystemInterface, you can call methods from the
84-
[Filesystem API](https://flysystem.thephpleague.com/docs/usage/filesystem-api/)
83+
Once you have a FilesystemOperator, you can call methods from the
84+
[Filesystem API](https://flysystem.thephpleague.com/v2/docs/usage/filesystem-api/)
8585
to interact with your storage.
8686

8787

@@ -111,14 +111,14 @@ flysystem:
111111
```
112112

113113
```php
114-
use League\Flysystem\FilesystemInterface;
114+
use League\Flysystem\FilesystemOperator;
115115
116116
class MyService
117117
{
118118
private $usersStorage;
119119
private $projectsStorage;
120120
121-
public function __construct(FilesystemInterface $usersStorage, FilesystemInterface $projectsStorage)
121+
public function __construct(FilesystemOperator $usersStorage, FilesystemOperator $projectsStorage)
122122
{
123123
$this->usersStorage = $usersStorage;
124124
$this->projectsStorage = $projectsStorage;
@@ -160,7 +160,7 @@ flysystem:
160160
```
161161

162162
This configuration will swap every reference to the `users.storage` service (or to the
163-
`FilesystemInterface $usersStorage` typehint) from a local adapter to a memory one during tests.
163+
`FilesystemOperator $usersStorage` typehint) from a local adapter to a memory one during tests.
164164

165165
## Next
166166

docs/3-interacting-with-ftp-and-sftp-servers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Interacting with FTP and SFTP servers
22

3-
Flysystem is able to interact with FTP and SFTP servers using the same FilesystemInterface.
3+
Flysystem is able to interact with FTP and SFTP servers using the same FilesystemOperator.
44
To configure this bundle for such usage, you can rely on adapters in the same way you would
55
for other storages.
66

docs/5-using-lazy-adapter-to-switch-at-runtime.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ APP_UPLOADS_SOURCE=uploads.storage.memory
8686
Other than being created at runtime, the `lazy` adapter is behaving in the exact
8787
same way as any other storage:
8888

89-
* you can use it with autowiring, by typehinting against the `FilesystemInterface` and using the
89+
* you can use it with autowiring, by typehinting against the `FilesystemOperator` and using the
9090
variable name matching its name:
9191

9292
```php
93-
use League\Flysystem\FilesystemInterface;
93+
use League\Flysystem\FilesystemOperator;
9494
9595
class MyService
9696
{
9797
private $storage;
9898
99-
public function __construct(FilesystemInterface $uploadsStorage)
99+
public function __construct(FilesystemOperator $uploadsStorage)
100100
{
101101
$this->storage = $uploadsStorage;
102102
}

docs/6-creating-a-custom-adapter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ and then use it in your storages configuration.
88

99
## Creating the adapter class
1010

11-
A Flysystem adapter is a class implementing the `League\Flysystem\AdapterInterface` interface.
11+
A Flysystem adapter is a class implementing the `League\Flysystem\FilesystemAdapter` interface.
1212
To learn all the details about how to create this class, you can read the
13-
[library documentation](https://flysystem.thephpleague.com/docs/advanced/creating-an-adapter/).
13+
[library documentation](https://flysystem.thephpleague.com/v2/docs/advanced/creating-an-adapter/).
1414

1515
You can create this class everywhere you want in your application. We usually recommend a clear
1616
namespace and class name such as `App\Flysystem\MyCustomAdapter`.

tests/DependencyInjection/FlysystemExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testFileystems(string $fsName)
5555

5656
$fs = $container->get('flysystem.test.'.$fsName);
5757

58-
$this->assertInstanceOf(FilesystemOperator::class, $fs, 'Filesystem "'.$fsName.'" should be an instance of FilesystemInterface');
58+
$this->assertInstanceOf(FilesystemOperator::class, $fs, 'Filesystem "'.$fsName.'" should be an instance of FilesystemOperator');
5959
}
6060

6161
/**

0 commit comments

Comments
 (0)