mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-01-22 20:17:31 +00:00
Start adding return types
This commit is contained in:
parent
5c9abeb3b9
commit
58317fb17b
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Opdavies\GmailFilterBuilder\Service;
|
||||
|
||||
use Tightenco\Collect\Support\Collection;
|
||||
|
||||
/**
|
||||
* A service for loading addresses from separate files.
|
||||
*/
|
||||
|
@ -14,7 +16,7 @@ class Addresses
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function load($filename = 'my-addresses.php')
|
||||
public static function load(string $filename = 'my-addresses.php'): array
|
||||
{
|
||||
$file = (new static())->getDirectoryPaths()
|
||||
->map(function ($path) use ($filename) {
|
||||
|
@ -34,9 +36,9 @@ class Addresses
|
|||
/**
|
||||
* Get the potential directory names containing the addresses file.
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
* @return \Tightenco\Collect\Support\Collection
|
||||
*/
|
||||
protected function getDirectoryPaths()
|
||||
protected function getDirectoryPaths(): Collection
|
||||
{
|
||||
return collect([
|
||||
getenv('HOME') . DIRECTORY_SEPARATOR . '.gmail-filters' . DIRECTORY_SEPARATOR,
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Opdavies\Tests\GmailFilterBuilder\Service;
|
|||
|
||||
use Opdavies\GmailFilterBuilder\Service\Addresses;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tightenco\Collect\Support\Collection;
|
||||
|
||||
/**
|
||||
* Test loading addresses from a separate file.
|
||||
|
@ -29,7 +30,7 @@ class FakeAddresses extends Addresses
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getDirectoryPaths()
|
||||
protected function getDirectoryPaths(): Collection
|
||||
{
|
||||
return collect(__DIR__ . '/../../stubs/addresses/');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue