66
77use Closure ;
88use MongoDB \Collection ;
9- use MongoDB \Database ;
109use MongoDB \Driver \Exception \ServerException ;
1110use MongoDB \Laravel \Connection ;
1211use MongoDB \Model \CollectionInfo ;
1312use MongoDB \Model \IndexInfo ;
13+ use Override ;
1414
1515use function array_column ;
1616use function array_fill_keys ;
@@ -99,12 +99,14 @@ public function hasCollection($name)
9999 }
100100
101101 /** @inheritdoc */
102+ #[Override]
102103 public function hasTable ($ table )
103104 {
104105 return $ this ->hasCollection ($ table );
105106 }
106107
107108 /** @inheritdoc */
109+ #[Override]
108110 public function table ($ table , Closure $ callback )
109111 {
110112 $ blueprint = $ this ->createBlueprint ($ table );
@@ -115,6 +117,7 @@ public function table($table, Closure $callback)
115117 }
116118
117119 /** @inheritdoc */
120+ #[Override]
118121 public function create ($ table , ?Closure $ callback = null , array $ options = [])
119122 {
120123 $ blueprint = $ this ->createBlueprint ($ table );
@@ -127,6 +130,7 @@ public function create($table, ?Closure $callback = null, array $options = [])
127130 }
128131
129132 /** @inheritdoc */
133+ #[Override]
130134 public function dropIfExists ($ table )
131135 {
132136 if ($ this ->hasCollection ($ table )) {
@@ -135,6 +139,7 @@ public function dropIfExists($table)
135139 }
136140
137141 /** @inheritdoc */
142+ #[Override]
138143 public function drop ($ table )
139144 {
140145 $ blueprint = $ this ->createBlueprint ($ table );
@@ -151,18 +156,29 @@ public function drop($table)
151156 * one by one. The database will be automatically recreated when a new connection
152157 * writes to it.
153158 */
159+ #[Override]
154160 public function dropAllTables ()
155161 {
156162 $ this ->connection ->getDatabase ()->drop ();
157163 }
158164
159- /** @param string|null $schema Database name */
165+ /**
166+ * @param string|null $schema Database name
167+ *
168+ * @inheritdoc
169+ */
170+ #[Override]
160171 public function getTables ($ schema = null )
161172 {
162173 return $ this ->getCollectionRows ('collection ' , $ schema );
163174 }
164175
165- /** @param string|null $schema Database name */
176+ /**
177+ * @param string|null $schema Database name
178+ *
179+ * @inheritdoc
180+ */
181+ #[Override]
166182 public function getViews ($ schema = null )
167183 {
168184 return $ this ->getCollectionRows ('view ' , $ schema );
@@ -174,6 +190,7 @@ public function getViews($schema = null)
174190 *
175191 * @return array
176192 */
193+ #[Override]
177194 public function getTableListing ($ schema = null , $ schemaQualified = false )
178195 {
179196 $ collections = [];
@@ -197,6 +214,7 @@ public function getTableListing($schema = null, $schemaQualified = false)
197214 return $ collections ;
198215 }
199216
217+ #[Override]
200218 public function getColumns ($ table )
201219 {
202220 $ db = null ;
@@ -255,6 +273,7 @@ public function getColumns($table)
255273 return $ columns ;
256274 }
257275
276+ #[Override]
258277 public function getIndexes ($ table )
259278 {
260279 $ collection = $ this ->connection ->getDatabase ()->selectCollection ($ table );
@@ -309,12 +328,18 @@ public function getIndexes($table)
309328 return $ indexList ;
310329 }
311330
331+ #[Override]
312332 public function getForeignKeys ($ table )
313333 {
314334 return [];
315335 }
316336
317- /** @inheritdoc */
337+ /**
338+ * @return Blueprint
339+ *
340+ * @inheritdoc
341+ */
342+ #[Override]
318343 protected function createBlueprint ($ table , ?Closure $ callback = null )
319344 {
320345 return new Blueprint ($ this ->connection , $ table );
0 commit comments