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,8 @@ public function getTableListing($schema = null, $schemaQualified = false)
197214 return $ collections ;
198215 }
199216
217+ /** @inheritdoc */
218+ #[Override]
200219 public function getColumns ($ table )
201220 {
202221 $ db = null ;
@@ -255,6 +274,8 @@ public function getColumns($table)
255274 return $ columns ;
256275 }
257276
277+ /** @inheritdoc */
278+ #[Override]
258279 public function getIndexes ($ table )
259280 {
260281 $ collection = $ this ->connection ->getDatabase ()->selectCollection ($ table );
@@ -309,12 +330,19 @@ public function getIndexes($table)
309330 return $ indexList ;
310331 }
311332
333+ /** @inheritdoc */
334+ #[Override]
312335 public function getForeignKeys ($ table )
313336 {
314337 return [];
315338 }
316339
317- /** @inheritdoc */
340+ /**
341+ * @return Blueprint
342+ *
343+ * @inheritdoc
344+ */
345+ #[Override]
318346 protected function createBlueprint ($ table , ?Closure $ callback = null )
319347 {
320348 return new Blueprint ($ this ->connection , $ table );
0 commit comments