1 | <?php |
||
14 | class FilesystemManager |
||
15 | { |
||
16 | use FilesystemManager\HasCloudDriverTrait; |
||
17 | use FilesystemManager\HasDisksTrait; |
||
18 | use FilesystemManager\HasCacheStoreTrait; |
||
19 | |||
20 | /** |
||
21 | * The application instance. |
||
22 | * |
||
23 | * @var \Nip\Application |
||
24 | */ |
||
25 | protected $app; |
||
26 | |||
27 | /** |
||
28 | * The registered custom driver creators. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $customCreators = []; |
||
33 | |||
34 | |||
35 | /** |
||
36 | * Create a new filesystem manager instance. |
||
37 | * |
||
38 | * @param \Nip\Application $app |
||
39 | */ |
||
40 | 2 | public function __construct($app = null) |
|
46 | |||
47 | /** |
||
48 | * Resolve the given disk. |
||
49 | * |
||
50 | * @param string $name |
||
51 | * @return FileDisk |
||
52 | * |
||
53 | * @throws \InvalidArgumentException |
||
54 | */ |
||
55 | protected function resolve($name) |
||
72 | |||
73 | /** |
||
74 | * Get the filesystem connection configuration. |
||
75 | * |
||
76 | * @param string $name |
||
77 | * @return array |
||
78 | */ |
||
79 | protected function getConfig($name) |
||
92 | |||
93 | /** |
||
94 | * Call a custom driver creator. |
||
95 | * |
||
96 | * @param array $config |
||
97 | * @return FileDisk |
||
98 | */ |
||
99 | protected function callCustomCreator(array $config) |
||
108 | |||
109 | /** |
||
110 | * Adapt the filesystem implementation. |
||
111 | * |
||
112 | * @param \League\Flysystem\FilesystemInterface $filesystem |
||
113 | * @return \League\Flysystem\FilesystemInterface|FileDisk |
||
114 | */ |
||
115 | 2 | protected function adapt(FilesystemInterface $filesystem) |
|
120 | |||
121 | /** |
||
122 | * Create an instance of the local driver. |
||
123 | * |
||
124 | * @param array $config |
||
125 | * @return \League\Flysystem\FilesystemInterface |
||
126 | */ |
||
127 | 2 | public function createLocalDriver($config) |
|
147 | |||
148 | /** |
||
149 | * Create a Flysystem instance with the given adapter. |
||
150 | * |
||
151 | * @param \League\Flysystem\AdapterInterface $adapter |
||
152 | * @param array $config |
||
153 | * @return FileDisk |
||
154 | */ |
||
155 | 2 | protected function createDisk(AdapterInterface $adapter, $config) |
|
163 | |||
164 | |||
165 | /** |
||
166 | * Set the given disk instance. |
||
167 | * |
||
168 | * @param string $name |
||
169 | * @param FileDisk $disk |
||
170 | * @return void |
||
171 | */ |
||
172 | public function set($name, $disk) |
||
176 | |||
177 | /** |
||
178 | * Get the default cloud driver name. |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | public function getDefaultCloudDriver() |
||
186 | } |
||
187 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: