@@ -123,7 +123,7 @@ public function __construct(string $path = '')
123123 * Set path to dump to.
124124 *
125125 * @param string $path
126- * @return \phpbu\App\Cli\Executable\ Mongodump
126+ * @return Mongodump
127127 */
128128 public function dumpToDirectory (string $ path ) : Mongodump
129129 {
@@ -135,7 +135,7 @@ public function dumpToDirectory(string $path) : Mongodump
135135 * Use ipv6 to connect.
136136 *
137137 * @param boolean $bool
138- * @return \phpbu\App\Cli\Executable\ Mongodump
138+ * @return Mongodump
139139 */
140140 public function useIpv6 (bool $ bool ) : Mongodump
141141 {
@@ -147,7 +147,7 @@ public function useIpv6(bool $bool) : Mongodump
147147 * Set uri to dump from
148148 *
149149 * @param string $uri
150- * @return \phpbu\App\Cli\Executable\ Mongodump
150+ * @return Mongodump
151151 */
152152 public function useUri (string $ uri ) : Mongodump
153153 {
@@ -159,7 +159,7 @@ public function useUri(string $uri) : Mongodump
159159 * Set host to dump from.
160160 *
161161 * @param string $host
162- * @return \phpbu\App\Cli\Executable\ Mongodump
162+ * @return Mongodump
163163 */
164164 public function useHost (string $ host ) : Mongodump
165165 {
@@ -173,7 +173,7 @@ public function useHost(string $host) : Mongodump
173173 * @param string $user
174174 * @param string $password
175175 * @param string $authDatabase
176- * @return \phpbu\App\Cli\Executable\ Mongodump
176+ * @return Mongodump
177177 */
178178 public function credentials (string $ user = '' , string $ password = '' , string $ authDatabase = '' ) : Mongodump
179179 {
@@ -187,7 +187,7 @@ public function credentials(string $user = '', string $password = '', string $au
187187 * Dump only given databases.
188188 *
189189 * @param array $databases
190- * @return \phpbu\App\Cli\Executable\ Mongodump
190+ * @return Mongodump
191191 */
192192 public function dumpDatabases (array $ databases ) : Mongodump
193193 {
@@ -199,7 +199,7 @@ public function dumpDatabases(array $databases) : Mongodump
199199 * Dump only given collections.
200200 *
201201 * @param array $collections
202- * @return \phpbu\App\Cli\Executable\ Mongodump
202+ * @return Mongodump
203203 */
204204 public function dumpCollections (array $ collections ) : Mongodump
205205 {
@@ -211,7 +211,7 @@ public function dumpCollections(array $collections) : Mongodump
211211 * Exclude collections.
212212 *
213213 * @param array $collections
214- * @return \phpbu\App\Cli\Executable\ Mongodump
214+ * @return Mongodump
215215 */
216216 public function excludeCollections (array $ collections ) : Mongodump
217217 {
@@ -223,7 +223,7 @@ public function excludeCollections(array $collections) : Mongodump
223223 * Exclude collections with given prefixes.
224224 *
225225 * @param array $prefixes
226- * @return \phpbu\App\Cli\Executable\ Mongodump
226+ * @return Mongodump
227227 */
228228 public function excludeCollectionsWithPrefix (array $ prefixes ) : Mongodump
229229 {
@@ -234,8 +234,8 @@ public function excludeCollectionsWithPrefix(array $prefixes) : Mongodump
234234 /**
235235 * Mongodump CommandLine generator.
236236 *
237- * @return \SebastianFeldmann\Cli\ CommandLine
238- * @throws \phpbu\App\ Exception
237+ * @return CommandLine
238+ * @throws Exception
239239 */
240240 protected function createCommandLine () : CommandLine
241241 {
@@ -246,28 +246,26 @@ protected function createCommandLine() : CommandLine
246246 $ cmd = new Cmd ($ this ->binary );
247247 $ process ->addCommand ($ cmd );
248248
249- $ cmd ->addOption ('--out ' , $ this ->dumpDir , ' ' );
249+ $ cmd ->addOption ('--out ' , $ this ->dumpDir );
250250 $ cmd ->addOptionIfNotEmpty ('--ipv6 ' , $ this ->useIPv6 , false );
251- $ cmd ->addOptionIfNotEmpty ('--uri ' , $ this ->uri , true , ' ' );
252- $ cmd ->addOptionIfNotEmpty ('--host ' , $ this ->host , true , ' ' );
253- $ cmd ->addOptionIfNotEmpty ('--username ' , $ this ->user , true , ' ' );
254- $ cmd ->addOptionIfNotEmpty ('--password ' , $ this ->password , true , ' ' );
255- $ cmd ->addOptionIfNotEmpty ('--authenticationDatabase ' , $ this ->authenticationDatabase , true , ' ' );
251+ $ cmd ->addOptionIfNotEmpty ('--uri ' , $ this ->uri );
252+ $ cmd ->addOptionIfNotEmpty ('--host ' , $ this ->host );
253+ $ cmd ->addOptionIfNotEmpty ('--username ' , $ this ->user );
254+ $ cmd ->addOptionIfNotEmpty ('--password ' , $ this ->password );
255+ $ cmd ->addOptionIfNotEmpty ('--authenticationDatabase ' , $ this ->authenticationDatabase );
256256
257- if (count ($ this ->databases )) {
258- foreach ($ this ->databases as $ db ) {
259- $ cmd ->addOption ('--db ' , $ db , ' ' );
260- }
257+ foreach ($ this ->databases as $ db ) {
258+ $ cmd ->addOption ('--db ' , $ db );
261259 }
262-
263- if (count ($ this ->collections )) {
264- foreach ($ this ->collections as $ col ) {
265- $ cmd ->addOption ('--collection ' , $ col , ' ' );
266- }
260+ foreach ($ this ->collections as $ col ) {
261+ $ cmd ->addOption ('--collection ' , $ col );
262+ }
263+ foreach ($ this ->excludeCollections as $ col ) {
264+ $ cmd ->addOption ('--excludeCollection ' , $ col );
265+ }
266+ foreach ($ this ->excludeCollectionsWithPrefix as $ col ) {
267+ $ cmd ->addOption ('--excludeCollectionWithPrefix ' , $ col );
267268 }
268-
269- $ cmd ->addOptionIfNotEmpty ('--excludeCollection ' , $ this ->excludeCollections );
270- $ cmd ->addOptionIfNotEmpty ('--excludeCollectionWithPrefix ' , $ this ->excludeCollectionsWithPrefix );
271269
272270 return $ process ;
273271 }
0 commit comments