1 | <?php |
||
18 | class GridFSAdapter extends AbstractAdapter |
||
19 | { |
||
20 | use NotSupportingVisibilityTrait; |
||
21 | use StreamedCopyTrait; |
||
22 | use StreamedReadingTrait; |
||
23 | |||
24 | /** |
||
25 | * @var MongoGridFs Mongo GridFS client |
||
26 | */ |
||
27 | protected $client; |
||
28 | |||
29 | /** |
||
30 | * Constructor. |
||
31 | * |
||
32 | * @param MongoGridFs $client |
||
33 | */ |
||
34 | public function __construct(MongoGridFs $client) |
||
38 | |||
39 | /** |
||
40 | * Get the MongoGridFs instance. |
||
41 | * |
||
42 | * @return MongoGridFs |
||
43 | */ |
||
44 | public function getClient() |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function has($path) |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function write($path, $contents, Config $config) |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function writeStream($path, $resource, Config $config) |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function update($path, $contents, Config $config) |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function updateStream($path, $resource, Config $config) |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function getMetadata($path) |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function getMimetype($path) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function getSize($path) |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function getTimestamp($path) |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function delete($path) |
||
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | public function read($path) |
||
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | public function rename($path, $newpath) |
||
161 | |||
162 | /** |
||
163 | * {@inheritdoc} |
||
164 | */ |
||
165 | public function createDir($path, Config $config) |
||
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | */ |
||
173 | public function deleteDir($path) |
||
183 | |||
184 | /** |
||
185 | * {@inheritdoc} |
||
186 | * |
||
187 | * @todo Implement recursive listing. |
||
188 | */ |
||
189 | public function listContents($dirname = '', $recursive = false) |
||
205 | |||
206 | /** |
||
207 | * Write an object to GridFS. |
||
208 | * |
||
209 | * @param array $metadata |
||
210 | * |
||
211 | * @return array normalized file representation |
||
212 | */ |
||
213 | protected function writeObject($path, $content, array $metadata) |
||
232 | |||
233 | /** |
||
234 | * Normalize a MongoGridFs file to a response. |
||
235 | * |
||
236 | * @param MongoGridFSFile $file |
||
237 | * @param string $path |
||
238 | * |
||
239 | * @return array |
||
240 | */ |
||
241 | protected function normalizeGridFSFile(MongoGridFSFile $file, $path = null) |
||
258 | |||
259 | /** |
||
260 | * Creates index on filename field |
||
261 | */ |
||
262 | protected function ensureIndex() |
||
276 | } |
||
277 |
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: