Skip to content

Commit 84cc34b

Browse files
author
Eugene Matvejev
authored
Merge pull request #38 from eugene-matvejev/improved_file_attaching
RC5 - improved file attaching
2 parents af6a350 + 21f4c13 commit 84cc34b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Processor/Processor.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,12 @@ public function attachFiles($inputPath, $outputPath)
7171
unset($files[0], $files[1]);
7272

7373
foreach ($files as $file) {
74-
$absolutePath = "$inputPath/$file";
75-
if (is_file($absolutePath)) {
76-
$this->files[] = new File($absolutePath, $outputPath);
77-
} else {
78-
$this->attachFiles($absolutePath, $outputPath);
79-
}
74+
$this->attachFiles("$inputPath/$file", $outputPath);
8075
}
8176
} else if (is_file($inputPath)) {
8277
$this->files[] = new File($inputPath, $outputPath);
8378
} else {
84-
throw new \Exception('file doesn\'t exists');
79+
throw new \Exception("file doesn't exists");
8580
}
8681
}
8782

0 commit comments

Comments
 (0)