@@ -332,17 +332,17 @@ protected function resolveOptions(string $url, array $options): void {
332332 }
333333
334334 $ this ->remoteUrl = $ url ;
335- $ this ->now = empty ($ options ['now ' ]) ? time () : (int ) $ options ['now ' ];
335+ $ this ->now = empty ($ options ['now ' ]) ? time () : (is_scalar ( $ options [ ' now ' ]) ? ( int ) $ options ['now ' ] : time ()) ;
336336 $ this ->remoteName = sprintf ('%s-%s-%s ' , self ::GIT_REMOTE_NAME , $ this ->now , rand (1000 , 9999 ));
337337 $ this ->showChanges = !empty ($ options ['show-changes ' ]);
338338 $ this ->needCleanup = empty ($ options ['no-cleanup ' ]);
339339 $ this ->isDryRun = !empty ($ options ['dry-run ' ]);
340340 $ this ->failOnMissingBranch = !empty ($ options ['fail-on-missing-branch ' ]);
341- $ this ->logFile = empty ($ options ['log ' ]) ? '' : $ this ->fsGetAbsolutePath ($ options ['log ' ]);
341+ $ this ->logFile = empty ($ options ['log ' ]) || ! is_string ( $ options [ ' log ' ]) ? '' : $ this ->fsGetAbsolutePath ($ options ['log ' ]);
342342
343- $ this ->setMode ($ options ['mode ' ], $ options );
343+ $ this ->setMode (is_string ( $ options ['mode ' ]) ? $ options [ ' mode ' ] : '' , $ options );
344344
345- $ this ->sourceDir = empty ($ options ['src ' ]) ? $ this ->fsGetRootDir () : $ this ->fsGetAbsolutePath ($ options ['src ' ]);
345+ $ this ->sourceDir = empty ($ options ['src ' ]) || ! is_string ( $ options [ ' src ' ]) ? $ this ->fsGetRootDir () : $ this ->fsGetAbsolutePath ($ options ['src ' ]);
346346
347347 // Setup Git repository from source path.
348348 $ this ->repo = new ArtifactGitRepository ($ this ->sourceDir , NULL , $ this ->logger );
@@ -371,17 +371,17 @@ protected function resolveOptions(string $url, array $options): void {
371371 return ;
372372 }
373373
374- $ branch = $ this ->tokenProcess ($ options ['branch ' ]);
374+ $ branch = $ this ->tokenProcess (is_string ( $ options ['branch ' ]) ? $ options [ ' branch ' ] : '' );
375375 if (!ArtifactGitRepository::isValidBranchName ($ branch )) {
376376 throw new \RuntimeException (sprintf ('Incorrect value "%s" specified for git remote branch ' , $ branch ));
377377 }
378378 $ this ->destinationBranch = $ branch ;
379379
380380 $ this ->artifactBranch = $ this ->destinationBranch . '-artifact ' ;
381381
382- $ this ->commitMessage = $ this ->tokenProcess ($ options ['message ' ]);
382+ $ this ->commitMessage = $ this ->tokenProcess (is_string ( $ options ['message ' ]) ? $ options [ ' message ' ] : '' );
383383
384- if (!empty ($ options ['gitignore ' ])) {
384+ if (!empty ($ options ['gitignore ' ]) && is_string ( $ options [ ' gitignore ' ]) ) {
385385 $ gitignore = $ this ->fsGetAbsolutePath ($ options ['gitignore ' ]);
386386 $ this ->fsAssertPathsExist ($ gitignore );
387387
0 commit comments