26
26
27
27
use function array_intersect_key ;
28
28
use function is_integer ;
29
- use function is_string ;
30
29
use function MongoDB \is_document ;
31
- use function MongoDB \is_string_array ;
32
30
use function sprintf ;
33
31
use function strlen ;
34
32
use function substr ;
@@ -63,16 +61,9 @@ class WritableStream
63
61
*
64
62
* * _id (mixed): File document identifier. Defaults to a new ObjectId.
65
63
*
66
- * * aliases (array of strings): DEPRECATED An array of aliases.
67
- * Applications wishing to store aliases should add an aliases field to
68
- * the metadata document instead.
69
- *
70
64
* * chunkSizeBytes (integer): The chunk size in bytes. Defaults to
71
65
* 261120 (i.e. 255 KiB).
72
66
*
73
- * * contentType (string): DEPRECATED content type to be stored with the
74
- * file. This information should now be added to the metadata.
75
- *
76
67
* * metadata (document): User data for the "metadata" field of the files
77
68
* collection document.
78
69
*
@@ -88,10 +79,6 @@ public function __construct(private CollectionWrapper $collectionWrapper, string
88
79
'chunkSizeBytes ' => self ::DEFAULT_CHUNK_SIZE_BYTES ,
89
80
];
90
81
91
- if (isset ($ options ['aliases ' ]) && ! is_string_array ($ options ['aliases ' ])) {
92
- throw InvalidArgumentException::invalidType ('"aliases" option ' , $ options ['aliases ' ], 'array of strings ' );
93
- }
94
-
95
82
if (! is_integer ($ options ['chunkSizeBytes ' ])) {
96
83
throw InvalidArgumentException::invalidType ('"chunkSizeBytes" option ' , $ options ['chunkSizeBytes ' ], 'integer ' );
97
84
}
@@ -100,10 +87,6 @@ public function __construct(private CollectionWrapper $collectionWrapper, string
100
87
throw new InvalidArgumentException (sprintf ('Expected "chunkSizeBytes" option to be >= 1, %d given ' , $ options ['chunkSizeBytes ' ]));
101
88
}
102
89
103
- if (isset ($ options ['contentType ' ]) && ! is_string ($ options ['contentType ' ])) {
104
- throw InvalidArgumentException::invalidType ('"contentType" option ' , $ options ['contentType ' ], 'string ' );
105
- }
106
-
107
90
if (isset ($ options ['metadata ' ]) && ! is_document ($ options ['metadata ' ])) {
108
91
throw InvalidArgumentException::expectedDocumentType ('"metadata" option ' , $ options ['metadata ' ]);
109
92
}
@@ -115,7 +98,7 @@ public function __construct(private CollectionWrapper $collectionWrapper, string
115
98
'filename ' => $ filename ,
116
99
'length ' => null ,
117
100
'uploadDate ' => null ,
118
- ] + array_intersect_key ($ options , ['aliases ' => 1 , ' contentType ' => 1 , ' metadata ' => 1 ]);
101
+ ] + array_intersect_key ($ options , ['metadata ' => 1 ]);
119
102
}
120
103
121
104
/**
0 commit comments