Skip to content

Commit

Permalink
Improve logic when parsing arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
u01jmg3 committed Mar 24, 2017
1 parent 33cb3a7 commit fdab738
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docx2md.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ function docx2md(array $args, $isTestMode = false) {
$docxFilename = null;
$mdFilename = null;

if (array_key_exists(0, $args) && $args[0] !== '') {
$docxFilename = $args[0];
}

if (array_key_exists(1, $args) && $args[1] !== '') {
$mdFilename = $args[1];
foreach ($args as $index => $arg) {
if ($index === 0) {
$docxFilename = $args[$index];
} else if ($index === 1) {
$mdFilename = $args[$index];
}
}

if (!file_exists($docxFilename)) {
Expand Down

0 comments on commit fdab738

Please sign in to comment.