mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-11-12 05:18:45 +00:00
parent
db97fb8d60
commit
fbe1edf8f0
3 changed files with 18 additions and 3 deletions
5
src/Exception/PartialNotFoundException.php
Normal file
5
src/Exception/PartialNotFoundException.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Opdavies\GmailFilterBuilder\Exception;
|
||||
|
||||
class PartialNotFoundException extends \RuntimeException {}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Opdavies\GmailFilterBuilder\Service;
|
||||
|
||||
use Opdavies\GmailFilterBuilder\Exception\PartialNotFoundException;
|
||||
use Tightenco\Collect\Support\Collection;
|
||||
|
||||
/**
|
||||
|
|
@ -26,11 +27,13 @@ class Addresses
|
|||
return file_exists($file);
|
||||
});
|
||||
|
||||
if ($file) {
|
||||
return include $file;
|
||||
if (!$file) {
|
||||
throw new PartialNotFoundException(vsprintf('%s does not exist.', [
|
||||
$filename,
|
||||
]));
|
||||
}
|
||||
|
||||
return [];
|
||||
return include $file;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue