Skip to content

Commit

Permalink
Small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maartendekeizer committed Nov 20, 2023
1 parent 373712a commit 8e56da3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Command/BackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (file_exists(dirname($profile->logFile)) === false) {
mkdir(dirname($profile->logFile), 0777, true);
}
$profileLogger = $profileLogger->withStream(fopen($profile->logFile, 'a'));
if ($profile->logFile) {
$profileLogger = $profileLogger->withStream(fopen($profile->logFile, 'a'));
}
}

try {
Expand Down
4 changes: 3 additions & 1 deletion src/Command/CleanUpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (file_exists(dirname($profile->logFile)) === false) {
mkdir(dirname($profile->logFile), 0777, true);
}
$profileLogger = $profileLogger->withStream(fopen($profile->logFile, 'a'));
if ($profile->logFile) {
$profileLogger = $profileLogger->withStream(fopen($profile->logFile, 'a'));
}
}

try {
Expand Down
2 changes: 1 addition & 1 deletion src/Profile/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function fromArray(array $data): self
TargetFactory::fromArray($data['target']),
RetentionFactory::fromArray($data['retention']),
NotificationFactory::fromArray($data['notifications']),
$data['log']
$data['log'] ?? null
);
}
}
2 changes: 2 additions & 0 deletions src/Profile/Tmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public function __construct(

public static function fromArray(array $data): self
{
$data['mode'] = $data['mode'] ?? '0777';

return new self($data['path'], intval($data['mode']));
}
}

0 comments on commit 8e56da3

Please sign in to comment.