diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php deleted file mode 100644 index e216896..0000000 --- a/.php-cs-fixer.php +++ /dev/null @@ -1,21 +0,0 @@ -notPath('vendor') - ->notPath('bootstrap') - ->notPath('storage') - ->in(__DIR__) - ->name('*.php') - ->notName('*.blade.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -$config = new PhpCsFixer\Config(); - -return $config->setRules([ - '@PSR12' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'no_unused_imports' => true, - ]) - ->setFinder($finder); diff --git a/README.md b/README.md index d283701..2d98f53 100644 --- a/README.md +++ b/README.md @@ -464,7 +464,7 @@ For full details please see the [self-hosting instructions file](SELF-HOSTING.md ## My sponsors -Thanks to [Vlad Timofeev](https://github.com/vlad-timofeev), [Patrick Dobler](https://github.com/patrickdobler), [Luca Steeb](https://github.com/steebchen), [Laiteux](https://github.com/Laiteux) and [narolinus](https://github.com/narolinus) for supporting me by sponsoring the project on GitHub! +Thanks to [Vlad Timofeev](https://github.com/vlad-timofeev), [Patrick Dobler](https://github.com/patrickdobler), [Luca Steeb](https://github.com/steebchen), [Laiteux](https://github.com/Laiteux), [narolinus](https://github.com/narolinus) and [Limon Monte](https://github.com/limonte) for supporting me by sponsoring the project on GitHub! Also an extra special thanks to [CrazyMax](https://github.com/crazy-max) for sponsoring me and also creating and maintaining the awesome [AnonAddy Docker image](https://github.com/anonaddy/docker)! diff --git a/app/Console/Commands/CheckDomainsMxValidation.php b/app/Console/Commands/CheckDomainsMxValidation.php index ecacc06..249e713 100644 --- a/app/Console/Commands/CheckDomainsMxValidation.php +++ b/app/Console/Commands/CheckDomainsMxValidation.php @@ -44,7 +44,7 @@ class CheckDomainsMxValidation extends Command try { if (! $domain->checkMxRecords()) { // Notify user via email only if domain's MX previously were valid - if (!is_null($domain->domain_mx_validated_at)) { + if (! is_null($domain->domain_mx_validated_at)) { $domain->user->notify(new DomainMxRecordsInvalid($domain->domain)); } diff --git a/app/Console/Commands/CreateUser.php b/app/Console/Commands/CreateUser.php index 660a5e7..0fe8d40 100644 --- a/app/Console/Commands/CreateUser.php +++ b/app/Console/Commands/CreateUser.php @@ -49,40 +49,41 @@ class CreateUser extends Command { $validator = Validator::make([ 'username' => $this->argument('username'), - 'email' => $this->argument('email')], [ - 'username' => [ - 'required', - 'regex:/^[a-zA-Z0-9]*$/', - 'max:20', - 'unique:usernames,username', - new NotDeletedUsername() - ], - 'email' => [ - 'required', - 'email:rfc,dns', - 'max:254', - new RegisterUniqueRecipient(), - new NotLocalRecipient() - ], - ]); + 'email' => $this->argument('email'), ], [ + 'username' => [ + 'required', + 'regex:/^[a-zA-Z0-9]*$/', + 'max:20', + 'unique:usernames,username', + new NotDeletedUsername(), + ], + 'email' => [ + 'required', + 'email:rfc,dns', + 'max:254', + new RegisterUniqueRecipient(), + new NotLocalRecipient(), + ], + ]); if ($validator->fails()) { $errors = $validator->errors(); foreach ($errors->all() as $message) { $this->error($message); } + return 1; } $userId = Uuid::uuid4(); $recipient = Recipient::create([ 'email' => $this->argument('email'), - 'user_id' => $userId + 'user_id' => $userId, ]); $username = Username::create([ 'username' => $this->argument('username'), - 'user_id' => $userId + 'user_id' => $userId, ]); $twoFactor = app('pragmarx.google2fa'); @@ -92,7 +93,7 @@ class CreateUser extends Command 'default_username_id' => $username->id, 'default_recipient_id' => $recipient->id, 'password' => Hash::make($userId), - 'two_factor_secret' => $twoFactor->generateSecretKey() + 'two_factor_secret' => $twoFactor->generateSecretKey(), ]); event(new Registered($user)); diff --git a/app/Console/Commands/ListUsers.php b/app/Console/Commands/ListUsers.php index a701080..7449ea7 100644 --- a/app/Console/Commands/ListUsers.php +++ b/app/Console/Commands/ListUsers.php @@ -81,7 +81,7 @@ class ListUsers extends Command 'username' => $user->defaultUsername->username, 'bandwidth' => $user->bandwidth, 'created_at' => $user->created_at, - 'updated_at' => $user->updated_at + 'updated_at' => $user->updated_at, ]; }); diff --git a/app/Console/Commands/ReceiveEmail.php b/app/Console/Commands/ReceiveEmail.php index cc15b28..8ff0ef0 100644 --- a/app/Console/Commands/ReceiveEmail.php +++ b/app/Console/Commands/ReceiveEmail.php @@ -44,8 +44,11 @@ class ReceiveEmail extends Command * @var string */ protected $description = 'Receive email from postfix pipe'; + protected $parser; + protected $senderFrom; + protected $size; /** @@ -87,7 +90,7 @@ class ReceiveEmail extends Command } // First determine if the alias already exists in the database - if ($alias = Alias::firstWhere('email', $recipient['local_part'] . '@' . $recipient['domain'])) { + if ($alias = Alias::firstWhere('email', $recipient['local_part'].'@'.$recipient['domain'])) { $user = $alias->user; if ($alias->aliasable_id) { @@ -101,17 +104,18 @@ class ReceiveEmail extends Command }) ->first(); - if (!empty($parentDomain)) { + if (! empty($parentDomain)) { // It is standard or username alias - $subdomain = substr($recipient['domain'], 0, strrpos($recipient['domain'], '.' . $parentDomain)); // e.g. johndoe + $subdomain = substr($recipient['domain'], 0, strrpos($recipient['domain'], '.'.$parentDomain)); // e.g. johndoe if ($subdomain === 'unsubscribe') { $this->handleUnsubscribe($recipient); + continue; } // Check if this is an username or standard alias - if (!empty($subdomain)) { + if (! empty($subdomain)) { $username = Username::where('username', $subdomain)->first(); $user = $username->user; $aliasable = $username; @@ -124,13 +128,13 @@ class ReceiveEmail extends Command } } - if (!isset($user) && !empty(config('anonaddy.admin_username'))) { + if (! isset($user) && ! empty(config('anonaddy.admin_username'))) { $user = Username::where('username', config('anonaddy.admin_username'))->first()?->user; } } // If there is still no user or the user has no verified default recipient then continue. - if (!isset($user) || !$user->hasVerifiedDefaultRecipient()) { + if (! isset($user) || ! $user->hasVerifiedDefaultRecipient()) { continue; } @@ -203,11 +207,11 @@ class ReceiveEmail extends Command { if (is_null($alias)) { $alias = $user->aliases()->create([ - 'email' => $recipient['local_part'] . '@' . $recipient['domain'], + 'email' => $recipient['local_part'].'@'.$recipient['domain'], 'local_part' => $recipient['local_part'], 'domain' => $recipient['domain'], 'aliasable_id' => $aliasable?->id, - 'aliasable_type' => $aliasable ? 'App\\Models\\' . class_basename($aliasable) : null + 'aliasable_type' => $aliasable ? 'App\\Models\\'.class_basename($aliasable) : null, ]); // Hydrate all alias fields @@ -228,11 +232,11 @@ class ReceiveEmail extends Command if (is_null($alias)) { // This is a new alias $alias = new Alias([ - 'email' => $recipient['local_part'] . '@' . $recipient['domain'], + 'email' => $recipient['local_part'].'@'.$recipient['domain'], 'local_part' => $recipient['local_part'], 'domain' => $recipient['domain'], 'aliasable_id' => $aliasable?->id, - 'aliasable_type' => $aliasable ? 'App\\Models\\' . class_basename($aliasable) : null + 'aliasable_type' => $aliasable ? 'App\\Models\\'.class_basename($aliasable) : null, ]); if ($user->hasExceededNewAliasLimit()) { @@ -248,11 +252,11 @@ class ReceiveEmail extends Command $recipientIds = $user ->recipients() - ->select(['id','email_verified_at']) + ->select(['id', 'email_verified_at']) ->oldest() ->get() ->filter(function ($item, $key) use ($keys) { - return in_array($key + 1, $keys) && !is_null($item['email_verified_at']); + return in_array($key + 1, $keys) && ! is_null($item['email_verified_at']); }) ->pluck('id') ->take(10) @@ -296,7 +300,7 @@ class ReceiveEmail extends Command // First check in DB $postfixQueueId = PostfixQueueId::firstWhere('queue_id', strtoupper($dsn['X-postfix-queue-id'])); - if (!$postfixQueueId) { + if (! $postfixQueueId) { exit(0); } @@ -332,7 +336,7 @@ class ReceiveEmail extends Command // Try to find a user from the bounced email address if ($recipient = Recipient::select(['id', 'user_id', 'email', 'email_verified_at'])->get()->firstWhere('email', $bouncedEmailAddress)) { - if (!isset($user)) { + if (! isset($user)) { $user = $recipient->user; } } @@ -350,11 +354,11 @@ class ReceiveEmail extends Command if (isset($undeliveredMessageHeaders['Feedback-id'])) { $parts = explode(':', $undeliveredMessageHeaders['Feedback-id']); - if (in_array($parts[0], ['F', 'R', 'S']) && !isset($alias)) { + if (in_array($parts[0], ['F', 'R', 'S']) && ! isset($alias)) { $alias = Alias::find($parts[1]); // Find the user from the alias if we don't have it from the recipient - if (!isset($user) && isset($alias)) { + if (! isset($user) && isset($alias)) { $user = $alias->user; } } @@ -385,7 +389,7 @@ class ReceiveEmail extends Command 'email_type' => $parts[0] ?? null, 'status' => $dsn['Status'] ?? null, 'code' => $diagnosticCode, - 'attempted_at' => $postfixQueueId->created_at + 'attempted_at' => $postfixQueueId->created_at, ]); if (isset($alias)) { @@ -452,7 +456,7 @@ class ReceiveEmail extends Command 'email' => $item, 'local_part' => strtolower($this->option('local_part')[$key]), 'extension' => $this->option('extension')[$key], - 'domain' => strtolower($this->option('domain')[$key]) + 'domain' => strtolower($this->option('domain')[$key]), ]; }); } @@ -472,7 +476,7 @@ class ReceiveEmail extends Command try { mailparse_rfc822_parse_addresses($value); } catch (\Exception $e) { - $part['headers']['from'] = str_replace("\\", "", $part['headers']['from']); + $part['headers']['from'] = str_replace('\\', '', $part['headers']['from']); $mimePart->setPart($part); } } @@ -483,7 +487,7 @@ class ReceiveEmail extends Command if ($file == 'stream') { $fd = fopen('php://stdin', 'r'); $this->rawEmail = ''; - while (!feof($fd)) { + while (! feof($fd)) { $this->rawEmail .= fread($fd, 1024); } fclose($fd); @@ -491,6 +495,7 @@ class ReceiveEmail extends Command } else { $parser->setPath($file); } + return $parser; } @@ -508,7 +513,7 @@ class ReceiveEmail extends Command $result[$key] = trim($matches[2]); } } elseif (preg_match('/^\s+(.+)\s*/', $line) && isset($key)) { - $result[$key] .= ' ' . $line; + $result[$key] .= ' '.$line; } } @@ -521,7 +526,7 @@ class ReceiveEmail extends Command return 'hard'; } - if (preg_match("/(:?spam|unsolicited|blacklisting|blacklisted|blacklist|554|mail content denied|reject for policy reason|mail rejected by destination domain|security issue)/i", $code)) { + if (preg_match('/(:?spam|unsolicited|blacklisting|blacklisted|blacklist|554|mail content denied|reject for policy reason|mail rejected by destination domain|security issue)/i', $code)) { return 'spam'; } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 4b9716b..8d86b4e 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel * @var array */ protected $commands = [ - 'App\Console\Commands\ResetBandwidth' + 'App\Console\Commands\ResetBandwidth', ]; /** diff --git a/app/CustomMailDriver/CustomMailManager.php b/app/CustomMailDriver/CustomMailManager.php index f7ca3b8..75f9104 100644 --- a/app/CustomMailDriver/CustomMailManager.php +++ b/app/CustomMailDriver/CustomMailManager.php @@ -10,7 +10,7 @@ class CustomMailManager extends MailManager /** * Resolve the given mailer. * - * @param string $name + * @param string $name * @return Mailer */ protected function resolve($name): CustomMailer diff --git a/app/CustomMailDriver/CustomMailer.php b/app/CustomMailDriver/CustomMailer.php index ba60246..ca8cc3b 100644 --- a/app/CustomMailDriver/CustomMailer.php +++ b/app/CustomMailDriver/CustomMailer.php @@ -23,7 +23,7 @@ class CustomMailer extends Mailer /** * Send a new message using a view. * - * @param MailableContract|string|array $view + * @param MailableContract|string|array $view * @param array $data * @param \Closure|string|null $callback * @return SentMessage|null @@ -67,7 +67,7 @@ class CustomMailer extends Mailer $recipient = Recipient::find($data['recipientId']); try { - $encrypter = new OpenPGPEncrypter(config('anonaddy.signing_key_fingerprint'), $data['fingerprint'], "~/.gnupg", $recipient->protected_headers); + $encrypter = new OpenPGPEncrypter(config('anonaddy.signing_key_fingerprint'), $data['fingerprint'], '~/.gnupg', $recipient->protected_headers); } catch (RuntimeException $e) { info($e->getMessage()); $encrypter = null; @@ -114,7 +114,7 @@ class CustomMailer extends Mailer 'Subject', 'Date', 'Original-Sender', - 'Sender' + 'Sender', ])->toArray(); $signedEmail = $dkimSigner->sign($symfonyMessage, $options); $symfonyMessage->setHeaders($signedEmail->getHeaders()); @@ -130,10 +130,10 @@ class CustomMailer extends Mailer try { // Get Postfix Queue ID and save in DB - $id = str_replace("\r\n", "", Str::after($sentMessage->getDebug(), 'Ok: queued as ')); + $id = str_replace("\r\n", '', Str::after($sentMessage->getDebug(), 'Ok: queued as ')); PostfixQueueId::create([ - 'queue_id' => $id + 'queue_id' => $id, ]); } catch (QueryException $e) { // duplicate entry diff --git a/app/CustomMailDriver/Mime/Crypto/OpenPGPEncrypter.php b/app/CustomMailDriver/Mime/Crypto/OpenPGPEncrypter.php index 0ee6855..02cbd2e 100644 --- a/app/CustomMailDriver/Mime/Crypto/OpenPGPEncrypter.php +++ b/app/CustomMailDriver/Mime/Crypto/OpenPGPEncrypter.php @@ -10,6 +10,7 @@ use Symfony\Component\Mime\Email; class OpenPGPEncrypter { protected $gnupg = null; + protected $usesProtectedHeaders; /** @@ -53,18 +54,17 @@ class OpenPGPEncrypter */ protected $gnupgHome = null; - public function __construct($signingKey = null, $recipientKey = null, $gnupgHome = null, $usesProtectedHeaders = false) { $this->initGNUPG(); - $this->signingKey = $signingKey; + $this->signingKey = $signingKey; $this->recipientKey = $recipientKey; - $this->gnupgHome = $gnupgHome; + $this->gnupgHome = $gnupgHome; $this->usesProtectedHeaders = $usesProtectedHeaders; } /** - * @param string $micalg + * @param string $micalg */ public function setMicalg($micalg) { @@ -73,14 +73,14 @@ class OpenPGPEncrypter /** * @param $identifier - * @param null $passPhrase + * @param null $passPhrase * * @throws RuntimeException */ public function addSignature($identifier, $keyFingerprint = null, $passPhrase = null) { - if (!$keyFingerprint) { - $keyFingerprint = $this->getKey($identifier, 'sign'); + if (! $keyFingerprint) { + $keyFingerprint = $this->getKey($identifier, 'sign'); } $this->signingKey = $keyFingerprint; @@ -97,13 +97,12 @@ class OpenPGPEncrypter */ public function addKeyPassphrase($identifier, $passPhrase) { - $keyFingerprint = $this->getKey($identifier, 'sign'); + $keyFingerprint = $this->getKey($identifier, 'sign'); $this->keyPassphrases[$keyFingerprint] = $passPhrase; } /** - * @param Email $email - * + * @param Email $email * @return $this * * @throws RuntimeException @@ -117,19 +116,19 @@ class OpenPGPEncrypter $boundary = strtr(base64_encode(random_bytes(6)), '+/', '-_'); $headers->setHeaderBody('Parameterized', 'Content-Type', 'multipart/signed'); - $headers->setHeaderParameter('Content-Type', 'micalg', sprintf("pgp-%s", strtolower($this->micalg))); + $headers->setHeaderParameter('Content-Type', 'micalg', sprintf('pgp-%s', strtolower($this->micalg))); $headers->setHeaderParameter('Content-Type', 'protocol', 'application/pgp-signature'); $headers->setHeaderParameter('Content-Type', 'boundary', $boundary); $message->setHeaders($headers); - if (!$this->signingKey) { + if (! $this->signingKey) { foreach ($message->getFrom() as $key => $value) { $this->addSignature($this->getKey($key, 'sign')); } } - if (!$this->signingKey) { + if (! $this->signingKey) { throw new RuntimeException('Signing has been enabled, but no signature has been added. Use autoAddSignature() or addSignature()'); } @@ -143,7 +142,7 @@ class OpenPGPEncrypter // Check if using protected headers or not if ($this->usesProtectedHeaders) { $protectedHeadersSet = false; - for ($i=0; $igetHeaders()->get('content-type')->toString(), $body); - if (!$this->recipientKey) { + if (! $this->recipientKey) { throw new RuntimeException('Encryption has been enabled, but no recipients have been added. Use autoAddRecipients() or addRecipient()'); } @@ -207,25 +206,24 @@ class OpenPGPEncrypter } /** - * @param Email $email - * + * @param Email $email * @return $this * * @throws RuntimeException */ public function encryptInline(Email $message): Email { - if (!$this->signingKey) { + if (! $this->signingKey) { foreach ($message->getFrom() as $key => $value) { $this->addSignature($this->getKey($key, 'sign')); } } - if (!$this->signingKey) { + if (! $this->signingKey) { throw new RuntimeException('Signing has been enabled, but no signature has been added. Use autoAddSignature() or addSignature()'); } - if (!$this->recipientKey) { + if (! $this->recipientKey) { throw new RuntimeException('Encryption has been enabled, but no recipients have been added. Use autoAddRecipients() or addRecipient()'); } @@ -246,19 +244,19 @@ class OpenPGPEncrypter */ protected function initGNUPG() { - if (!class_exists('gnupg')) { + if (! class_exists('gnupg')) { throw new RuntimeException('PHPMailerPGP requires the GnuPG class'); } - if (!$this->gnupgHome && isset($_SERVER['HOME'])) { - $this->gnupgHome = $_SERVER['HOME'] . '/.gnupg'; + if (! $this->gnupgHome && isset($_SERVER['HOME'])) { + $this->gnupgHome = $_SERVER['HOME'].'/.gnupg'; } - if (!$this->gnupgHome && getenv('HOME')) { - $this->gnupgHome = getenv('HOME') . '/.gnupg'; + if (! $this->gnupgHome && getenv('HOME')) { + $this->gnupgHome = getenv('HOME').'/.gnupg'; } - if (!$this->gnupg) { + if (! $this->gnupg) { $this->gnupg = new \gnupg(); } @@ -268,14 +266,13 @@ class OpenPGPEncrypter /** * @param $plaintext * @param $keyFingerprint - * * @return string * * @throws RuntimeException */ protected function pgpSignString($plaintext, $keyFingerprint) { - if (isset($this->keyPassphrases[$keyFingerprint]) && !$this->keyPassphrases[$keyFingerprint]) { + if (isset($this->keyPassphrases[$keyFingerprint]) && ! $this->keyPassphrases[$keyFingerprint]) { $passPhrase = $this->keyPassphrases[$keyFingerprint]; } else { $passPhrase = null; @@ -298,7 +295,6 @@ class OpenPGPEncrypter /** * @param $plaintext * @param $keyFingerprints - * * @return string * * @throws RuntimeException @@ -323,14 +319,13 @@ class OpenPGPEncrypter /** * @param $plaintext * @param $keyFingerprints - * * @return string * * @throws RuntimeException */ protected function pgpEncryptAndSignString($plaintext, $keyFingerprint, $signingKeyFingerprint) { - if (isset($this->keyPassphrases[$signingKeyFingerprint]) && !$this->keyPassphrases[$signingKeyFingerprint]) { + if (isset($this->keyPassphrases[$signingKeyFingerprint]) && ! $this->keyPassphrases[$signingKeyFingerprint]) { $passPhrase = $this->keyPassphrases[$signingKeyFingerprint]; } else { $passPhrase = null; @@ -354,14 +349,13 @@ class OpenPGPEncrypter /** * @param $identifier * @param $purpose - * * @return string * * @throws RuntimeException */ protected function getKey($identifier, $purpose) { - $keys = $this->gnupg->keyinfo($identifier); + $keys = $this->gnupg->keyinfo($identifier); $fingerprints = []; foreach ($keys as $key) { @@ -388,6 +382,6 @@ class OpenPGPEncrypter protected function isValidKey($key, $purpose) { - return !($key['disabled'] || $key['expired'] || $key['revoked'] || ($purpose == 'sign' && !$key['can_sign']) || ($purpose == 'encrypt' && !$key['can_encrypt'])); + return ! ($key['disabled'] || $key['expired'] || $key['revoked'] || ($purpose == 'sign' && ! $key['can_sign']) || ($purpose == 'encrypt' && ! $key['can_encrypt'])); } } diff --git a/app/CustomMailDriver/Mime/Encoder/RawContentEncoder.php b/app/CustomMailDriver/Mime/Encoder/RawContentEncoder.php index d9175f4..5849044 100644 --- a/app/CustomMailDriver/Mime/Encoder/RawContentEncoder.php +++ b/app/CustomMailDriver/Mime/Encoder/RawContentEncoder.php @@ -8,7 +8,7 @@ final class RawContentEncoder implements ContentEncoderInterface { public function encodeByteStream($stream, int $maxLineLength = 0): iterable { - while (!feof($stream)) { + while (! feof($stream)) { yield fread($stream, 8192); } } diff --git a/app/CustomMailDriver/Mime/Part/EncryptedPart.php b/app/CustomMailDriver/Mime/Part/EncryptedPart.php index e059b19..db3d772 100644 --- a/app/CustomMailDriver/Mime/Part/EncryptedPart.php +++ b/app/CustomMailDriver/Mime/Part/EncryptedPart.php @@ -13,16 +13,20 @@ class EncryptedPart extends AbstractPart protected $_headers; private $body; + private $charset; + private $subtype; + /** * @var ?string */ private $disposition; + private $seekable; /** - * @param resource|string $body + * @param resource|string $body */ public function __construct($body, ?string $charset = 'utf-8', string $subtype = 'plain') { @@ -30,7 +34,7 @@ class EncryptedPart extends AbstractPart parent::__construct(); - if (!\is_string($body) && !\is_resource($body)) { + if (! \is_string($body) && ! \is_resource($body)) { throw new \TypeError(sprintf('The body of "%s" must be a string or a resource (got "%s").', self::class, get_debug_type($body))); } diff --git a/app/CustomMailDriver/Validation/MessageIDValidation.php b/app/CustomMailDriver/Validation/MessageIDValidation.php index 6f1146b..0a40973 100644 --- a/app/CustomMailDriver/Validation/MessageIDValidation.php +++ b/app/CustomMailDriver/Validation/MessageIDValidation.php @@ -33,6 +33,7 @@ class MessageIDValidation implements EmailValidation // } } catch (\Exception $invalid) { $this->error = new InvalidEmail(new ExceptionFound($invalid), ''); + return false; } diff --git a/app/Exports/AliasesExport.php b/app/Exports/AliasesExport.php index f75ccf9..f756c67 100644 --- a/app/Exports/AliasesExport.php +++ b/app/Exports/AliasesExport.php @@ -8,8 +8,8 @@ use Maatwebsite\Excel\Concerns\WithHeadings; class AliasesExport implements FromCollection, WithHeadings { /** - * @return \Illuminate\Support\Collection - */ + * @return \Illuminate\Support\Collection + */ public function collection() { return user()->aliases()->withTrashed()->get(); diff --git a/app/Http/Controllers/Api/AccountDetailController.php b/app/Http/Controllers/Api/AccountDetailController.php index ed9e619..e1a6b04 100644 --- a/app/Http/Controllers/Api/AccountDetailController.php +++ b/app/Http/Controllers/Api/AccountDetailController.php @@ -10,7 +10,7 @@ class AccountDetailController extends Controller public function index() { return response()->json([ - 'data' => new UserResource(user()) + 'data' => new UserResource(user()), ]); } } diff --git a/app/Http/Controllers/Api/AliasController.php b/app/Http/Controllers/Api/AliasController.php index 63bfe21..55a96cf 100644 --- a/app/Http/Controllers/Api/AliasController.php +++ b/app/Http/Controllers/Api/AliasController.php @@ -83,23 +83,23 @@ class AliasController extends Controller } $data = [ - 'email' => $localPart . '@' . $request->domain, + 'email' => $localPart.'@'.$request->domain, 'local_part' => $localPart, - 'extension' => $extension ?? null + 'extension' => $extension ?? null, ]; } else { if ($request->input('format', 'random_characters') === 'random_words') { $localPart = user()->generateRandomWordLocalPart(); $data = [ - 'email' => $localPart . '@' . $request->domain, + 'email' => $localPart.'@'.$request->domain, 'local_part' => $localPart, ]; } elseif ($request->input('format', 'random_characters') === 'random_characters') { $localPart = user()->generateRandomCharacterLocalPart(8); $data = [ - 'email' => $localPart . '@' . $request->domain, + 'email' => $localPart.'@'.$request->domain, 'local_part' => $localPart, ]; } else { @@ -107,13 +107,12 @@ class AliasController extends Controller $data = [ 'id' => $uuid, - 'email' => $uuid . '@' . $request->domain, + 'email' => $uuid.'@'.$request->domain, 'local_part' => $uuid, ]; } } - // Check if domain is for username or custom domain $parentDomain = collect(config('anonaddy.all_domains')) ->filter(function ($name) use ($request) { @@ -195,7 +194,7 @@ class AliasController extends Controller 'emails_forwarded' => 0, 'emails_blocked' => 0, 'emails_replied' => 0, - 'emails_sent' => 0 + 'emails_sent' => 0, ]); // Soft delete to prevent from being regenerated diff --git a/app/Http/Controllers/Api/ApiTokenDetailController.php b/app/Http/Controllers/Api/ApiTokenDetailController.php index 8761d8a..0a2919f 100644 --- a/app/Http/Controllers/Api/ApiTokenDetailController.php +++ b/app/Http/Controllers/Api/ApiTokenDetailController.php @@ -18,7 +18,7 @@ class ApiTokenDetailController extends Controller return response()->json([ 'name' => $token->name, 'created_at' => $token->created_at?->toDateTimeString(), - 'expires_at' => $token->expires_at?->toDateTimeString() + 'expires_at' => $token->expires_at?->toDateTimeString(), ]); } } diff --git a/app/Http/Controllers/Api/DomainController.php b/app/Http/Controllers/Api/DomainController.php index 098af35..591c60d 100644 --- a/app/Http/Controllers/Api/DomainController.php +++ b/app/Http/Controllers/Api/DomainController.php @@ -33,7 +33,7 @@ class DomainController extends Controller $domain->domain = $request->domain; if (! $domain->checkVerification()) { - return response('Verification record not found, please add the following TXT record to your domain: aa-verify=' . sha1(config('anonaddy.secret') . user()->id . user()->domains->count()), 404); + return response('Verification record not found, please add the following TXT record to your domain: aa-verify='.sha1(config('anonaddy.secret').user()->id.user()->domains->count()), 404); } user()->domains()->save($domain); diff --git a/app/Http/Controllers/Api/DomainOptionController.php b/app/Http/Controllers/Api/DomainOptionController.php index 094b59b..cfcd2bf 100644 --- a/app/Http/Controllers/Api/DomainOptionController.php +++ b/app/Http/Controllers/Api/DomainOptionController.php @@ -11,7 +11,7 @@ class DomainOptionController extends Controller return response()->json([ 'data' => user()->domainOptions(), 'defaultAliasDomain' => user()->default_alias_domain, - 'defaultAliasFormat' => user()->default_alias_format + 'defaultAliasFormat' => user()->default_alias_format, ]); } } diff --git a/app/Http/Controllers/Api/FailedDeliveryController.php b/app/Http/Controllers/Api/FailedDeliveryController.php index 038d704..52bbffe 100644 --- a/app/Http/Controllers/Api/FailedDeliveryController.php +++ b/app/Http/Controllers/Api/FailedDeliveryController.php @@ -9,7 +9,7 @@ class FailedDeliveryController extends Controller { public function index() { - $failedDeliveries = user()->failedDeliveries()->with(['recipient:id,email','alias:id,email'])->latest(); + $failedDeliveries = user()->failedDeliveries()->with(['recipient:id,email', 'alias:id,email'])->latest(); return FailedDeliveryResource::collection($failedDeliveries->get()); } @@ -18,7 +18,7 @@ class FailedDeliveryController extends Controller { $failedDelivery = user()->failedDeliveries()->findOrFail($id); - return new FailedDeliveryResource($failedDelivery->load(['recipient:id,email','alias:id,email'])); + return new FailedDeliveryResource($failedDelivery->load(['recipient:id,email', 'alias:id,email'])); } public function destroy($id) diff --git a/app/Http/Controllers/Api/RecipientKeyController.php b/app/Http/Controllers/Api/RecipientKeyController.php index b835121..c00b688 100644 --- a/app/Http/Controllers/Api/RecipientKeyController.php +++ b/app/Http/Controllers/Api/RecipientKeyController.php @@ -21,13 +21,13 @@ class RecipientKeyController extends Controller $info = $this->gnupg->import($request->key_data); - if (!$info || !$info['fingerprint']) { + if (! $info || ! $info['fingerprint']) { return response('Key could not be imported', 404); } $recipient->update([ 'should_encrypt' => true, - 'fingerprint' => $info['fingerprint'] + 'fingerprint' => $info['fingerprint'], ]); return new RecipientResource($recipient->fresh()->load('aliases')); @@ -45,7 +45,7 @@ class RecipientKeyController extends Controller 'protected_headers' => false, 'inline_encryption' => false, 'protected_headers' => false, - 'fingerprint' => null + 'fingerprint' => null, ]); return response('', 204); diff --git a/app/Http/Controllers/Api/ReorderRuleController.php b/app/Http/Controllers/Api/ReorderRuleController.php index cd1de9e..30a51bf 100644 --- a/app/Http/Controllers/Api/ReorderRuleController.php +++ b/app/Http/Controllers/Api/ReorderRuleController.php @@ -14,7 +14,7 @@ class ReorderRuleController extends Controller $rule = Rule::findOrFail($id); $rule->update([ - 'order' => $key + 'order' => $key, ]); }); diff --git a/app/Http/Controllers/Api/RuleController.php b/app/Http/Controllers/Api/RuleController.php index f4e0026..8c06752 100644 --- a/app/Http/Controllers/Api/RuleController.php +++ b/app/Http/Controllers/Api/RuleController.php @@ -37,7 +37,7 @@ class RuleController extends Controller 'operator' => $request->operator, 'forwards' => $request->forwards ?? false, 'replies' => $request->replies ?? false, - 'sends' => $request->sends ?? false + 'sends' => $request->sends ?? false, ]); return new RuleResource($rule->refresh()); @@ -62,7 +62,7 @@ class RuleController extends Controller 'operator' => $request->operator, 'forwards' => $request->forwards ?? false, 'replies' => $request->replies ?? false, - 'sends' => $request->sends ?? false + 'sends' => $request->sends ?? false, ]); return new RuleResource($rule->refresh()); diff --git a/app/Http/Controllers/Auth/ApiAuthenticationController.php b/app/Http/Controllers/Auth/ApiAuthenticationController.php index 981b77e..2551f13 100644 --- a/app/Http/Controllers/Auth/ApiAuthenticationController.php +++ b/app/Http/Controllers/Auth/ApiAuthenticationController.php @@ -28,7 +28,7 @@ class ApiAuthenticationController extends Controller if (! $user || ! Hash::check($request->password, $user->password)) { return response()->json([ - 'error' => 'The provided credentials are incorrect' + 'error' => 'The provided credentials are incorrect', ], 401); } @@ -37,18 +37,18 @@ class ApiAuthenticationController extends Controller return response()->json([ 'message' => "OTP required, please make a request to /api/auth/mfa with the 'mfa_key', 'otp' and 'device_name' including a 'X-CSRF-TOKEN' header", 'mfa_key' => Crypt::encryptString($user->id.'|'.config('anonaddy.secret').'|'.Carbon::now()->addMinutes(5)->getTimestamp()), - 'csrf_token' => csrf_token() + 'csrf_token' => csrf_token(), ], 422); } elseif (Webauthn::enabled($user)) { // If WebAuthn is enabled then return currently unsupported message return response()->json([ - 'error' => 'WebAuthn authentication is not currently supported from the extension or mobile apps, please use an API key to login instead' + 'error' => 'WebAuthn authentication is not currently supported from the extension or mobile apps, please use an API key to login instead', ], 403); } // If the user doesn't use 2FA then return the new API key return response()->json([ - 'api_key' => explode('|', $user->createToken($request->device_name)->plainTextToken, 2)[1] + 'api_key' => explode('|', $user->createToken($request->device_name)->plainTextToken, 2)[1], ]); } @@ -58,7 +58,7 @@ class ApiAuthenticationController extends Controller $mfaKey = Crypt::decryptString($request->mfa_key); } catch (DecryptException $e) { return response()->json([ - 'error' => 'Invalid mfa_key' + 'error' => 'Invalid mfa_key', ], 401); } $parts = explode('|', $mfaKey, 3); @@ -67,14 +67,14 @@ class ApiAuthenticationController extends Controller if (! $user || $parts[1] !== config('anonaddy.secret')) { return response()->json([ - 'error' => 'Invalid mfa_key' + 'error' => 'Invalid mfa_key', ], 401); } // Check if the mfa_key has expired if (Carbon::now()->getTimestamp() > $parts[2]) { return response()->json([ - 'error' => 'mfa_key expired, please request a new one at /api/auth/login' + 'error' => 'mfa_key expired, please request a new one at /api/auth/login', ], 401); } @@ -85,7 +85,7 @@ class ApiAuthenticationController extends Controller if (! $timestamp) { return response()->json([ - 'error' => 'The \'One Time Password\' typed was wrong' + 'error' => 'The \'One Time Password\' typed was wrong', ], 401); } @@ -94,7 +94,7 @@ class ApiAuthenticationController extends Controller } return response()->json([ - 'api_key' => explode('|', $user->createToken($request->device_name)->plainTextToken, 2)[1] + 'api_key' => explode('|', $user->createToken($request->device_name)->plainTextToken, 2)[1], ]); } } diff --git a/app/Http/Controllers/Auth/BackupCodeController.php b/app/Http/Controllers/Auth/BackupCodeController.php index 24c131b..83bca2f 100644 --- a/app/Http/Controllers/Auth/BackupCodeController.php +++ b/app/Http/Controllers/Auth/BackupCodeController.php @@ -36,7 +36,7 @@ class BackupCodeController extends Controller if (! Hash::check($request->backup_code, user()->two_factor_backup_code)) { return back()->withErrors([ - 'backup_code' => __('The backup code was invalid.') + 'backup_code' => __('The backup code was invalid.'), ]); } @@ -45,7 +45,7 @@ class BackupCodeController extends Controller user()->update([ 'two_factor_enabled' => false, 'two_factor_secret' => $twoFactor->generateSecretKey(), - 'two_factor_backup_code' => null + 'two_factor_backup_code' => null, ]); user()->webauthnKeys()->delete(); @@ -60,7 +60,7 @@ class BackupCodeController extends Controller public function update() { user()->update([ - 'two_factor_backup_code' => bcrypt($code = Str::random(40)) + 'two_factor_backup_code' => bcrypt($code = Str::random(40)), ]); return back()->with(['backupCode' => $code]); diff --git a/app/Http/Controllers/Auth/PersonalAccessTokenController.php b/app/Http/Controllers/Auth/PersonalAccessTokenController.php index d8037c0..9b468a6 100644 --- a/app/Http/Controllers/Auth/PersonalAccessTokenController.php +++ b/app/Http/Controllers/Auth/PersonalAccessTokenController.php @@ -18,7 +18,7 @@ class PersonalAccessTokenController extends Controller { // day, week, month, year or null if ($request->expiration) { - $method = "add".ucfirst($request->expiration); + $method = 'add'.ucfirst($request->expiration); $expiration = now()->{$method}(); } else { $expiration = null; @@ -30,7 +30,7 @@ class PersonalAccessTokenController extends Controller return [ 'token' => new PersonalAccessTokenResource($token->accessToken), 'accessToken' => $accessToken, - 'qrCode' => (new QRCode())->render(config('app.url') . "|" . $accessToken) + 'qrCode' => (new QRCode())->render(config('app.url').'|'.$accessToken), ]; } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 87dd614..e186234 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -63,7 +63,7 @@ class RegisterController extends Controller 'max:20', 'unique:usernames,username', new NotBlacklisted(), - new NotDeletedUsername() + new NotDeletedUsername(), ], 'email' => [ 'required', @@ -71,7 +71,7 @@ class RegisterController extends Controller 'max:254', 'confirmed', new RegisterUniqueRecipient(), - new NotLocalRecipient() + new NotLocalRecipient(), ], 'password' => ['required', 'min:8'], ], [ @@ -94,12 +94,12 @@ class RegisterController extends Controller $recipient = Recipient::create([ 'email' => $data['email'], - 'user_id' => $userId + 'user_id' => $userId, ]); $username = Username::create([ 'username' => $data['username'], - 'user_id' => $userId + 'user_id' => $userId, ]); $twoFactor = app('pragmarx.google2fa'); @@ -109,7 +109,7 @@ class RegisterController extends Controller 'default_username_id' => $username->id, 'default_recipient_id' => $recipient->id, 'password' => Hash::make($data['password']), - 'two_factor_secret' => $twoFactor->generateSecretKey() + 'two_factor_secret' => $twoFactor->generateSecretKey(), ]); } } diff --git a/app/Http/Controllers/Auth/TwoFactorAuthController.php b/app/Http/Controllers/Auth/TwoFactorAuthController.php index cb875ec..76f4323 100644 --- a/app/Http/Controllers/Auth/TwoFactorAuthController.php +++ b/app/Http/Controllers/Auth/TwoFactorAuthController.php @@ -12,6 +12,7 @@ use PragmaRX\Google2FALaravel\Support\Authenticator; class TwoFactorAuthController extends Controller { protected $twoFactor; + protected $authenticator; public function __construct(Request $request) @@ -27,7 +28,7 @@ class TwoFactorAuthController extends Controller public function store(EnableTwoFactorAuthRequest $request) { - if (!$this->twoFactor->verifyKey(user()->two_factor_secret, $request->two_factor_token)) { + if (! $this->twoFactor->verifyKey(user()->two_factor_secret, $request->two_factor_token)) { return redirect(url()->previous().'#two-factor')->withErrors(['two_factor_token' => 'The token you entered was incorrect']); } @@ -35,7 +36,7 @@ class TwoFactorAuthController extends Controller user()->update([ 'two_factor_enabled' => true, - 'two_factor_backup_code' => bcrypt($code = Str::random(40)) + 'two_factor_backup_code' => bcrypt($code = Str::random(40)), ]); $this->authenticator->login(); @@ -56,13 +57,13 @@ class TwoFactorAuthController extends Controller public function destroy(Request $request) { - if (!Hash::check($request->current_password_2fa, user()->password)) { + if (! Hash::check($request->current_password_2fa, user()->password)) { return back()->withErrors(['current_password_2fa' => 'Current password incorrect']); } user()->update([ 'two_factor_enabled' => false, - 'two_factor_secret' => $this->twoFactor->generateSecretKey() + 'two_factor_secret' => $this->twoFactor->generateSecretKey(), ]); $this->authenticator->logout(); diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php index c9e799f..1a39cd8 100644 --- a/app/Http/Controllers/Auth/VerificationController.php +++ b/app/Http/Controllers/Auth/VerificationController.php @@ -51,6 +51,7 @@ class VerificationController extends Controller * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response + * * @throws \Illuminate\Auth\Access\AuthorizationException */ public function verify(Request $request) diff --git a/app/Http/Controllers/Auth/WebauthnController.php b/app/Http/Controllers/Auth/WebauthnController.php index 567e14e..c04f05b 100644 --- a/app/Http/Controllers/Auth/WebauthnController.php +++ b/app/Http/Controllers/Auth/WebauthnController.php @@ -19,7 +19,7 @@ class WebauthnController extends ControllersWebauthnController { public function index() { - return user()->webauthnKeys()->latest()->select(['id','name','enabled','created_at'])->get()->values(); + return user()->webauthnKeys()->latest()->select(['id', 'name', 'enabled', 'created_at'])->get()->values(); } /** @@ -45,7 +45,7 @@ class WebauthnController extends ControllersWebauthnController public function store(WebauthnRegisterRequest $request) { $request->validate([ - 'name' => 'required|string|max:50' + 'name' => 'required|string|max:50', ]); try { @@ -56,7 +56,7 @@ class WebauthnController extends ControllersWebauthnController ); user()->update([ - 'two_factor_enabled' => false + 'two_factor_enabled' => false, ]); return $this->redirectAfterSuccessRegister(); @@ -72,7 +72,7 @@ class WebauthnController extends ControllersWebauthnController /** * Return the redirect destination after a successfull register. * - * @param WebauthnKey $webauthnKey + * @param WebauthnKey $webauthnKey * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse */ protected function redirectAfterSuccessRegister() @@ -83,7 +83,7 @@ class WebauthnController extends ControllersWebauthnController } user()->update([ - 'two_factor_backup_code' => bcrypt($code = Str::random(40)) + 'two_factor_backup_code' => bcrypt($code = Str::random(40)), ]); return Redirect::intended('/settings')->with(['backupCode' => $code]); @@ -92,7 +92,7 @@ class WebauthnController extends ControllersWebauthnController /** * Remove an existing Webauthn key. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\JsonResponse */ public function destroy(Request $request, $webauthnKeyId) diff --git a/app/Http/Controllers/DeactivateAliasController.php b/app/Http/Controllers/DeactivateAliasController.php index 21fecb1..9a2ee0d 100644 --- a/app/Http/Controllers/DeactivateAliasController.php +++ b/app/Http/Controllers/DeactivateAliasController.php @@ -22,6 +22,6 @@ class DeactivateAliasController extends Controller $alias->deactivate(); return redirect()->route('aliases.index') - ->with(['status' => 'Alias ' . $alias->email . ' deactivated successfully!']); + ->with(['status' => 'Alias '.$alias->email.' deactivated successfully!']); } } diff --git a/app/Http/Controllers/DomainVerificationController.php b/app/Http/Controllers/DomainVerificationController.php index c8a466a..1701992 100644 --- a/app/Http/Controllers/DomainVerificationController.php +++ b/app/Http/Controllers/DomainVerificationController.php @@ -17,7 +17,7 @@ class DomainVerificationController extends Controller if (! $domain->checkMxRecords()) { return response()->json([ 'success' => false, - 'message' => 'MX record not found or does not have correct priority. This could be due to DNS caching, please try again later.' + 'message' => 'MX record not found or does not have correct priority. This could be due to DNS caching, please try again later.', ]); } diff --git a/app/Http/Controllers/PasswordController.php b/app/Http/Controllers/PasswordController.php index e0e0465..425fd9e 100644 --- a/app/Http/Controllers/PasswordController.php +++ b/app/Http/Controllers/PasswordController.php @@ -10,7 +10,7 @@ class PasswordController extends Controller { public function update(UpdatePasswordRequest $request) { - if (!Hash::check($request->current, user()->password)) { + if (! Hash::check($request->current, user()->password)) { return redirect(url()->previous().'#update-password')->withErrors(['current' => 'Current password incorrect']); } diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 0797a08..bcbe5de 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -22,13 +22,13 @@ class SettingController extends Controller 'user' => user(), 'recipientOptions' => user()->verifiedRecipients, 'authSecret' => user()->two_factor_secret, - 'qrCode' => $qrCode + 'qrCode' => $qrCode, ]); } public function destroy(DestroyAccountRequest $request) { - if (!Hash::check($request->current_password_delete, user()->password)) { + if (! Hash::check($request->current_password_delete, user()->password)) { return back()->withErrors(['current_password_delete' => 'Incorrect password entered']); } diff --git a/app/Http/Controllers/ShowAliasController.php b/app/Http/Controllers/ShowAliasController.php index 5c8b453..bea81f2 100644 --- a/app/Http/Controllers/ShowAliasController.php +++ b/app/Http/Controllers/ShowAliasController.php @@ -10,9 +10,9 @@ class ShowAliasController extends Controller ->aliases() ->withTrashed() ->toBase() - ->selectRaw("ifnull(sum(emails_forwarded),0) as forwarded") - ->selectRaw("ifnull(sum(emails_blocked),0) as blocked") - ->selectRaw("ifnull(sum(emails_replied),0) as replies") + ->selectRaw('ifnull(sum(emails_forwarded),0) as forwarded') + ->selectRaw('ifnull(sum(emails_blocked),0) as blocked') + ->selectRaw('ifnull(sum(emails_replied),0) as replies') ->first(); return view('aliases.index', [ @@ -22,7 +22,7 @@ class ShowAliasController extends Controller ->aliases() ->with([ 'recipients:id,email', - 'aliasable.defaultRecipient:id,email' + 'aliasable.defaultRecipient:id,email', ]) ->latest() ->get(), diff --git a/app/Http/Controllers/ShowDomainController.php b/app/Http/Controllers/ShowDomainController.php index e3dddb5..d110e5b 100644 --- a/app/Http/Controllers/ShowDomainController.php +++ b/app/Http/Controllers/ShowDomainController.php @@ -12,7 +12,7 @@ class ShowDomainController extends Controller ->with('defaultRecipient:id,email') ->withCount('aliases') ->latest() - ->get() + ->get(), ]); } } diff --git a/app/Http/Controllers/ShowFailedDeliveryController.php b/app/Http/Controllers/ShowFailedDeliveryController.php index bfe50c6..0de50de 100644 --- a/app/Http/Controllers/ShowFailedDeliveryController.php +++ b/app/Http/Controllers/ShowFailedDeliveryController.php @@ -9,10 +9,10 @@ class ShowFailedDeliveryController extends Controller return view('failed_deliveries.index', [ 'failedDeliveries' => user() ->failedDeliveries() - ->with(['recipient:id,email','alias:id,email']) - ->select(['alias_id','bounce_type','code','attempted_at','created_at','id','recipient_id','remote_mta','sender']) + ->with(['recipient:id,email', 'alias:id,email']) + ->select(['alias_id', 'bounce_type', 'code', 'attempted_at', 'created_at', 'id', 'recipient_id', 'remote_mta', 'sender']) ->latest() - ->get() + ->get(), ]); } } diff --git a/app/Http/Controllers/ShowRecipientController.php b/app/Http/Controllers/ShowRecipientController.php index 3969390..29e9a0f 100644 --- a/app/Http/Controllers/ShowRecipientController.php +++ b/app/Http/Controllers/ShowRecipientController.php @@ -9,7 +9,7 @@ class ShowRecipientController extends Controller $recipients = user()->recipients()->with([ 'aliases:id,aliasable_id,email', 'domainsUsingAsDefault.aliases:id,aliasable_id,email', - 'usernamesUsingAsDefault.aliases:id,aliasable_id,email' + 'usernamesUsingAsDefault.aliases:id,aliasable_id,email', ])->latest()->get(); $recipients->each(function ($recipient) { @@ -38,7 +38,7 @@ class ShowRecipientController extends Controller 'recipients' => $recipients, 'aliasesUsingDefault' => user()->aliasesUsingDefault()->take(5)->get(), 'aliasesUsingDefaultCount' => user()->aliasesUsingDefault()->count(), - 'user' => user()->load('defaultUsername') + 'user' => user()->load('defaultUsername'), ]); } } diff --git a/app/Http/Controllers/ShowRuleController.php b/app/Http/Controllers/ShowRuleController.php index 7013ce0..e3a0758 100644 --- a/app/Http/Controllers/ShowRuleController.php +++ b/app/Http/Controllers/ShowRuleController.php @@ -10,7 +10,7 @@ class ShowRuleController extends Controller 'rules' => user() ->rules() ->orderBy('order') - ->get() + ->get(), ]); } } diff --git a/app/Http/Controllers/ShowUsernameController.php b/app/Http/Controllers/ShowUsernameController.php index a7bf0c7..bb17c5c 100644 --- a/app/Http/Controllers/ShowUsernameController.php +++ b/app/Http/Controllers/ShowUsernameController.php @@ -12,7 +12,7 @@ class ShowUsernameController extends Controller ->with('defaultRecipient:id,email') ->withCount('aliases') ->latest() - ->get() + ->get(), ]); } } diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index e6131aa..19293ef 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -19,6 +19,6 @@ class VerifyCsrfToken extends Middleware * @var array */ protected $except = [ - 'api/auth/login' + 'api/auth/login', ]; } diff --git a/app/Http/Middleware/VerifyTwoFactorAuth.php b/app/Http/Middleware/VerifyTwoFactorAuth.php index 52242c7..50a719b 100644 --- a/app/Http/Middleware/VerifyTwoFactorAuth.php +++ b/app/Http/Middleware/VerifyTwoFactorAuth.php @@ -26,7 +26,7 @@ class VerifyTwoFactorAuth extends Middleware if (! Str::endsWith($request->url(), '/login/2fa')) { $request->session()->put([ - 'intended_path' => $request->fullUrl() + 'intended_path' => $request->fullUrl(), ]); } diff --git a/app/Http/Middleware/VerifyWebauthn.php b/app/Http/Middleware/VerifyWebauthn.php index 4e218f7..b78a60b 100644 --- a/app/Http/Middleware/VerifyWebauthn.php +++ b/app/Http/Middleware/VerifyWebauthn.php @@ -19,8 +19,8 @@ class VerifyWebauthn /** * Create a Webauthn. * - * @param \Illuminate\Contracts\Config\Repository $config - * @param \Illuminate\Contracts\Auth\Factory $auth + * @param \Illuminate\Contracts\Config\Repository $config + * @param \Illuminate\Contracts\Auth\Factory $auth */ public function __construct(AuthFactory $auth) { diff --git a/app/Http/Requests/ApiAuthenticationLoginRequest.php b/app/Http/Requests/ApiAuthenticationLoginRequest.php index 868181d..3026df7 100644 --- a/app/Http/Requests/ApiAuthenticationLoginRequest.php +++ b/app/Http/Requests/ApiAuthenticationLoginRequest.php @@ -26,7 +26,7 @@ class ApiAuthenticationLoginRequest extends FormRequest return [ 'username' => 'required|string', 'password' => 'required|string', - 'device_name' => 'required|string|max:50' + 'device_name' => 'required|string|max:50', ]; } } diff --git a/app/Http/Requests/ApiAuthenticationMfaRequest.php b/app/Http/Requests/ApiAuthenticationMfaRequest.php index eb37a40..5190c3b 100644 --- a/app/Http/Requests/ApiAuthenticationMfaRequest.php +++ b/app/Http/Requests/ApiAuthenticationMfaRequest.php @@ -26,7 +26,7 @@ class ApiAuthenticationMfaRequest extends FormRequest return [ 'mfa_key' => 'required|string|max:500', 'otp' => 'required|string|min:6|max:6', - 'device_name' => 'required|string|max:50' + 'device_name' => 'required|string|max:50', ]; } } diff --git a/app/Http/Requests/DestroyAccountRequest.php b/app/Http/Requests/DestroyAccountRequest.php index feb6cba..01d992b 100644 --- a/app/Http/Requests/DestroyAccountRequest.php +++ b/app/Http/Requests/DestroyAccountRequest.php @@ -24,7 +24,7 @@ class DestroyAccountRequest extends FormRequest public function rules() { return [ - 'current_password_delete' => 'required|string' + 'current_password_delete' => 'required|string', ]; } } diff --git a/app/Http/Requests/DisableTwoFactorAuthRequest.php b/app/Http/Requests/DisableTwoFactorAuthRequest.php index ae65019..3adb6cd 100644 --- a/app/Http/Requests/DisableTwoFactorAuthRequest.php +++ b/app/Http/Requests/DisableTwoFactorAuthRequest.php @@ -24,7 +24,7 @@ class DisableTwoFactorAuthRequest extends FormRequest public function rules() { return [ - 'current_password_2fa' => 'required|string' + 'current_password_2fa' => 'required|string', ]; } } diff --git a/app/Http/Requests/EditDefaultRecipientRequest.php b/app/Http/Requests/EditDefaultRecipientRequest.php index 531a679..1216d64 100644 --- a/app/Http/Requests/EditDefaultRecipientRequest.php +++ b/app/Http/Requests/EditDefaultRecipientRequest.php @@ -31,8 +31,8 @@ class EditDefaultRecipientRequest extends FormRequest 'max:254', 'confirmed', new RegisterUniqueRecipient(), - 'not_in:'.$this->user()->email - ] + 'not_in:'.$this->user()->email, + ], ]; } @@ -44,7 +44,7 @@ class EditDefaultRecipientRequest extends FormRequest public function messages() { return [ - 'email.not_in' => 'That email is the same as the current one.' + 'email.not_in' => 'That email is the same as the current one.', ]; } } diff --git a/app/Http/Requests/EnableTwoFactorAuthRequest.php b/app/Http/Requests/EnableTwoFactorAuthRequest.php index 6a092e7..ddacafc 100644 --- a/app/Http/Requests/EnableTwoFactorAuthRequest.php +++ b/app/Http/Requests/EnableTwoFactorAuthRequest.php @@ -24,7 +24,7 @@ class EnableTwoFactorAuthRequest extends FormRequest public function rules() { return [ - 'two_factor_token' => 'required|min:6' + 'two_factor_token' => 'required|min:6', ]; } } diff --git a/app/Http/Requests/IndexAliasRequest.php b/app/Http/Requests/IndexAliasRequest.php index 89fe255..fdff7db 100644 --- a/app/Http/Requests/IndexAliasRequest.php +++ b/app/Http/Requests/IndexAliasRequest.php @@ -27,27 +27,27 @@ class IndexAliasRequest extends FormRequest return [ 'page' => [ 'nullable', - 'array' + 'array', ], 'page.number' => [ 'nullable', - 'integer' + 'integer', ], 'page.size' => [ 'nullable', 'integer', 'max:100', - 'min:1' + 'min:1', ], 'filter' => [ 'nullable', - 'array' + 'array', ], 'filter.search' => [ 'nullable', 'string', 'max:50', - 'min:3' + 'min:3', ], 'filter.deleted' => [ 'nullable', @@ -86,8 +86,8 @@ class IndexAliasRequest extends FormRequest '-created_at', '-updated_at', '-deleted_at', - ]) - ] + ]), + ], ]; } } diff --git a/app/Http/Requests/IndexRecipientRequest.php b/app/Http/Requests/IndexRecipientRequest.php index 1301108..ef56d36 100644 --- a/app/Http/Requests/IndexRecipientRequest.php +++ b/app/Http/Requests/IndexRecipientRequest.php @@ -26,7 +26,7 @@ class IndexRecipientRequest extends FormRequest return [ 'filter' => [ 'nullable', - 'array' + 'array', ], 'filter.verified' => [ 'nullable', diff --git a/app/Http/Requests/StoreAliasRecipientRequest.php b/app/Http/Requests/StoreAliasRecipientRequest.php index 56d103e..f96a2da 100644 --- a/app/Http/Requests/StoreAliasRecipientRequest.php +++ b/app/Http/Requests/StoreAliasRecipientRequest.php @@ -28,8 +28,8 @@ class StoreAliasRecipientRequest extends FormRequest 'recipient_ids' => [ 'array', 'max:10', - new VerifiedRecipientId() - ] + new VerifiedRecipientId(), + ], ]; } } diff --git a/app/Http/Requests/StoreAliasRequest.php b/app/Http/Requests/StoreAliasRequest.php index 7a1dd0e..b0c2a7d 100644 --- a/app/Http/Requests/StoreAliasRequest.php +++ b/app/Http/Requests/StoreAliasRequest.php @@ -30,7 +30,7 @@ class StoreAliasRequest extends FormRequest 'domain' => [ 'required', 'string', - Rule::in($this->user()->domainOptions()) + Rule::in($this->user()->domainOptions()), ], 'description' => 'nullable|max:200', 'format' => 'nullable|in:random_characters,uuid,random_words,custom', @@ -38,8 +38,8 @@ class StoreAliasRequest extends FormRequest 'nullable', 'array', 'max:10', - new VerifiedRecipientId() - ] + new VerifiedRecipientId(), + ], ]; } @@ -52,9 +52,10 @@ class StoreAliasRequest extends FormRequest return $query->where('local_part', $this->validationData()['local_part']) ->where('domain', $this->validationData()['domain']); }), - new ValidAliasLocalPart() + new ValidAliasLocalPart(), ], function () { $format = $this->validationData()['format'] ?? 'random_characters'; + return $format === 'custom'; }); } diff --git a/app/Http/Requests/StoreDomainRequest.php b/app/Http/Requests/StoreDomainRequest.php index 68b4630..34145e1 100644 --- a/app/Http/Requests/StoreDomainRequest.php +++ b/app/Http/Requests/StoreDomainRequest.php @@ -34,8 +34,8 @@ class StoreDomainRequest extends FormRequest 'unique:domains', new ValidDomain(), new NotLocalDomain(), - new NotUsedAsRecipientDomain() - ] + new NotUsedAsRecipientDomain(), + ], ]; } } diff --git a/app/Http/Requests/StorePersonalAccessTokenRequest.php b/app/Http/Requests/StorePersonalAccessTokenRequest.php index 63e7fdb..7df7c10 100644 --- a/app/Http/Requests/StorePersonalAccessTokenRequest.php +++ b/app/Http/Requests/StorePersonalAccessTokenRequest.php @@ -27,14 +27,14 @@ class StorePersonalAccessTokenRequest extends FormRequest 'name' => [ 'required', 'string', - 'max:50' + 'max:50', ], 'expiration' => [ 'nullable', 'string', 'max:5', - 'in:day,week,month,year' - ] + 'in:day,week,month,year', + ], ]; } } diff --git a/app/Http/Requests/StoreRecipientRequest.php b/app/Http/Requests/StoreRecipientRequest.php index df8bce5..38d4763 100644 --- a/app/Http/Requests/StoreRecipientRequest.php +++ b/app/Http/Requests/StoreRecipientRequest.php @@ -32,8 +32,8 @@ class StoreRecipientRequest extends FormRequest 'max:254', 'email:rfc', new UniqueRecipient(), - new NotLocalRecipient() - ] + new NotLocalRecipient(), + ], ]; } } diff --git a/app/Http/Requests/StoreReorderRuleRequest.php b/app/Http/Requests/StoreReorderRuleRequest.php index 8dd5208..ecd0bac 100644 --- a/app/Http/Requests/StoreReorderRuleRequest.php +++ b/app/Http/Requests/StoreReorderRuleRequest.php @@ -28,8 +28,8 @@ class StoreReorderRuleRequest extends FormRequest 'ids' => [ 'required', 'array', - new ValidRuleId() - ] + new ValidRuleId(), + ], ]; } } diff --git a/app/Http/Requests/StoreRuleRequest.php b/app/Http/Requests/StoreRuleRequest.php index 1b3762e..2aa3821 100644 --- a/app/Http/Requests/StoreRuleRequest.php +++ b/app/Http/Requests/StoreRuleRequest.php @@ -28,20 +28,20 @@ class StoreRuleRequest extends FormRequest 'name' => [ 'required', 'string', - 'max:50' + 'max:50', ], 'conditions' => [ 'required', 'array', - 'max:5' + 'max:5', ], 'conditions.*.type' => [ 'required', Rule::in([ 'subject', 'sender', - 'alias' - ]) + 'alias', + ]), ], 'conditions.*.match' => [ 'sometimes', @@ -54,14 +54,14 @@ class StoreRuleRequest extends FormRequest 'starts with', 'does not start with', 'ends with', - 'does not end with' - ]) + 'does not end with', + ]), ], 'conditions.*.values' => [ 'required', 'array', 'min:1', - 'max:10' + 'max:10', ], 'conditions.*.values.*' => [ 'distinct', @@ -69,7 +69,7 @@ class StoreRuleRequest extends FormRequest 'actions' => [ 'required', 'array', - 'max:5' + 'max:5', ], 'actions.*.type' => [ 'required', @@ -79,20 +79,20 @@ class StoreRuleRequest extends FormRequest 'encryption', 'banner', 'block', - 'webhook' + 'webhook', ]), ], 'actions.*.value' => [ 'required', - 'max:50' + 'max:50', ], 'operator' => [ 'required', - 'in:AND,OR' + 'in:AND,OR', ], 'forwards' => 'boolean', 'replies' => 'boolean', - 'sends' => 'boolean' + 'sends' => 'boolean', ]; } } diff --git a/app/Http/Requests/StoreUsernameRequest.php b/app/Http/Requests/StoreUsernameRequest.php index be88110..0cdd1ea 100644 --- a/app/Http/Requests/StoreUsernameRequest.php +++ b/app/Http/Requests/StoreUsernameRequest.php @@ -32,7 +32,7 @@ class StoreUsernameRequest extends FormRequest 'max:20', 'unique:usernames,username', new NotBlacklisted(), - new NotDeletedUsername() + new NotDeletedUsername(), ], ]; } diff --git a/app/Http/Requests/UpdateAliasRequest.php b/app/Http/Requests/UpdateAliasRequest.php index 1e9b441..91d2b4a 100644 --- a/app/Http/Requests/UpdateAliasRequest.php +++ b/app/Http/Requests/UpdateAliasRequest.php @@ -24,7 +24,7 @@ class UpdateAliasRequest extends FormRequest public function rules() { return [ - 'description' => 'nullable|max:200' + 'description' => 'nullable|max:200', ]; } } diff --git a/app/Http/Requests/UpdateBannerLocationRequest.php b/app/Http/Requests/UpdateBannerLocationRequest.php index 9969ed8..1d9a910 100644 --- a/app/Http/Requests/UpdateBannerLocationRequest.php +++ b/app/Http/Requests/UpdateBannerLocationRequest.php @@ -24,7 +24,7 @@ class UpdateBannerLocationRequest extends FormRequest public function rules() { return [ - 'banner_location' => 'required|string|in:top,bottom,off' + 'banner_location' => 'required|string|in:top,bottom,off', ]; } } diff --git a/app/Http/Requests/UpdateDefaultAliasDomainRequest.php b/app/Http/Requests/UpdateDefaultAliasDomainRequest.php index 6f1cbec..bf8612e 100644 --- a/app/Http/Requests/UpdateDefaultAliasDomainRequest.php +++ b/app/Http/Requests/UpdateDefaultAliasDomainRequest.php @@ -28,8 +28,8 @@ class UpdateDefaultAliasDomainRequest extends FormRequest 'domain' => [ 'required', 'string', - Rule::in($this->user()->domainOptions()) - ] + Rule::in($this->user()->domainOptions()), + ], ]; } } diff --git a/app/Http/Requests/UpdateDefaultAliasFormatRequest.php b/app/Http/Requests/UpdateDefaultAliasFormatRequest.php index bfdec55..a2d5346 100644 --- a/app/Http/Requests/UpdateDefaultAliasFormatRequest.php +++ b/app/Http/Requests/UpdateDefaultAliasFormatRequest.php @@ -27,8 +27,8 @@ class UpdateDefaultAliasFormatRequest extends FormRequest 'format' => [ 'required', 'string', - 'in:random_characters,uuid,random_words,custom' - ] + 'in:random_characters,uuid,random_words,custom', + ], ]; } } diff --git a/app/Http/Requests/UpdateDefaultRecipientRequest.php b/app/Http/Requests/UpdateDefaultRecipientRequest.php index 8a1aeb6..96aec11 100644 --- a/app/Http/Requests/UpdateDefaultRecipientRequest.php +++ b/app/Http/Requests/UpdateDefaultRecipientRequest.php @@ -24,7 +24,7 @@ class UpdateDefaultRecipientRequest extends FormRequest public function rules() { return [ - 'default_recipient' => 'required|string' + 'default_recipient' => 'required|string', ]; } } diff --git a/app/Http/Requests/UpdateDomainDefaultRecipientRequest.php b/app/Http/Requests/UpdateDomainDefaultRecipientRequest.php index ecf8d63..67ec385 100644 --- a/app/Http/Requests/UpdateDomainDefaultRecipientRequest.php +++ b/app/Http/Requests/UpdateDomainDefaultRecipientRequest.php @@ -24,7 +24,7 @@ class UpdateDomainDefaultRecipientRequest extends FormRequest public function rules() { return [ - 'default_recipient' => 'nullable|string' + 'default_recipient' => 'nullable|string', ]; } } diff --git a/app/Http/Requests/UpdateDomainRequest.php b/app/Http/Requests/UpdateDomainRequest.php index 7fa5b13..fbb1035 100644 --- a/app/Http/Requests/UpdateDomainRequest.php +++ b/app/Http/Requests/UpdateDomainRequest.php @@ -24,7 +24,7 @@ class UpdateDomainRequest extends FormRequest public function rules() { return [ - 'description' => 'nullable|max:200' + 'description' => 'nullable|max:200', ]; } } diff --git a/app/Http/Requests/UpdateEmailSubjectRequest.php b/app/Http/Requests/UpdateEmailSubjectRequest.php index 8004cdc..22f0e69 100644 --- a/app/Http/Requests/UpdateEmailSubjectRequest.php +++ b/app/Http/Requests/UpdateEmailSubjectRequest.php @@ -24,7 +24,7 @@ class UpdateEmailSubjectRequest extends FormRequest public function rules() { return [ - 'email_subject' => 'nullable|string|max:50' + 'email_subject' => 'nullable|string|max:50', ]; } } diff --git a/app/Http/Requests/UpdateFromNameRequest.php b/app/Http/Requests/UpdateFromNameRequest.php index 7963916..320fcfb 100644 --- a/app/Http/Requests/UpdateFromNameRequest.php +++ b/app/Http/Requests/UpdateFromNameRequest.php @@ -24,7 +24,7 @@ class UpdateFromNameRequest extends FormRequest public function rules() { return [ - 'from_name' => 'nullable|string|max:50' + 'from_name' => 'nullable|string|max:50', ]; } } diff --git a/app/Http/Requests/UpdatePasswordRequest.php b/app/Http/Requests/UpdatePasswordRequest.php index c96738d..c041de0 100644 --- a/app/Http/Requests/UpdatePasswordRequest.php +++ b/app/Http/Requests/UpdatePasswordRequest.php @@ -25,7 +25,7 @@ class UpdatePasswordRequest extends FormRequest { return [ 'current' => 'required|string', - 'password' => 'required|confirmed|min:8' + 'password' => 'required|confirmed|min:8', ]; } } diff --git a/app/Http/Requests/UpdateRecipientKeyRequest.php b/app/Http/Requests/UpdateRecipientKeyRequest.php index abcef84..b2c98a8 100644 --- a/app/Http/Requests/UpdateRecipientKeyRequest.php +++ b/app/Http/Requests/UpdateRecipientKeyRequest.php @@ -26,8 +26,8 @@ class UpdateRecipientKeyRequest extends FormRequest return [ 'key_data' => [ 'string', - 'regex:/-----BEGIN PGP PUBLIC KEY BLOCK-----([A-Za-z0-9+=\/\n]+)-----END PGP PUBLIC KEY BLOCK-----/i' - ] + 'regex:/-----BEGIN PGP PUBLIC KEY BLOCK-----([A-Za-z0-9+=\/\n]+)-----END PGP PUBLIC KEY BLOCK-----/i', + ], ]; } } diff --git a/app/Http/Requests/UpdateUseReplyToRequest.php b/app/Http/Requests/UpdateUseReplyToRequest.php index 656bebc..00b6074 100644 --- a/app/Http/Requests/UpdateUseReplyToRequest.php +++ b/app/Http/Requests/UpdateUseReplyToRequest.php @@ -24,7 +24,7 @@ class UpdateUseReplyToRequest extends FormRequest public function rules() { return [ - 'use_reply_to' => 'required|boolean' + 'use_reply_to' => 'required|boolean', ]; } } diff --git a/app/Http/Requests/UpdateUsernameDefaultRecipientRequest.php b/app/Http/Requests/UpdateUsernameDefaultRecipientRequest.php index e4d46b8..1cba184 100644 --- a/app/Http/Requests/UpdateUsernameDefaultRecipientRequest.php +++ b/app/Http/Requests/UpdateUsernameDefaultRecipientRequest.php @@ -24,7 +24,7 @@ class UpdateUsernameDefaultRecipientRequest extends FormRequest public function rules() { return [ - 'default_recipient' => 'nullable|string' + 'default_recipient' => 'nullable|string', ]; } } diff --git a/app/Http/Requests/UpdateUsernameRequest.php b/app/Http/Requests/UpdateUsernameRequest.php index 60b82b4..42ccc4c 100644 --- a/app/Http/Requests/UpdateUsernameRequest.php +++ b/app/Http/Requests/UpdateUsernameRequest.php @@ -24,7 +24,7 @@ class UpdateUsernameRequest extends FormRequest public function rules() { return [ - 'description' => 'nullable|max:200' + 'description' => 'nullable|max:200', ]; } } diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php index f3b419e..69c1bad 100644 --- a/app/Http/Resources/UserResource.php +++ b/app/Http/Resources/UserResource.php @@ -12,10 +12,10 @@ class UserResource extends JsonResource ->aliases() ->withTrashed() ->toBase() - ->selectRaw("ifnull(sum(emails_forwarded),0) as forwarded") - ->selectRaw("ifnull(sum(emails_blocked),0) as blocked") - ->selectRaw("ifnull(sum(emails_replied),0) as replied") - ->selectRaw("ifnull(sum(emails_sent),0) as sent") + ->selectRaw('ifnull(sum(emails_forwarded),0) as forwarded') + ->selectRaw('ifnull(sum(emails_blocked),0) as blocked') + ->selectRaw('ifnull(sum(emails_replied),0) as replied') + ->selectRaw('ifnull(sum(emails_sent),0) as sent') ->first(); return [ diff --git a/app/Listeners/SendIncorrectOtpNotification.php b/app/Listeners/SendIncorrectOtpNotification.php index 173b193..1043e82 100644 --- a/app/Listeners/SendIncorrectOtpNotification.php +++ b/app/Listeners/SendIncorrectOtpNotification.php @@ -25,7 +25,7 @@ class SendIncorrectOtpNotification Cache::put("user:{$user->id}:failed-otp-notification", now()->toDateTimeString(), now()->addMinutes(5)); // Log in auth.log - Log::channel('auth')->info('Failed OTP Notification sent: ' . $user->username); + Log::channel('auth')->info('Failed OTP Notification sent: '.$user->username); $user->notify(new IncorrectOtpNotification()); } diff --git a/app/Mail/ForwardEmail.php b/app/Mail/ForwardEmail.php index 424b00c..dabbc74 100644 --- a/app/Mail/ForwardEmail.php +++ b/app/Mail/ForwardEmail.php @@ -24,34 +24,63 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted use CheckUserRules; protected $email; + protected $user; + protected $alias; + protected $sender; + protected $originalCc; + protected $originalTo; + protected $displayFrom; + protected $replyToAddress; + protected $emailSubject; + protected $emailText; + protected $emailHtml; + protected $emailAttachments; + protected $emailInlineAttachments; + protected $deactivateUrl; + protected $bannerLocationText; + protected $bannerLocationHtml; + protected $fingerprint; + protected $encryptedParts; + protected $fromEmail; + protected $size; + protected $messageId; + protected $listUnsubscribe; + protected $inReplyTo; + protected $references; + protected $originalEnvelopeFrom; + protected $originalFromHeader; + protected $originalReplyToHeader; + protected $originalSenderHeader; + protected $authenticationResults; + protected $recipientId; /** @@ -87,7 +116,7 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted $this->encryptedParts = $emailData->encryptedParts ?? null; $this->recipientId = $recipient->id; - $this->fingerprint = $recipient->should_encrypt && !$this->isAlreadyEncrypted() ? $recipient->fingerprint : null; + $this->fingerprint = $recipient->should_encrypt && ! $this->isAlreadyEncrypted() ? $recipient->fingerprint : null; $this->bannerLocationText = $this->bannerLocationHtml = $this->isAlreadyEncrypted() ? 'off' : $this->alias->user->banner_location; } @@ -103,9 +132,9 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted if ($this->user->use_reply_to) { $this->fromEmail = $this->alias->email; - $replyToEmail = $this->alias->local_part . '+' . Str::replaceLast('@', '=', $this->replyToAddress) . '@' . $this->alias->domain; + $replyToEmail = $this->alias->local_part.'+'.Str::replaceLast('@', '=', $this->replyToAddress).'@'.$this->alias->domain; } else { - $this->fromEmail = $this->alias->local_part . '+' . Str::replaceLast('@', '=', $this->replyToAddress) . '@' . $this->alias->domain; + $this->fromEmail = $this->alias->local_part.'+'.Str::replaceLast('@', '=', $this->replyToAddress).'@'.$this->alias->domain; } $returnPath = $this->alias->email; @@ -121,14 +150,14 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted } } - $this->email = $this + $this->email = $this ->from($this->fromEmail, base64_decode($this->displayFrom)." '".$this->sender."'") ->subject($this->user->email_subject ?? base64_decode($this->emailSubject)) ->withSymfonyMessage(function (Email $message) use ($returnPath) { $message->returnPath($returnPath); $message->getHeaders() - ->addTextHeader('Feedback-ID', 'F:' . $this->alias->id . ':anonaddy'); + ->addTextHeader('Feedback-ID', 'F:'.$this->alias->id.':anonaddy'); // This header is used to set the To: header as the alias just before sending. $message->getHeaders() @@ -211,7 +240,7 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted if ($this->emailText) { $this->email->text('emails.forward.text')->with([ - 'text' => base64_decode($this->emailText) + 'text' => base64_decode($this->emailText), ]); } @@ -220,14 +249,14 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted $this->bannerLocationText = 'off'; $this->email->view('emails.forward.html')->with([ - 'html' => base64_decode($this->emailHtml) + 'html' => base64_decode($this->emailHtml), ]); } // To prevent invalid view error where no text or html is present... if (! $this->emailHtml && ! $this->emailText) { $this->email->text('emails.forward.text')->with([ - 'text' => base64_decode($this->emailText) + 'text' => base64_decode($this->emailText), ]); } @@ -239,7 +268,7 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted ); } - $this->replacedSubject = $this->user->email_subject ? ' with subject "' . base64_decode($this->emailSubject) . '"' : null; + $this->replacedSubject = $this->user->email_subject ? ' with subject "'.base64_decode($this->emailSubject).'"' : null; $this->checkRules('Forwards'); @@ -256,7 +285,7 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted 'fromEmail' => $this->sender, 'replacedSubject' => $this->replacedSubject, 'shouldBlock' => $this->size === 0, - 'needsDkimSignature' => $this->needsDkimSignature() + 'needsDkimSignature' => $this->needsDkimSignature(), ]); if (isset($replyToEmail)) { @@ -306,7 +335,7 @@ class ForwardEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted 'email_type' => 'F', 'status' => null, 'code' => 'An error has occurred, please check the logs.', - 'attempted_at' => now() + 'attempted_at' => now(), ]); } diff --git a/app/Mail/ReplyToEmail.php b/app/Mail/ReplyToEmail.php index 8b5cda8..c8959a3 100644 --- a/app/Mail/ReplyToEmail.php +++ b/app/Mail/ReplyToEmail.php @@ -23,19 +23,33 @@ class ReplyToEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted use CheckUserRules; protected $email; + protected $user; + protected $alias; + protected $sender; + protected $emailSubject; + protected $emailText; + protected $emailHtml; + protected $emailAttachments; + protected $emailInlineAttachments; + protected $encryptedParts; + protected $displayFrom; + protected $fromEmail; + protected $size; + protected $inReplyTo; + protected $references; /** @@ -77,14 +91,14 @@ class ReplyToEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted } } - $this->email = $this + $this->email = $this ->from($this->fromEmail, $this->displayFrom) ->subject(base64_decode($this->emailSubject)) ->withSymfonyMessage(function (Email $message) use ($returnPath) { $message->returnPath($returnPath); $message->getHeaders() - ->addTextHeader('Feedback-ID', 'R:' . $this->alias->id . ':anonaddy'); + ->addTextHeader('Feedback-ID', 'R:'.$this->alias->id.':anonaddy'); // Message-ID is replaced on replies as it can leak parts of the real email $message->getHeaders()->remove('Message-ID'); @@ -117,20 +131,20 @@ class ReplyToEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted if ($this->emailText) { $this->email->text('emails.reply.text')->with([ - 'text' => $this->removeRealEmailAndTextBanner(base64_decode($this->emailText)) + 'text' => $this->removeRealEmailAndTextBanner(base64_decode($this->emailText)), ]); } if ($this->emailHtml) { $this->email->view('emails.reply.html')->with([ - 'html' => $this->removeRealEmailAndHtmlBanner(base64_decode($this->emailHtml)) + 'html' => $this->removeRealEmailAndHtmlBanner(base64_decode($this->emailHtml)), ]); } // To prevent invalid view error where no text or html is present... if (! $this->emailHtml && ! $this->emailText) { $this->email->text('emails.reply.text')->with([ - 'text' => base64_decode($this->emailText) + 'text' => base64_decode($this->emailText), ]); } @@ -148,7 +162,7 @@ class ReplyToEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted 'shouldBlock' => $this->size === 0, 'encryptedParts' => $this->encryptedParts, 'needsDkimSignature' => $this->needsDkimSignature(), - 'aliasDomain' => $this->alias->domain + 'aliasDomain' => $this->alias->domain, ]); if ($this->alias->isCustomDomain() && ! $this->needsDkimSignature()) { @@ -196,7 +210,7 @@ class ReplyToEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted 'email_type' => 'R', 'status' => null, 'code' => 'An error has occurred, please check the logs.', - 'attempted_at' => now() + 'attempted_at' => now(), ]); } @@ -216,7 +230,7 @@ class ReplyToEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted // Reply may be HTML but have a plain text banner return Str::of(str_ireplace($this->sender, '', $html)) ->replaceMatches('/(?s)((<|<)!--banner-info--(>|>)).*?((<|<)!--banner-info--(>|>))/mi', '') - ->replaceMatches("/(?s)(after('://')->rtrim('/'), '/') . "(\/|%2F)deactivate(\/|%2F).*?\/tr>)/mi", ''); + ->replaceMatches('/(?s)(after('://')->rtrim('/'), '/')."(\/|%2F)deactivate(\/|%2F).*?\/tr>)/mi", ''); } /** diff --git a/app/Mail/SendFromEmail.php b/app/Mail/SendFromEmail.php index 7df681b..1eee480 100644 --- a/app/Mail/SendFromEmail.php +++ b/app/Mail/SendFromEmail.php @@ -23,17 +23,29 @@ class SendFromEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted use CheckUserRules; protected $email; + protected $user; + protected $alias; + protected $sender; + protected $emailSubject; + protected $emailText; + protected $emailHtml; + protected $emailAttachments; + protected $emailInlineAttachments; + protected $encryptedParts; + protected $displayFrom; + protected $fromEmail; + protected $size; /** @@ -73,14 +85,14 @@ class SendFromEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted } } - $this->email = $this + $this->email = $this ->from($this->fromEmail, $this->displayFrom) ->subject(base64_decode($this->emailSubject)) ->withSymfonyMessage(function (Email $message) use ($returnPath) { $message->returnPath($returnPath); $message->getHeaders() - ->addTextHeader('Feedback-ID', 'S:' . $this->alias->id . ':anonaddy'); + ->addTextHeader('Feedback-ID', 'S:'.$this->alias->id.':anonaddy'); // Message-ID is replaced on send from as it can leak parts of the real email $message->getHeaders()->remove('Message-ID'); @@ -103,20 +115,20 @@ class SendFromEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted if ($this->emailText) { $this->email->text('emails.reply.text')->with([ - 'text' => $this->removeRealEmailAndTextBanner(base64_decode($this->emailText)) + 'text' => $this->removeRealEmailAndTextBanner(base64_decode($this->emailText)), ]); } if ($this->emailHtml) { $this->email->view('emails.reply.html')->with([ - 'html' => $this->removeRealEmailAndHtmlBanner(base64_decode($this->emailHtml)) + 'html' => $this->removeRealEmailAndHtmlBanner(base64_decode($this->emailHtml)), ]); } // To prevent invalid view error where no text or html is present... if (! $this->emailHtml && ! $this->emailText) { $this->email->text('emails.reply.text')->with([ - 'text' => base64_decode($this->emailText) + 'text' => base64_decode($this->emailText), ]); } @@ -134,7 +146,7 @@ class SendFromEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted 'shouldBlock' => $this->size === 0, 'encryptedParts' => $this->encryptedParts, 'needsDkimSignature' => $this->needsDkimSignature(), - 'aliasDomain' => $this->alias->domain + 'aliasDomain' => $this->alias->domain, ]); if ($this->alias->isCustomDomain() && ! $this->needsDkimSignature()) { @@ -182,7 +194,7 @@ class SendFromEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted 'email_type' => 'S', 'status' => null, 'code' => 'An error has occurred, please check the logs.', - 'attempted_at' => now() + 'attempted_at' => now(), ]); } @@ -202,7 +214,7 @@ class SendFromEmail extends Mailable implements ShouldQueue, ShouldBeEncrypted // Reply may be HTML but have a plain text banner return Str::of(str_ireplace($this->sender, '', $html)) ->replaceMatches('/(?s)((<|<)!--banner-info--(>|>)).*?((<|<)!--banner-info--(>|>))/mi', '') - ->replaceMatches("/(?s)(after('://')->rtrim('/'), '/') . "(\/|%2F)deactivate(\/|%2F).*?\/tr>)/mi", ''); + ->replaceMatches('/(?s)(after('://')->rtrim('/'), '/')."(\/|%2F)deactivate(\/|%2F).*?\/tr>)/mi", ''); } /** diff --git a/app/Mail/TokenExpiringSoon.php b/app/Mail/TokenExpiringSoon.php index 6fb517e..d475793 100644 --- a/app/Mail/TokenExpiringSoon.php +++ b/app/Mail/TokenExpiringSoon.php @@ -16,6 +16,7 @@ class TokenExpiringSoon extends Mailable implements ShouldQueue, ShouldBeEncrypt use SerializesModels; protected $user; + protected $recipient; /** @@ -37,11 +38,11 @@ class TokenExpiringSoon extends Mailable implements ShouldQueue, ShouldBeEncrypt public function build() { return $this - ->subject("Your AnonAddy API token expires soon") + ->subject('Your AnonAddy API token expires soon') ->markdown('mail.token_expiring_soon', [ 'user' => $this->user, 'recipientId' => $this->recipient->id, - 'fingerprint' => $this->recipient->should_encrypt ? $this->recipient->fingerprint : null + 'fingerprint' => $this->recipient->should_encrypt ? $this->recipient->fingerprint : null, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Models/Alias.php b/app/Models/Alias.php index 8a88148..ab3f2a6 100644 --- a/app/Models/Alias.php +++ b/app/Models/Alias.php @@ -21,7 +21,7 @@ class Alias extends Model protected $keyType = 'string'; protected $encrypted = [ - 'description' + 'description', ]; protected $fillable = [ @@ -38,13 +38,13 @@ class Alias extends Model 'emails_forwarded', 'emails_blocked', 'emails_replied', - 'emails_sent' + 'emails_sent', ]; protected $dates = [ 'created_at', 'updated_at', - 'deleted_at' + 'deleted_at', ]; protected $casts = [ @@ -52,7 +52,7 @@ class Alias extends Model 'user_id' => 'string', 'aliasable_id' => 'string', 'aliasable_type' => 'string', - 'active' => 'boolean' + 'active' => 'boolean', ]; public static function boot() diff --git a/app/Models/AliasRecipient.php b/app/Models/AliasRecipient.php index 2e9e98c..22d14f5 100644 --- a/app/Models/AliasRecipient.php +++ b/app/Models/AliasRecipient.php @@ -20,7 +20,7 @@ class AliasRecipient extends Pivot protected $casts = [ 'id' => 'string', 'alias_id' => 'string', - 'recipient_id' => 'string' + 'recipient_id' => 'string', ]; public function setAliasAttribute($alias) diff --git a/app/Models/DeletedUsername.php b/app/Models/DeletedUsername.php index 2ed8890..c6a9409 100644 --- a/app/Models/DeletedUsername.php +++ b/app/Models/DeletedUsername.php @@ -18,10 +18,10 @@ class DeletedUsername extends Model public $timestamps = false; protected $encrypted = [ - 'username' + 'username', ]; protected $fillable = [ - 'username' + 'username', ]; } diff --git a/app/Models/Domain.php b/app/Models/Domain.php index f971929..6479113 100644 --- a/app/Models/Domain.php +++ b/app/Models/Domain.php @@ -20,14 +20,14 @@ class Domain extends Model protected $keyType = 'string'; protected $encrypted = [ - 'description' + 'description', ]; protected $fillable = [ 'domain', 'description', 'active', - 'catch_all' + 'catch_all', ]; protected $dates = [ @@ -35,7 +35,7 @@ class Domain extends Model 'updated_at', 'domain_verified_at', 'domain_mx_validated_at', - 'domain_sending_verified_at' + 'domain_sending_verified_at', ]; protected $casts = [ @@ -193,9 +193,9 @@ class Domain extends Model return true; } - return collect(dns_get_record($this->domain . '.', DNS_TXT)) + return collect(dns_get_record($this->domain.'.', DNS_TXT)) ->contains(function ($r) { - return trim($r['txt']) === 'aa-verify=' . sha1(config('anonaddy.secret') . user()->id . user()->domains->count()); + return trim($r['txt']) === 'aa-verify='.sha1(config('anonaddy.secret').user()->id.user()->domains->count()); }); } @@ -208,7 +208,7 @@ class Domain extends Model return true; } - $mx = collect(dns_get_record($this->domain . '.', DNS_MX)) + $mx = collect(dns_get_record($this->domain.'.', DNS_MX)) ->sortBy('pri') ->first(); @@ -237,39 +237,39 @@ class Domain extends Model ]); } - $spf = collect(dns_get_record($this->domain . '.', DNS_TXT)) + $spf = collect(dns_get_record($this->domain.'.', DNS_TXT)) ->contains(function ($r) { - return preg_match("/^(v=spf1).*(include:spf\." . config('anonaddy.domain') . "|mx).*(-|~)all$/", $r['txt']); + return preg_match("/^(v=spf1).*(include:spf\.".config('anonaddy.domain').'|mx).*(-|~)all$/', $r['txt']); }); - if (!$spf) { + if (! $spf) { return response()->json([ 'success' => false, - 'message' => 'SPF record not found. This could be due to DNS caching, please try again later.' + 'message' => 'SPF record not found. This could be due to DNS caching, please try again later.', ]); } - $dmarc = collect(dns_get_record('_dmarc.' . $this->domain . '.', DNS_TXT)) + $dmarc = collect(dns_get_record('_dmarc.'.$this->domain.'.', DNS_TXT)) ->contains(function ($r) { - return preg_match("/^(v=DMARC1).*(p=quarantine|reject).*/", $r['txt']); + return preg_match('/^(v=DMARC1).*(p=quarantine|reject).*/', $r['txt']); }); - if (!$dmarc) { + if (! $dmarc) { return response()->json([ 'success' => false, - 'message' => 'DMARC record not found. This could be due to DNS caching, please try again later.' + 'message' => 'DMARC record not found. This could be due to DNS caching, please try again later.', ]); } - $def = collect(dns_get_record('default._domainkey.' . $this->domain . '.', DNS_CNAME)) + $def = collect(dns_get_record('default._domainkey.'.$this->domain.'.', DNS_CNAME)) ->contains(function ($r) { - return $r['target'] === 'default._domainkey.' . config('anonaddy.domain'); + return $r['target'] === 'default._domainkey.'.config('anonaddy.domain'); }); - if (!$def) { + if (! $def) { return response()->json([ 'success' => false, - 'message' => 'CNAME default._domainkey record not found. This could be due to DNS caching, please try again later.' + 'message' => 'CNAME default._domainkey record not found. This could be due to DNS caching, please try again later.', ]); } @@ -278,7 +278,7 @@ class Domain extends Model return response()->json([ 'success' => true, 'message' => 'Records successfully verified.', - 'data' => new DomainResource($this->fresh()) + 'data' => new DomainResource($this->fresh()), ]); } } diff --git a/app/Models/EmailData.php b/app/Models/EmailData.php index 28f470b..c056626 100644 --- a/app/Models/EmailData.php +++ b/app/Models/EmailData.php @@ -79,10 +79,10 @@ class EmailData ]; } else { $this->attachments[] = [ - 'stream' => base64_encode(stream_get_contents($attachment->getStream())), - 'file_name' => base64_encode($attachment->getFileName()), - 'mime' => base64_encode($contentType) - ]; + 'stream' => base64_encode(stream_get_contents($attachment->getStream())), + 'file_name' => base64_encode($attachment->getFileName()), + 'mime' => base64_encode($contentType), + ]; } } } diff --git a/app/Models/FailedDelivery.php b/app/Models/FailedDelivery.php index 472e165..5690b0c 100644 --- a/app/Models/FailedDelivery.php +++ b/app/Models/FailedDelivery.php @@ -19,7 +19,7 @@ class FailedDelivery extends Model protected $keyType = 'string'; protected $encrypted = [ - 'sender' + 'sender', ]; protected $fillable = [ @@ -32,20 +32,20 @@ class FailedDelivery extends Model 'email_type', 'status', 'code', - 'attempted_at' + 'attempted_at', ]; protected $dates = [ 'attempted_at', 'created_at', - 'updated_at' + 'updated_at', ]; protected $casts = [ 'id' => 'string', 'user_id' => 'string', 'recipient_id' => 'string', - 'alias_id' => 'string' + 'alias_id' => 'string', ]; /** diff --git a/app/Models/PostfixQueueId.php b/app/Models/PostfixQueueId.php index ac4f10a..5c1ea33 100644 --- a/app/Models/PostfixQueueId.php +++ b/app/Models/PostfixQueueId.php @@ -19,7 +19,7 @@ class PostfixQueueId extends Model protected $dates = [ 'created_at', - 'updated_at' + 'updated_at', ]; protected $casts = [ diff --git a/app/Models/Recipient.php b/app/Models/Recipient.php index 27b6aa5..5e5432e 100644 --- a/app/Models/Recipient.php +++ b/app/Models/Recipient.php @@ -8,7 +8,6 @@ use App\Traits\HasEncryptedAttributes; use App\Traits\HasUuid; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; - use Illuminate\Notifications\Notifiable; class Recipient extends Model @@ -24,7 +23,7 @@ class Recipient extends Model protected $encrypted = [ 'email', - 'fingerprint' + 'fingerprint', ]; protected $fillable = [ @@ -35,13 +34,13 @@ class Recipient extends Model 'inline_encryption', 'protected_headers', 'fingerprint', - 'email_verified_at' + 'email_verified_at', ]; protected $dates = [ 'created_at', 'updated_at', - 'email_verified_at' + 'email_verified_at', ]; protected $casts = [ @@ -50,7 +49,7 @@ class Recipient extends Model 'can_reply_send' => 'boolean', 'should_encrypt' => 'boolean', 'inline_encryption' => 'boolean', - 'protected_headers' => 'boolean' + 'protected_headers' => 'boolean', ]; public static function boot() diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 48aa5d1..3b977e6 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -24,12 +24,12 @@ class Rule extends Model 'replies', 'sends', 'active', - 'order' + 'order', ]; protected $dates = [ 'created_at', - 'updated_at' + 'updated_at', ]; protected $casts = [ @@ -40,7 +40,7 @@ class Rule extends Model 'replies' => 'boolean', 'sends' => 'boolean', 'conditions' => 'array', - 'actions' => 'array' + 'actions' => 'array', ]; /** diff --git a/app/Models/User.php b/app/Models/User.php index 1a6bf03..9aa32f1 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -46,13 +46,13 @@ class User extends Authenticatable implements MustVerifyEmail 'password', 'two_factor_enabled', 'two_factor_secret', - 'two_factor_backup_code' + 'two_factor_backup_code', ]; protected $encrypted = [ 'from_name', 'email_subject', - 'two_factor_secret' + 'two_factor_secret', ]; /** @@ -64,7 +64,7 @@ class User extends Authenticatable implements MustVerifyEmail 'password', 'remember_token', 'two_factor_secret', - 'two_factor_backup_code' + 'two_factor_backup_code', ]; /** @@ -78,13 +78,13 @@ class User extends Authenticatable implements MustVerifyEmail 'default_recipient_id' => 'string', 'catch_all' => 'boolean', 'two_factor_enabled' => 'boolean', - 'use_reply_to' => 'boolean' + 'use_reply_to' => 'boolean', ]; protected $dates = [ 'created_at', 'updated_at', - 'email_verified_at' + 'email_verified_at', ]; /** @@ -404,6 +404,7 @@ class User extends Authenticatable implements MustVerifyEmail } $withoutExtension = preg_replace('/\+[\s\S]+(?=@)/', '', $recipient->email); + return strtolower($withoutExtension); }) ->contains(strtolower($email)); @@ -455,7 +456,7 @@ class User extends Authenticatable implements MustVerifyEmail $recipientsUsingFingerprint->first()->update([ 'should_encrypt' => false, - 'fingerprint' => null + 'fingerprint' => null, ]); } }); diff --git a/app/Models/Username.php b/app/Models/Username.php index f384e4e..660aab8 100644 --- a/app/Models/Username.php +++ b/app/Models/Username.php @@ -18,7 +18,7 @@ class Username extends Model protected $keyType = 'string'; protected $encrypted = [ - 'description' + 'description', ]; protected $fillable = [ @@ -31,7 +31,7 @@ class Username extends Model protected $dates = [ 'created_at', - 'updated_at' + 'updated_at', ]; protected $casts = [ @@ -39,7 +39,7 @@ class Username extends Model 'user_id' => 'string', 'active' => 'boolean', 'catch_all' => 'boolean', - 'default_recipient_id' => 'string' + 'default_recipient_id' => 'string', ]; public static function boot() @@ -83,6 +83,7 @@ class Username extends Model { return $this->hasOne(Recipient::class, 'id', 'default_recipient_id'); } + /** * Set the usernames's default recipient. */ diff --git a/app/Notifications/CustomVerifyEmail.php b/app/Notifications/CustomVerifyEmail.php index 3a3e2c7..f0c2081 100644 --- a/app/Notifications/CustomVerifyEmail.php +++ b/app/Notifications/CustomVerifyEmail.php @@ -40,7 +40,7 @@ class CustomVerifyEmail extends VerifyEmail implements ShouldQueue, ShouldBeEncr ->subject(Lang::get('Verify Email Address')) ->markdown('mail.verify_email', [ 'verificationUrl' => $verificationUrl, - 'recipientId' => $recipientId + 'recipientId' => $recipientId, ]) ->withSymfonyMessage(function (Email $message) use ($feedbackId) { $message->getHeaders() diff --git a/app/Notifications/DefaultRecipientUpdated.php b/app/Notifications/DefaultRecipientUpdated.php index 8bcaf1f..5a1acf1 100644 --- a/app/Notifications/DefaultRecipientUpdated.php +++ b/app/Notifications/DefaultRecipientUpdated.php @@ -45,12 +45,12 @@ class DefaultRecipientUpdated extends Notification implements ShouldQueue, Shoul public function toMail($notifiable) { return (new MailMessage()) - ->subject("Your default recipient has just been updated") + ->subject('Your default recipient has just been updated') ->markdown('mail.default_recipient_updated', [ 'defaultRecipient' => $notifiable->email, 'newDefaultRecipient' => $this->newDefaultRecipient, 'recipientId' => $notifiable->id, - 'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null + 'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Notifications/DisallowedReplySendAttempt.php b/app/Notifications/DisallowedReplySendAttempt.php index df2c7cd..52c25d0 100644 --- a/app/Notifications/DisallowedReplySendAttempt.php +++ b/app/Notifications/DisallowedReplySendAttempt.php @@ -15,8 +15,11 @@ class DisallowedReplySendAttempt extends Notification implements ShouldQueue, Sh use Queueable; protected $aliasEmail; + protected $recipient; + protected $destination; + protected $authenticationResults; /** @@ -26,7 +29,7 @@ class DisallowedReplySendAttempt extends Notification implements ShouldQueue, Sh */ public function __construct($alias, $recipient, $authenticationResults) { - $this->aliasEmail = $alias['local_part'] . '@' . $alias['domain']; + $this->aliasEmail = $alias['local_part'].'@'.$alias['domain']; $this->recipient = $recipient; $this->destination = Str::replaceLast('=', '@', $alias['extension']); $this->authenticationResults = $authenticationResults; @@ -61,7 +64,7 @@ class DisallowedReplySendAttempt extends Notification implements ShouldQueue, Sh 'destination' => $this->destination, 'authenticationResults' => $this->authenticationResults, 'recipientId' => $notifiable->id, - 'fingerprint' => $fingerprint + 'fingerprint' => $fingerprint, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Notifications/DomainMxRecordsInvalid.php b/app/Notifications/DomainMxRecordsInvalid.php index a8d1a54..621d819 100644 --- a/app/Notifications/DomainMxRecordsInvalid.php +++ b/app/Notifications/DomainMxRecordsInvalid.php @@ -52,7 +52,7 @@ class DomainMxRecordsInvalid extends Notification implements ShouldQueue, Should ->markdown('mail.domain_mx_records_invalid', [ 'domain' => $this->domain, 'recipientId' => $recipient->_id, - 'fingerprint' => $fingerprint + 'fingerprint' => $fingerprint, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Notifications/DomainUnverifiedForSending.php b/app/Notifications/DomainUnverifiedForSending.php index cfbb8f8..c3a61c7 100644 --- a/app/Notifications/DomainUnverifiedForSending.php +++ b/app/Notifications/DomainUnverifiedForSending.php @@ -14,6 +14,7 @@ class DomainUnverifiedForSending extends Notification implements ShouldQueue, Sh use Queueable; protected $domain; + protected $reason; /** @@ -50,12 +51,12 @@ class DomainUnverifiedForSending extends Notification implements ShouldQueue, Sh $fingerprint = $recipient->should_encrypt ? $recipient->fingerprint : null; return (new MailMessage()) - ->subject("Your domain has been unverified for sending on AnonAddy") + ->subject('Your domain has been unverified for sending on AnonAddy') ->markdown('mail.domain_unverified_for_sending', [ 'domain' => $this->domain, 'reason' => $this->reason, 'recipientId' => $recipient->id, - 'fingerprint' => $fingerprint + 'fingerprint' => $fingerprint, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Notifications/FailedDeliveryNotification.php b/app/Notifications/FailedDeliveryNotification.php index 137c277..3b95fc2 100644 --- a/app/Notifications/FailedDeliveryNotification.php +++ b/app/Notifications/FailedDeliveryNotification.php @@ -13,7 +13,9 @@ class FailedDeliveryNotification extends Notification implements ShouldQueue, Sh use Queueable; protected $aliasEmail; + protected $originalSender; + protected $originalSubject; /** @@ -48,13 +50,13 @@ class FailedDeliveryNotification extends Notification implements ShouldQueue, Sh public function toMail($notifiable) { return (new MailMessage()) - ->subject("New failed delivery on AnonAddy") + ->subject('New failed delivery on AnonAddy') ->markdown('mail.failed_delivery_notification', [ 'aliasEmail' => $this->aliasEmail, 'originalSender' => $this->originalSender, 'originalSubject' => $this->originalSubject, 'recipientId' => $notifiable->id, - 'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null + 'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null, ]) ->withSymfonyMessage(function ($message) { $message->getHeaders() diff --git a/app/Notifications/GpgKeyExpired.php b/app/Notifications/GpgKeyExpired.php index 8c0fd70..3ff3ac8 100644 --- a/app/Notifications/GpgKeyExpired.php +++ b/app/Notifications/GpgKeyExpired.php @@ -33,9 +33,9 @@ class GpgKeyExpired extends Notification implements ShouldQueue, ShouldBeEncrypt public function toMail($notifiable) { return (new MailMessage()) - ->subject("Your GPG key has expired on AnonAddy") + ->subject('Your GPG key has expired on AnonAddy') ->markdown('mail.gpg_key_expired', [ - 'recipient' => $notifiable + 'recipient' => $notifiable, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Notifications/IncorrectOtpNotification.php b/app/Notifications/IncorrectOtpNotification.php index 8df346f..8ffaa8b 100644 --- a/app/Notifications/IncorrectOtpNotification.php +++ b/app/Notifications/IncorrectOtpNotification.php @@ -36,12 +36,12 @@ class IncorrectOtpNotification extends Notification implements ShouldQueue, Shou $fingerprint = $recipient->should_encrypt ? $recipient->fingerprint : null; return (new MailMessage()) - ->subject("Failed Two Factor Authentication Login Attempt") + ->subject('Failed Two Factor Authentication Login Attempt') ->markdown('mail.failed_login_attempt', [ 'recipientId' => $recipient->id, 'hasVerifiedEmail' => $recipient->hasVerifiedEmail(), 'fingerprint' => $fingerprint, - 'username' => $notifiable->username + 'username' => $notifiable->username, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Notifications/NearBandwidthLimit.php b/app/Notifications/NearBandwidthLimit.php index 1a14974..ae7e739 100644 --- a/app/Notifications/NearBandwidthLimit.php +++ b/app/Notifications/NearBandwidthLimit.php @@ -14,6 +14,7 @@ class NearBandwidthLimit extends Notification implements ShouldQueue, ShouldBeEn use Queueable; protected $month; + protected $reset; /** @@ -57,7 +58,7 @@ class NearBandwidthLimit extends Notification implements ShouldQueue, ShouldBeEn 'month' => $this->month, 'reset' => $this->reset, 'recipientId' => $recipient->id, - 'fingerprint' => $fingerprint + 'fingerprint' => $fingerprint, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Notifications/SpamReplySendAttempt.php b/app/Notifications/SpamReplySendAttempt.php index 8dc0dec..f9fa19c 100644 --- a/app/Notifications/SpamReplySendAttempt.php +++ b/app/Notifications/SpamReplySendAttempt.php @@ -15,8 +15,11 @@ class SpamReplySendAttempt extends Notification implements ShouldQueue, ShouldBe use Queueable; protected $aliasEmail; + protected $recipient; + protected $destination; + protected $authenticationResults; /** @@ -26,7 +29,7 @@ class SpamReplySendAttempt extends Notification implements ShouldQueue, ShouldBe */ public function __construct($alias, $recipient, $authenticationResults) { - $this->aliasEmail = $alias['local_part'] . '@' . $alias['domain']; + $this->aliasEmail = $alias['local_part'].'@'.$alias['domain']; $this->recipient = $recipient; $this->destination = Str::replaceLast('=', '@', $alias['extension']); $this->authenticationResults = $authenticationResults; @@ -59,7 +62,7 @@ class SpamReplySendAttempt extends Notification implements ShouldQueue, ShouldBe 'destination' => $this->destination, 'authenticationResults' => $this->authenticationResults, 'recipientId' => $notifiable->id, - 'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null + 'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Notifications/UsernameReminder.php b/app/Notifications/UsernameReminder.php index 77d6ca0..12f36f4 100644 --- a/app/Notifications/UsernameReminder.php +++ b/app/Notifications/UsernameReminder.php @@ -33,11 +33,11 @@ class UsernameReminder extends Notification implements ShouldQueue, ShouldBeEncr public function toMail($notifiable) { return (new MailMessage()) - ->subject("AnonAddy Username Reminder") + ->subject('AnonAddy Username Reminder') ->markdown('mail.username_reminder', [ 'username' => $notifiable->user->username, 'recipientId' => $notifiable->id, - 'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null + 'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null, ]) ->withSymfonyMessage(function (Email $message) { $message->getHeaders() diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 29918a9..c420604 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -25,8 +25,8 @@ class EventServiceProvider extends ServiceProvider CheckIfShouldBlock::class, ], LoginFailed::class => [ - SendIncorrectOtpNotification::class - ] + SendIncorrectOtpNotification::class, + ], ]; /** diff --git a/app/Providers/HelperServiceProvider.php b/app/Providers/HelperServiceProvider.php index 651d300..6107734 100644 --- a/app/Providers/HelperServiceProvider.php +++ b/app/Providers/HelperServiceProvider.php @@ -13,8 +13,8 @@ class HelperServiceProvider extends ServiceProvider */ public function register() { - require_once(app_path().'/Helpers/Helper.php'); - require_once(app_path().'/Helpers/GitVersionHelper.php'); + require_once app_path().'/Helpers/Helper.php'; + require_once app_path().'/Helpers/GitVersionHelper.php'; } /** diff --git a/app/Rules/NotBlacklisted.php b/app/Rules/NotBlacklisted.php index f29cc04..64dc712 100644 --- a/app/Rules/NotBlacklisted.php +++ b/app/Rules/NotBlacklisted.php @@ -25,7 +25,7 @@ class NotBlacklisted implements Rule */ public function passes($attribute, $value) { - return !in_array(strtolower($value), config('anonaddy.blacklist')); + return ! in_array(strtolower($value), config('anonaddy.blacklist')); } /** diff --git a/app/Rules/NotDeletedUsername.php b/app/Rules/NotDeletedUsername.php index dfb6983..e5dae4f 100644 --- a/app/Rules/NotDeletedUsername.php +++ b/app/Rules/NotDeletedUsername.php @@ -33,7 +33,7 @@ class NotDeletedUsername implements Rule }) ->toArray(); - return !in_array(strtolower($value), $deletedUsernames); + return ! in_array(strtolower($value), $deletedUsernames); } /** diff --git a/app/Rules/NotLocalRecipient.php b/app/Rules/NotLocalRecipient.php index bdd3319..f2a1af8 100644 --- a/app/Rules/NotLocalRecipient.php +++ b/app/Rules/NotLocalRecipient.php @@ -36,7 +36,7 @@ class NotLocalRecipient implements Rule $count = collect(config('anonaddy.all_domains')) ->filter(function ($domain) use ($emailDomain) { - return $domain === $emailDomain || Str::endsWith($emailDomain, '.' . $domain); + return $domain === $emailDomain || Str::endsWith($emailDomain, '.'.$domain); }) ->count(); diff --git a/app/Rules/ValidRuleId.php b/app/Rules/ValidRuleId.php index 5b38e7e..e570566 100644 --- a/app/Rules/ValidRuleId.php +++ b/app/Rules/ValidRuleId.php @@ -33,7 +33,7 @@ class ValidRuleId implements Rule ->toArray(); foreach ($ids as $id) { - if (!in_array($id, $validRuleIds)) { + if (! in_array($id, $validRuleIds)) { return false; } } diff --git a/app/Rules/VerifiedRecipientId.php b/app/Rules/VerifiedRecipientId.php index 13f21ef..2852891 100644 --- a/app/Rules/VerifiedRecipientId.php +++ b/app/Rules/VerifiedRecipientId.php @@ -41,7 +41,7 @@ class VerifiedRecipientId implements Rule } foreach ($ids as $id) { - if (!in_array($id, $verifiedRecipientIds)) { + if (! in_array($id, $verifiedRecipientIds)) { return false; } } diff --git a/app/Services/Webauthn.php b/app/Services/Webauthn.php index 2f051a8..4e2f957 100644 --- a/app/Services/Webauthn.php +++ b/app/Services/Webauthn.php @@ -22,7 +22,7 @@ class Webauthn extends ServicesWebauthn /** * Detect if user has a key that is enabled. * - * @param User $user + * @param User $user * @return bool */ public static function hasKey(User $user): bool diff --git a/app/Traits/CheckUserRules.php b/app/Traits/CheckUserRules.php index 5dc9fcf..1ed854c 100644 --- a/app/Traits/CheckUserRules.php +++ b/app/Traits/CheckUserRules.php @@ -6,7 +6,7 @@ use Illuminate\Support\Str; trait CheckUserRules { - public function checkRules(String $emailType) + public function checkRules(string $emailType) { $method = "activeRulesFor{$emailType}Ordered"; $this->user->{$method}->each(function ($rule) { @@ -16,7 +16,7 @@ trait CheckUserRules collect($rule->actions)->each(function ($action) { $this->applyAction($action); }); - }; + } }); } @@ -109,7 +109,7 @@ trait CheckUserRules { switch ($action['type']) { case 'subject': - $this->replacedSubject = ' with subject "' . base64_decode($this->emailSubject) . '"'; + $this->replacedSubject = ' with subject "'.base64_decode($this->emailSubject).'"'; $this->email->subject = $action['value']; break; case 'displayFrom': diff --git a/app/Traits/HasEncryptedAttributes.php b/app/Traits/HasEncryptedAttributes.php index 320a505..aa6a7c5 100644 --- a/app/Traits/HasEncryptedAttributes.php +++ b/app/Traits/HasEncryptedAttributes.php @@ -10,7 +10,7 @@ trait HasEncryptedAttributes { $value = parent::getAttribute($key); - if (!is_null($value) && in_array($key, $this->encrypted)) { + if (! is_null($value) && in_array($key, $this->encrypted)) { $value = Crypt::decrypt($value); } @@ -19,7 +19,7 @@ trait HasEncryptedAttributes public function setAttribute($key, $value) { - if (!is_null($value) && in_array($key, $this->encrypted)) { + if (! is_null($value) && in_array($key, $this->encrypted)) { $value = Crypt::encrypt($value); } @@ -35,6 +35,7 @@ trait HasEncryptedAttributes $attributes[$key] = Crypt::decrypt($attributes[$key]); } } + return $attributes; } } diff --git a/app/Traits/HasUuid.php b/app/Traits/HasUuid.php index 1e6ae01..1c993fe 100644 --- a/app/Traits/HasUuid.php +++ b/app/Traits/HasUuid.php @@ -9,7 +9,7 @@ trait HasUuid protected static function bootHasUuid() { static::creating(function ($model) { - if (!$model->id) { + if (! $model->id) { $model->{$model->getKeyName()} = Uuid::uuid4(); } }); diff --git a/composer.json b/composer.json index 1944cb2..19bdf97 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require-dev": { "fakerphp/faker": "^1.9.1", - "friendsofphp/php-cs-fixer": "^3.0.0", + "laravel/pint": "^1.2", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^6.1", "phpunit/phpunit": "^9.5.10", @@ -71,7 +71,7 @@ "@php artisan key:generate --ansi" ], "format": [ - "./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.php" + "./vendor/bin/pint" ] } } diff --git a/composer.lock b/composer.lock index c927a9f..f86cf78 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0d50c40694adb5c78fe707fbe5c9bc74", + "content-hash": "430518240ca457d0013bed27fb8a033a", "packages": [ { "name": "asbiin/laravel-webauthn", @@ -1788,16 +1788,16 @@ }, { "name": "laravel/framework", - "version": "v9.40.1", + "version": "v9.41.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "9611fdaf2db5759b8299802d7185bcdbee0340bb" + "reference": "cc902ce61b4ca08ca7449664cfab2fa96a1d1e28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/9611fdaf2db5759b8299802d7185bcdbee0340bb", - "reference": "9611fdaf2db5759b8299802d7185bcdbee0340bb", + "url": "https://api.github.com/repos/laravel/framework/zipball/cc902ce61b4ca08ca7449664cfab2fa96a1d1e28", + "reference": "cc902ce61b4ca08ca7449664cfab2fa96a1d1e28", "shasum": "" }, "require": { @@ -1970,7 +1970,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-11-15T16:13:22+00:00" + "time": "2022-11-22T15:10:46+00:00" }, { "name": "laravel/sanctum", @@ -2477,16 +2477,16 @@ }, { "name": "league/flysystem", - "version": "3.10.3", + "version": "3.10.4", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a" + "reference": "a7790f3dd1b27af81d380e6b2afa77c16ab7e181" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a", - "reference": "8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a7790f3dd1b27af81d380e6b2afa77c16ab7e181", + "reference": "a7790f3dd1b27af81d380e6b2afa77c16ab7e181", "shasum": "" }, "require": { @@ -2548,7 +2548,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.10.3" + "source": "https://github.com/thephpleague/flysystem/tree/3.10.4" }, "funding": [ { @@ -2564,7 +2564,7 @@ "type": "tidelift" } ], - "time": "2022-11-14T10:42:43+00:00" + "time": "2022-11-26T19:48:01+00:00" }, { "name": "league/mime-type-detection", @@ -2703,26 +2703,27 @@ }, { "name": "maennchen/zipstream-php", - "version": "2.2.1", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/maennchen/ZipStream-PHP.git", - "reference": "211e9ba1530ea5260b45d90c9ea252f56ec52729" + "reference": "8df0a40fff7b5cbf86cf9a6d7d8d15b9bc03bc98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/211e9ba1530ea5260b45d90c9ea252f56ec52729", - "reference": "211e9ba1530ea5260b45d90c9ea252f56ec52729", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/8df0a40fff7b5cbf86cf9a6d7d8d15b9bc03bc98", + "reference": "8df0a40fff7b5cbf86cf9a6d7d8d15b9bc03bc98", "shasum": "" }, "require": { "myclabs/php-enum": "^1.5", - "php": "^7.4 || ^8.0", + "php": "^8.0", "psr/http-message": "^1.0", "symfony/polyfill-mbstring": "^1.0" }, "require-dev": { "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.9", "guzzlehttp/guzzle": "^6.5.3 || ^7.2.0", "mikey179/vfsstream": "^1.6", "php-coveralls/php-coveralls": "^2.4", @@ -2764,15 +2765,19 @@ ], "support": { "issues": "https://github.com/maennchen/ZipStream-PHP/issues", - "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.2.1" + "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.3.0" }, "funding": [ + { + "url": "https://github.com/maennchen", + "type": "github" + }, { "url": "https://opencollective.com/zipstream", "type": "open_collective" } ], - "time": "2022-05-18T15:52:06+00:00" + "time": "2022-11-28T12:13:34+00:00" }, { "name": "markbaker/complex", @@ -4086,6 +4091,54 @@ }, "time": "2021-02-03T23:26:27+00:00" }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, { "name": "psr/container", "version": "2.0.2", @@ -4923,20 +4976,21 @@ }, { "name": "stella-maris/clock", - "version": "0.1.6", + "version": "0.1.7", "source": { "type": "git", "url": "https://github.com/stella-maris-solutions/clock.git", - "reference": "a94228dac03c9a8411198ce8c8dacbbe99c930c3" + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stella-maris-solutions/clock/zipball/a94228dac03c9a8411198ce8c8dacbbe99c930c3", - "reference": "a94228dac03c9a8411198ce8c8dacbbe99c930c3", + "url": "https://api.github.com/repos/stella-maris-solutions/clock/zipball/fa23ce16019289a18bb3446fdecd45befcdd94f8", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8", "shasum": "" }, "require": { - "php": "^7.0|^8.0" + "php": "^7.0|^8.0", + "psr/clock": "^1.0" }, "type": "library", "autoload": { @@ -4963,23 +5017,22 @@ "psr20" ], "support": { - "issues": "https://github.com/stella-maris-solutions/clock/issues", - "source": "https://github.com/stella-maris-solutions/clock/tree/0.1.6" + "source": "https://github.com/stella-maris-solutions/clock/tree/0.1.7" }, - "time": "2022-09-27T15:03:11+00:00" + "time": "2022-11-25T16:15:06+00:00" }, { "name": "symfony/console", - "version": "v6.1.7", + "version": "v6.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a1282bd0c096e0bdb8800b104177e2ce404d8815" + "reference": "a71863ea74f444d93c768deb3e314e1f750cf20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a1282bd0c096e0bdb8800b104177e2ce404d8815", - "reference": "a1282bd0c096e0bdb8800b104177e2ce404d8815", + "url": "https://api.github.com/repos/symfony/console/zipball/a71863ea74f444d93c768deb3e314e1f750cf20d", + "reference": "a71863ea74f444d93c768deb3e314e1f750cf20d", "shasum": "" }, "require": { @@ -5046,7 +5099,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.7" + "source": "https://github.com/symfony/console/tree/v6.1.8" }, "funding": [ { @@ -5062,7 +5115,7 @@ "type": "tidelift" } ], - "time": "2022-10-26T21:42:49+00:00" + "time": "2022-11-25T18:59:16+00:00" }, { "name": "symfony/css-selector", @@ -5495,16 +5548,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.1.7", + "version": "v6.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "792a1856d2b95273f0e1c3435785f1d01a60ecc6" + "reference": "46b278fb1dae3e65ba30ead50f1c81fbd1c6a79e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/792a1856d2b95273f0e1c3435785f1d01a60ecc6", - "reference": "792a1856d2b95273f0e1c3435785f1d01a60ecc6", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/46b278fb1dae3e65ba30ead50f1c81fbd1c6a79e", + "reference": "46b278fb1dae3e65ba30ead50f1c81fbd1c6a79e", "shasum": "" }, "require": { @@ -5550,7 +5603,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.1.7" + "source": "https://github.com/symfony/http-foundation/tree/v6.1.8" }, "funding": [ { @@ -5566,20 +5619,20 @@ "type": "tidelift" } ], - "time": "2022-10-12T09:44:59+00:00" + "time": "2022-11-07T08:07:30+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.1.7", + "version": "v6.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "8fc1ffe753948c47a103a809cdd6a4a8458b3254" + "reference": "6073eaed148f4c0b8d4ae33e7332b34327ef728e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8fc1ffe753948c47a103a809cdd6a4a8458b3254", - "reference": "8fc1ffe753948c47a103a809cdd6a4a8458b3254", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6073eaed148f4c0b8d4ae33e7332b34327ef728e", + "reference": "6073eaed148f4c0b8d4ae33e7332b34327ef728e", "shasum": "" }, "require": { @@ -5660,7 +5713,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.1.7" + "source": "https://github.com/symfony/http-kernel/tree/v6.1.8" }, "funding": [ { @@ -5676,20 +5729,20 @@ "type": "tidelift" } ], - "time": "2022-10-28T18:06:36+00:00" + "time": "2022-11-28T18:20:59+00:00" }, { "name": "symfony/mailer", - "version": "v6.1.7", + "version": "v6.1.8", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "7e19813c0b43387c55665780c4caea505cc48391" + "reference": "42eb71e4bac099cff22fef1b8eae493eb4fd058f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/7e19813c0b43387c55665780c4caea505cc48391", - "reference": "7e19813c0b43387c55665780c4caea505cc48391", + "url": "https://api.github.com/repos/symfony/mailer/zipball/42eb71e4bac099cff22fef1b8eae493eb4fd058f", + "reference": "42eb71e4bac099cff22fef1b8eae493eb4fd058f", "shasum": "" }, "require": { @@ -5734,7 +5787,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.1.7" + "source": "https://github.com/symfony/mailer/tree/v6.1.8" }, "funding": [ { @@ -5750,20 +5803,20 @@ "type": "tidelift" } ], - "time": "2022-10-28T16:23:08+00:00" + "time": "2022-11-04T07:40:42+00:00" }, { "name": "symfony/mime", - "version": "v6.1.7", + "version": "v6.1.8", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "f440f066d57691088d998d6e437ce98771144618" + "reference": "d02c3938a50fbc95cf8f364be1c011758270f30e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/f440f066d57691088d998d6e437ce98771144618", - "reference": "f440f066d57691088d998d6e437ce98771144618", + "url": "https://api.github.com/repos/symfony/mime/zipball/d02c3938a50fbc95cf8f364be1c011758270f30e", + "reference": "d02c3938a50fbc95cf8f364be1c011758270f30e", "shasum": "" }, "require": { @@ -5815,7 +5868,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.1.7" + "source": "https://github.com/symfony/mime/tree/v6.1.8" }, "funding": [ { @@ -5831,7 +5884,7 @@ "type": "tidelift" } ], - "time": "2022-10-19T08:10:53+00:00" + "time": "2022-11-28T12:27:40+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8026,297 +8079,6 @@ } ], "packages-dev": [ - { - "name": "composer/pcre", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-11-17T09:50:14+00:00" - }, - { - "name": "composer/semver", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-04-01T19:23:25+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-25T21:32:43+00:00" - }, - { - "name": "doctrine/annotations", - "version": "1.13.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", - "vimeo/psalm": "^4.10" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.3" - }, - "time": "2022-07-02T10:48:51+00:00" - }, { "name": "doctrine/instantiator", "version": "1.4.1", @@ -8525,95 +8287,6 @@ ], "time": "2022-11-02T16:23:29+00:00" }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.13.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a6232229a8309e8811dc751c28b91cb34b2943e1", - "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1", - "shasum": "" - }, - "require": { - "composer/semver": "^3.2", - "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^1.13", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php80": "^1.25", - "symfony/polyfill-php81": "^1.25", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.0", - "mikey179/vfsstream": "^1.6.10", - "php-coveralls/php-coveralls": "^2.5.2", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", - "symfony/phpunit-bridge": "^6.0", - "symfony/yaml": "^5.4 || ^6.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.13.0" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2022-10-31T19:28:50+00:00" - }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -8665,6 +8338,72 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "laravel/pint", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/1d276e4c803397a26cc337df908f55c2a4e90d86", + "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.11.0", + "illuminate/view": "^9.27", + "laravel-zero/framework": "^9.1.3", + "mockery/mockery": "^1.5.0", + "nunomaduro/larastan": "^2.2", + "nunomaduro/termwind": "^1.14.0", + "pestphp/pest": "^1.22.1" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2022-09-13T15:07:15+00:00" + }, { "name": "mockery/mockery", "version": "1.5.1", @@ -10937,136 +10676,6 @@ ], "time": "2022-08-11T14:04:18+00:00" }, - { - "name": "symfony/filesystem", - "version": "v6.1.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "4d216a2beef096edf040a070117c39ca2abce307" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/4d216a2beef096edf040a070117c39ca2abce307", - "reference": "4d216a2beef096edf040a070117c39ca2abce307", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.1.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-09-21T20:29:40+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v6.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a3016f5442e28386ded73c43a32a5b68586dd1c4", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.1.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-02-25T11:15:52+00:00" - }, { "name": "symfony/polyfill-iconv", "version": "v1.27.0", diff --git a/config/anonaddy.php b/config/anonaddy.php index d72acd5..a158b21 100644 --- a/config/anonaddy.php +++ b/config/anonaddy.php @@ -200,7 +200,7 @@ return [ | */ - 'blacklist' =>[ + 'blacklist' => [ '.htaccess', '.htpasswd', '.well-known', @@ -738,7 +738,7 @@ return [ 'you', 'yourname', 'yourusername', - 'zlib' + 'zlib', ], 'wordlist' => [ @@ -8513,6 +8513,6 @@ return [ 'zookeeper', 'zoologist', 'zoology', - 'zoom' - ] + 'zoom', + ], ]; diff --git a/config/captcha.php b/config/captcha.php index d115cb6..4acd57e 100644 --- a/config/captcha.php +++ b/config/captcha.php @@ -44,5 +44,5 @@ return [ 'blur' => 2, 'invert' => true, 'contrast' => -5, - ] + ], ]; diff --git a/config/cors.php b/config/cors.php index 217a329..55525fc 100644 --- a/config/cors.php +++ b/config/cors.php @@ -31,7 +31,7 @@ return [ 'Content-Type', 'Expires', 'Last-Modified', - 'Pragma' + 'Pragma', ], 'max_age' => 0, diff --git a/config/excel.php b/config/excel.php index bf0a051..8fcabcf 100644 --- a/config/excel.php +++ b/config/excel.php @@ -15,7 +15,7 @@ return [ | Here you can specify how big the chunk should be. | */ - 'chunk_size' => 1000, + 'chunk_size' => 1000, /* |-------------------------------------------------------------------------- @@ -32,17 +32,17 @@ return [ | Configure e.g. delimiter, enclosure and line ending for CSV exports. | */ - 'csv' => [ - 'delimiter' => ',', - 'enclosure' => '"', - 'line_ending' => PHP_EOL, - 'use_bom' => false, + 'csv' => [ + 'delimiter' => ',', + 'enclosure' => '"', + 'line_ending' => PHP_EOL, + 'use_bom' => false, 'include_separator_line' => false, - 'excel_compatibility' => false, + 'excel_compatibility' => false, ], ], - 'imports' => [ + 'imports' => [ 'read_only' => true, @@ -68,12 +68,12 @@ return [ | Configure e.g. delimiter, enclosure and line ending for CSV imports. | */ - 'csv' => [ - 'delimiter' => ',', - 'enclosure' => '"', - 'escape_character' => '\\', - 'contiguous' => false, - 'input_encoding' => 'UTF-8', + 'csv' => [ + 'delimiter' => ',', + 'enclosure' => '"', + 'escape_character' => '\\', + 'contiguous' => false, + 'input_encoding' => 'UTF-8', ], ], @@ -88,21 +88,21 @@ return [ | */ 'extension_detector' => [ - 'xlsx' => Excel::XLSX, - 'xlsm' => Excel::XLSX, - 'xltx' => Excel::XLSX, - 'xltm' => Excel::XLSX, - 'xls' => Excel::XLS, - 'xlt' => Excel::XLS, - 'ods' => Excel::ODS, - 'ots' => Excel::ODS, - 'slk' => Excel::SLK, - 'xml' => Excel::XML, + 'xlsx' => Excel::XLSX, + 'xlsm' => Excel::XLSX, + 'xltx' => Excel::XLSX, + 'xltm' => Excel::XLSX, + 'xls' => Excel::XLS, + 'xlt' => Excel::XLS, + 'ods' => Excel::ODS, + 'ots' => Excel::ODS, + 'slk' => Excel::SLK, + 'xml' => Excel::XML, 'gnumeric' => Excel::GNUMERIC, - 'htm' => Excel::HTML, - 'html' => Excel::HTML, - 'csv' => Excel::CSV, - 'tsv' => Excel::TSV, + 'htm' => Excel::HTML, + 'html' => Excel::HTML, + 'csv' => Excel::CSV, + 'tsv' => Excel::TSV, /* |-------------------------------------------------------------------------- @@ -113,7 +113,7 @@ return [ | Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF | */ - 'pdf' => Excel::DOMPDF, + 'pdf' => Excel::DOMPDF, ], 'value_binder' => [ @@ -163,7 +163,7 @@ return [ | storing reading or downloading. Here you can customize that path. | */ - 'local_path' => sys_get_temp_dir(), + 'local_path' => sys_get_temp_dir(), /* |-------------------------------------------------------------------------- @@ -179,7 +179,7 @@ return [ | in conjunction with queued imports and exports. | */ - 'remote_disk' => null, + 'remote_disk' => null, 'remote_prefix' => null, /* diff --git a/database/factories/AliasFactory.php b/database/factories/AliasFactory.php index 346487b..416f3ec 100644 --- a/database/factories/AliasFactory.php +++ b/database/factories/AliasFactory.php @@ -22,13 +22,14 @@ class AliasFactory extends Factory public function definition() { $localPart = $this->faker->userName.$this->faker->randomNumber(2); + return [ 'user_id' => $this->faker->uuid, 'email' => $localPart.'@'.$this->faker->word.'.'.config('anonaddy.domain'), 'local_part' => $localPart, 'domain' => 'johndoe.'.config('anonaddy.domain'), 'active' => true, - 'description' => $this->faker->sentence + 'description' => $this->faker->sentence, ]; } } diff --git a/database/factories/DomainFactory.php b/database/factories/DomainFactory.php index a3c0277..064f549 100644 --- a/database/factories/DomainFactory.php +++ b/database/factories/DomainFactory.php @@ -23,7 +23,7 @@ class DomainFactory extends Factory { return [ 'user_id' => $this->faker->uuid, - 'domain' => $this->faker->domainName.$this->faker->randomNumber(3) + 'domain' => $this->faker->domainName.$this->faker->randomNumber(3), ]; } } diff --git a/database/factories/FailedDeliveryFactory.php b/database/factories/FailedDeliveryFactory.php index 2ba5ddf..f99eee0 100644 --- a/database/factories/FailedDeliveryFactory.php +++ b/database/factories/FailedDeliveryFactory.php @@ -23,7 +23,7 @@ class FailedDeliveryFactory extends Factory { return [ 'status' => '5.1.1', - 'code' => $this->faker->sentence(5) + 'code' => $this->faker->sentence(5), ]; } } diff --git a/database/factories/RecipientFactory.php b/database/factories/RecipientFactory.php index 73438d2..b94588e 100644 --- a/database/factories/RecipientFactory.php +++ b/database/factories/RecipientFactory.php @@ -24,7 +24,7 @@ class RecipientFactory extends Factory return [ 'user_id' => $this->faker->uuid, 'email' => $this->faker->safeEmail, - 'email_verified_at' => now() + 'email_verified_at' => now(), ]; } } diff --git a/database/factories/RuleFactory.php b/database/factories/RuleFactory.php index 9c8f612..3ad253a 100644 --- a/database/factories/RuleFactory.php +++ b/database/factories/RuleFactory.php @@ -29,16 +29,16 @@ class RuleFactory extends Factory 'type' => 'sender', 'match' => 'is exactly', 'values' => [ - 'will@anonaddy.com' - ] - ] + 'will@anonaddy.com', + ], + ], ], 'actions' => [ [ 'type' => 'subject', - 'value' => 'New Subject!' - ] - ] + 'value' => 'New Subject!', + ], + ], ]; } } diff --git a/database/factories/UsernameFactory.php b/database/factories/UsernameFactory.php index 9bfceb6..59b8c76 100644 --- a/database/factories/UsernameFactory.php +++ b/database/factories/UsernameFactory.php @@ -23,7 +23,7 @@ class UsernameFactory extends Factory { return [ 'user_id' => $this->faker->uuid, - 'username' => $this->faker->userName.$this->faker->randomNumber(3) + 'username' => $this->faker->userName.$this->faker->randomNumber(3), ]; } } diff --git a/database/migrations/2022_02_25_091005_move_account_username_to_usernames_table.php b/database/migrations/2022_02_25_091005_move_account_username_to_usernames_table.php index 347f52a..0f9e80a 100644 --- a/database/migrations/2022_02_25_091005_move_account_username_to_usernames_table.php +++ b/database/migrations/2022_02_25_091005_move_account_username_to_usernames_table.php @@ -33,7 +33,7 @@ class MoveAccountUsernameToUsernamesTable extends Migration foreach ($users as $user) { $username = $user->usernames()->create([ 'username' => $user->getAttributes()['username'], - 'catch_all' => $user->catch_all + 'catch_all' => $user->catch_all, ]); $user->update(['default_username_id' => $username->id]); @@ -51,7 +51,7 @@ class MoveAccountUsernameToUsernamesTable extends Migration ->whereIn('domain', $usernameSubdomains) ->update([ 'aliasable_id' => $username->id, - 'aliasable_type' => 'App\Models\Username' + 'aliasable_type' => 'App\Models\Username', ]); } }); diff --git a/database/migrations/2022_06_29_103709_update_email_type_in_failed_deliveries_table.php b/database/migrations/2022_06_29_103709_update_email_type_in_failed_deliveries_table.php index 06baa6f..65a55f5 100644 --- a/database/migrations/2022_06_29_103709_update_email_type_in_failed_deliveries_table.php +++ b/database/migrations/2022_06_29_103709_update_email_type_in_failed_deliveries_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. * diff --git a/database/migrations/2022_07_29_111323_add_expires_at_to_personal_access_tokens_table.php b/database/migrations/2022_07_29_111323_add_expires_at_to_personal_access_tokens_table.php index 1e2cbce..a82820c 100644 --- a/database/migrations/2022_07_29_111323_add_expires_at_to_personal_access_tokens_table.php +++ b/database/migrations/2022_07_29_111323_add_expires_at_to_personal_access_tokens_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. * diff --git a/database/migrations/2022_08_05_085825_add_protected_headers_and_inline_encryption_to_recipients_table.php b/database/migrations/2022_08_05_085825_add_protected_headers_and_inline_encryption_to_recipients_table.php index f670854..8952c8f 100644 --- a/database/migrations/2022_08_05_085825_add_protected_headers_and_inline_encryption_to_recipients_table.php +++ b/database/migrations/2022_08_05_085825_add_protected_headers_and_inline_encryption_to_recipients_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. * diff --git a/package-lock.json b/package-lock.json index 4174975..b74e3c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,28 +57,28 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.1.tgz", - "integrity": "sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.5.tgz", + "integrity": "sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.2.tgz", - "integrity": "sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.5.tgz", + "integrity": "sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==", "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.2", + "@babel/generator": "^7.20.5", "@babel/helper-compilation-targets": "^7.20.0", "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.1", - "@babel/parser": "^7.20.2", + "@babel/helpers": "^7.20.5", + "@babel/parser": "^7.20.5", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2", + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -102,11 +102,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.20.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.4.tgz", - "integrity": "sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz", + "integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==", "dependencies": { - "@babel/types": "^7.20.2", + "@babel/types": "^7.20.5", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -176,9 +176,9 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.2.tgz", - "integrity": "sha512-k22GoYRAHPYr9I+Gvy2ZQlAe5mGy8BqWst2wRt8cwIufWTxrsVshhIBvYNqC80N0GSFWTsqRVexOtfzlgOEDvA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.5.tgz", + "integrity": "sha512-3RCdA/EmEaikrhayahwToF0fpweU/8o2p8vhc1c/1kftHOdTKuC65kik/TLc+qfbS8JKw4qqJbne4ovICDhmww==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-environment-visitor": "^7.18.9", @@ -196,12 +196,12 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz", - "integrity": "sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz", + "integrity": "sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.1.0" + "regexpu-core": "^5.2.1" }, "engines": { "node": ">=6.9.0" @@ -425,27 +425,27 @@ } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz", - "integrity": "sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz", + "integrity": "sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==", "dependencies": { "@babel/helper-function-name": "^7.19.0", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.1.tgz", - "integrity": "sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.6.tgz", + "integrity": "sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==", "dependencies": { "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.0" + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" }, "engines": { "node": ">=6.9.0" @@ -521,9 +521,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.3.tgz", - "integrity": "sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", + "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -764,13 +764,13 @@ } }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz", - "integrity": "sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz", + "integrity": "sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { @@ -1017,9 +1017,9 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.2.tgz", - "integrity": "sha512-y5V15+04ry69OV2wULmwhEA6jwSWXO1TwAtIwiPXcvHcoOQUqpyMVd2bDsQJMW8AurjulIyUV8kDqtjSwHy1uQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.5.tgz", + "integrity": "sha512-WvpEIW9Cbj9ApF3yJCjIEEf1EiNJLtXagOrL5LNWEZOo3jv8pmPoYTSNJQvqej8OavVlgOoOPw6/htGZro6IkA==", "dependencies": { "@babel/helper-plugin-utils": "^7.20.2" }, @@ -1246,12 +1246,12 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.1.tgz", - "integrity": "sha512-oWk9l9WItWBQYS4FgXD4Uyy5kq898lvkXpXQxoJEY1RnvPk4R/Dvu2ebXU9q8lP+rlMwUQTFf2Ok6d78ODa0kw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz", + "integrity": "sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-create-regexp-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2" }, "engines": { "node": ">=6.9.0" @@ -1290,9 +1290,9 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.3.tgz", - "integrity": "sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.5.tgz", + "integrity": "sha512-h7plkOmcndIUWXZFLgpbrh2+fXAi47zcUX7IrOQuZdLD0I0KvjJ6cvo3BEcAOsDOcZhVKGJqv07mkSqK0y2isQ==", "dependencies": { "@babel/helper-plugin-utils": "^7.20.2" }, @@ -1318,12 +1318,12 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz", - "integrity": "sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz", + "integrity": "sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "regenerator-transform": "^0.15.0" + "@babel/helper-plugin-utils": "^7.20.2", + "regenerator-transform": "^0.15.1" }, "engines": { "node": ">=6.9.0" @@ -1585,11 +1585,11 @@ } }, "node_modules/@babel/runtime": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.1.tgz", - "integrity": "sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.6.tgz", + "integrity": "sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==", "dependencies": { - "regenerator-runtime": "^0.13.10" + "regenerator-runtime": "^0.13.11" }, "engines": { "node": ">=6.9.0" @@ -1609,18 +1609,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.1.tgz", - "integrity": "sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.5.tgz", + "integrity": "sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==", "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.1", + "@babel/generator": "^7.20.5", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.1", - "@babel/types": "^7.20.0", + "@babel/parser": "^7.20.5", + "@babel/types": "^7.20.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1629,9 +1629,9 @@ } }, "node_modules/@babel/types": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.2.tgz", - "integrity": "sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", + "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", "dependencies": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", @@ -1734,9 +1734,9 @@ } }, "node_modules/@kyvg/vue3-notification": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@kyvg/vue3-notification/-/vue3-notification-2.6.1.tgz", - "integrity": "sha512-f3QHfuU1wsw14l9pbToNvC8AL5d5e0Wiy88SbK9f4g1h4ajQpooNmf+4RKttxpSvWknycMVUVHlNGavRQ+kGag==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@kyvg/vue3-notification/-/vue3-notification-2.7.0.tgz", + "integrity": "sha512-Eti6jRGips9fpf2WdRjlOOJGyjCZ35qt84CeTeFr5piAwXaMpvgzea4dqqTK5KCfqK3qz/zwwxAd/8AToLYL8A==", "peerDependencies": { "vue": "^3.0.0" } @@ -1825,9 +1825,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.2.tgz", - "integrity": "sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==", + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", + "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", "dependencies": { "@babel/types": "^7.3.0" } @@ -2158,9 +2158,9 @@ "integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==" }, "node_modules/@vueform/multiselect": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@vueform/multiselect/-/multiselect-2.5.6.tgz", - "integrity": "sha512-pmGwd/6d4dzdi1mp0uqizmpdkakSXZuYIG+aIEs/9UcaDB+6NlnhvFwrlQ8enSIo0kiCERC48WyfVZ7CscHSYQ==" + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/@vueform/multiselect/-/multiselect-2.5.7.tgz", + "integrity": "sha512-a3aPVzaRw455YFD7PHxQfoTstgHYUpsWfOBOh4wyBxPeJPsQGFyctbqrrRpTqt45s6PXgxhcY+dO6+R8Uxgeaw==" }, "node_modules/@webassemblyjs/ast": { "version": "1.11.1", @@ -2510,9 +2510,9 @@ } }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -2624,9 +2624,9 @@ } }, "node_modules/axios": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.1.3.tgz", - "integrity": "sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.0.tgz", + "integrity": "sha512-zT7wZyNYu3N5Bu0wuZ6QccIf93Qk1eV8LOewxgjOZFd2DenOs98cJ7+Y6703d0wkaXGY6/nZd4EweJaHz9uzQw==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -4162,9 +4162,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz", - "integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", + "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -5117,9 +5117,9 @@ ] }, "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", + "integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==", "engines": { "node": ">= 4" } @@ -5630,24 +5630,24 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, "node_modules/lint-staged": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.0.3.tgz", - "integrity": "sha512-9hmrwSCFroTSYLjflGI8Uk+GWAwMB4OlpU4bMJEAT5d/llQwtYKoim4bLOyLCuWFAhWEupE0vkIFqtw/WIsPug==", + "version": "13.0.4", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.0.4.tgz", + "integrity": "sha512-HxlHCXoYRsq9QCby5wFozmZW00hMs/9e3l+/dz6Qr8Kle4UH0kJTdABAbqhzG+3pcG6QjL9kz7NgGBfph+a5dw==", "dev": true, "dependencies": { "cli-truncate": "^3.1.0", - "colorette": "^2.0.17", - "commander": "^9.3.0", + "colorette": "^2.0.19", + "commander": "^9.4.1", "debug": "^4.3.4", "execa": "^6.1.0", - "lilconfig": "2.0.5", - "listr2": "^4.0.5", + "lilconfig": "2.0.6", + "listr2": "^5.0.5", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "object-inspect": "^1.12.2", "pidtree": "^0.6.0", "string-argv": "^0.3.1", - "yaml": "^2.1.1" + "yaml": "^2.1.3" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -5668,15 +5668,6 @@ "node": "^12.20.0 || >=14" } }, - "node_modules/lint-staged/node_modules/lilconfig": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz", - "integrity": "sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/lint-staged/node_modules/yaml": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz", @@ -5687,22 +5678,22 @@ } }, "node_modules/listr2": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-4.0.5.tgz", - "integrity": "sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-5.0.6.tgz", + "integrity": "sha512-u60KxKBy1BR2uLJNTWNptzWQ1ob/gjMzIJPZffAENzpZqbMZ/5PrXXOomDcevIS/+IB7s1mmCEtSlT2qHWMqag==", "dev": true, "dependencies": { "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", + "colorette": "^2.0.19", "log-update": "^4.0.0", "p-map": "^4.0.0", "rfdc": "^1.3.0", - "rxjs": "^7.5.5", + "rxjs": "^7.5.7", "through": "^2.3.8", "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=12" + "node": "^14.13.1 || >=16.0.0" }, "peerDependencies": { "enquirer": ">= 2.3.0 < 3" @@ -7212,9 +7203,9 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -8419,9 +8410,9 @@ } }, "node_modules/terser": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", - "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.0.tgz", + "integrity": "sha512-KjTV81QKStSfwbNiwlBXfcgMcOloyuRdb62/iLFPGBcVNF4EXjhdYBhYHmbJpiBrVxZhDvltE11j+LBQUxEEJg==", "dependencies": { "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", @@ -9396,25 +9387,25 @@ } }, "@babel/compat-data": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.1.tgz", - "integrity": "sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==" + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.5.tgz", + "integrity": "sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==" }, "@babel/core": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.2.tgz", - "integrity": "sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.5.tgz", + "integrity": "sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==", "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.2", + "@babel/generator": "^7.20.5", "@babel/helper-compilation-targets": "^7.20.0", "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.1", - "@babel/parser": "^7.20.2", + "@babel/helpers": "^7.20.5", + "@babel/parser": "^7.20.5", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2", + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -9430,11 +9421,11 @@ } }, "@babel/generator": { - "version": "7.20.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.4.tgz", - "integrity": "sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz", + "integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==", "requires": { - "@babel/types": "^7.20.2", + "@babel/types": "^7.20.5", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -9487,9 +9478,9 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.2.tgz", - "integrity": "sha512-k22GoYRAHPYr9I+Gvy2ZQlAe5mGy8BqWst2wRt8cwIufWTxrsVshhIBvYNqC80N0GSFWTsqRVexOtfzlgOEDvA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.5.tgz", + "integrity": "sha512-3RCdA/EmEaikrhayahwToF0fpweU/8o2p8vhc1c/1kftHOdTKuC65kik/TLc+qfbS8JKw4qqJbne4ovICDhmww==", "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-environment-visitor": "^7.18.9", @@ -9501,12 +9492,12 @@ } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz", - "integrity": "sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz", + "integrity": "sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==", "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.1.0" + "regexpu-core": "^5.2.1" } }, "@babel/helper-define-polyfill-provider": { @@ -9666,24 +9657,24 @@ "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==" }, "@babel/helper-wrap-function": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz", - "integrity": "sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz", + "integrity": "sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==", "requires": { "@babel/helper-function-name": "^7.19.0", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" } }, "@babel/helpers": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.1.tgz", - "integrity": "sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.6.tgz", + "integrity": "sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==", "requires": { "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.0" + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" } }, "@babel/highlight": { @@ -9743,9 +9734,9 @@ } }, "@babel/parser": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.3.tgz", - "integrity": "sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==" + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", + "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==" }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { "version": "7.18.6", @@ -9890,13 +9881,13 @@ } }, "@babel/plugin-proposal-private-property-in-object": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz", - "integrity": "sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz", + "integrity": "sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==", "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" } }, @@ -10056,9 +10047,9 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.2.tgz", - "integrity": "sha512-y5V15+04ry69OV2wULmwhEA6jwSWXO1TwAtIwiPXcvHcoOQUqpyMVd2bDsQJMW8AurjulIyUV8kDqtjSwHy1uQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.5.tgz", + "integrity": "sha512-WvpEIW9Cbj9ApF3yJCjIEEf1EiNJLtXagOrL5LNWEZOo3jv8pmPoYTSNJQvqej8OavVlgOoOPw6/htGZro6IkA==", "requires": { "@babel/helper-plugin-utils": "^7.20.2" } @@ -10195,12 +10186,12 @@ } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.1.tgz", - "integrity": "sha512-oWk9l9WItWBQYS4FgXD4Uyy5kq898lvkXpXQxoJEY1RnvPk4R/Dvu2ebXU9q8lP+rlMwUQTFf2Ok6d78ODa0kw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz", + "integrity": "sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==", "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-create-regexp-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2" } }, "@babel/plugin-transform-new-target": { @@ -10221,9 +10212,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.3.tgz", - "integrity": "sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.5.tgz", + "integrity": "sha512-h7plkOmcndIUWXZFLgpbrh2+fXAi47zcUX7IrOQuZdLD0I0KvjJ6cvo3BEcAOsDOcZhVKGJqv07mkSqK0y2isQ==", "requires": { "@babel/helper-plugin-utils": "^7.20.2" } @@ -10237,12 +10228,12 @@ } }, "@babel/plugin-transform-regenerator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz", - "integrity": "sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz", + "integrity": "sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==", "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "regenerator-transform": "^0.15.0" + "@babel/helper-plugin-utils": "^7.20.2", + "regenerator-transform": "^0.15.1" } }, "@babel/plugin-transform-reserved-words": { @@ -10433,11 +10424,11 @@ } }, "@babel/runtime": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.1.tgz", - "integrity": "sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.6.tgz", + "integrity": "sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==", "requires": { - "regenerator-runtime": "^0.13.10" + "regenerator-runtime": "^0.13.11" } }, "@babel/template": { @@ -10451,26 +10442,26 @@ } }, "@babel/traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.1.tgz", - "integrity": "sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.5.tgz", + "integrity": "sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==", "requires": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.1", + "@babel/generator": "^7.20.5", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.1", - "@babel/types": "^7.20.0", + "@babel/parser": "^7.20.5", + "@babel/types": "^7.20.5", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.2.tgz", - "integrity": "sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", + "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", "requires": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", @@ -10549,9 +10540,9 @@ } }, "@kyvg/vue3-notification": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@kyvg/vue3-notification/-/vue3-notification-2.6.1.tgz", - "integrity": "sha512-f3QHfuU1wsw14l9pbToNvC8AL5d5e0Wiy88SbK9f4g1h4ajQpooNmf+4RKttxpSvWknycMVUVHlNGavRQ+kGag==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@kyvg/vue3-notification/-/vue3-notification-2.7.0.tgz", + "integrity": "sha512-Eti6jRGips9fpf2WdRjlOOJGyjCZ35qt84CeTeFr5piAwXaMpvgzea4dqqTK5KCfqK3qz/zwwxAd/8AToLYL8A==", "requires": {} }, "@leichtgewicht/ip-codec": { @@ -10622,9 +10613,9 @@ } }, "@types/babel__traverse": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.2.tgz", - "integrity": "sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==", + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", + "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", "requires": { "@babel/types": "^7.3.0" } @@ -10952,9 +10943,9 @@ "integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==" }, "@vueform/multiselect": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@vueform/multiselect/-/multiselect-2.5.6.tgz", - "integrity": "sha512-pmGwd/6d4dzdi1mp0uqizmpdkakSXZuYIG+aIEs/9UcaDB+6NlnhvFwrlQ8enSIo0kiCERC48WyfVZ7CscHSYQ==" + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/@vueform/multiselect/-/multiselect-2.5.7.tgz", + "integrity": "sha512-a3aPVzaRw455YFD7PHxQfoTstgHYUpsWfOBOh4wyBxPeJPsQGFyctbqrrRpTqt45s6PXgxhcY+dO6+R8Uxgeaw==" }, "@webassemblyjs/ast": { "version": "1.11.1", @@ -11236,9 +11227,9 @@ } }, "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -11326,9 +11317,9 @@ } }, "axios": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.1.3.tgz", - "integrity": "sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.0.tgz", + "integrity": "sha512-zT7wZyNYu3N5Bu0wuZ6QccIf93Qk1eV8LOewxgjOZFd2DenOs98cJ7+Y6703d0wkaXGY6/nZd4EweJaHz9uzQw==", "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -12493,9 +12484,9 @@ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, "enhanced-resolve": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz", - "integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", + "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", "requires": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -13195,9 +13186,9 @@ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", + "integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==" }, "imagemin": { "version": "7.0.1", @@ -13552,24 +13543,24 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, "lint-staged": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.0.3.tgz", - "integrity": "sha512-9hmrwSCFroTSYLjflGI8Uk+GWAwMB4OlpU4bMJEAT5d/llQwtYKoim4bLOyLCuWFAhWEupE0vkIFqtw/WIsPug==", + "version": "13.0.4", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.0.4.tgz", + "integrity": "sha512-HxlHCXoYRsq9QCby5wFozmZW00hMs/9e3l+/dz6Qr8Kle4UH0kJTdABAbqhzG+3pcG6QjL9kz7NgGBfph+a5dw==", "dev": true, "requires": { "cli-truncate": "^3.1.0", - "colorette": "^2.0.17", - "commander": "^9.3.0", + "colorette": "^2.0.19", + "commander": "^9.4.1", "debug": "^4.3.4", "execa": "^6.1.0", - "lilconfig": "2.0.5", - "listr2": "^4.0.5", + "lilconfig": "2.0.6", + "listr2": "^5.0.5", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "object-inspect": "^1.12.2", "pidtree": "^0.6.0", "string-argv": "^0.3.1", - "yaml": "^2.1.1" + "yaml": "^2.1.3" }, "dependencies": { "commander": { @@ -13578,12 +13569,6 @@ "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==", "dev": true }, - "lilconfig": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz", - "integrity": "sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==", - "dev": true - }, "yaml": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz", @@ -13593,17 +13578,17 @@ } }, "listr2": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-4.0.5.tgz", - "integrity": "sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-5.0.6.tgz", + "integrity": "sha512-u60KxKBy1BR2uLJNTWNptzWQ1ob/gjMzIJPZffAENzpZqbMZ/5PrXXOomDcevIS/+IB7s1mmCEtSlT2qHWMqag==", "dev": true, "requires": { "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", + "colorette": "^2.0.19", "log-update": "^4.0.0", "p-map": "^4.0.0", "rfdc": "^1.3.0", - "rxjs": "^7.5.5", + "rxjs": "^7.5.7", "through": "^2.3.8", "wrap-ansi": "^7.0.0" }, @@ -14619,9 +14604,9 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", "dev": true }, "pretty-time": { @@ -15534,9 +15519,9 @@ "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==" }, "terser": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", - "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.0.tgz", + "integrity": "sha512-KjTV81QKStSfwbNiwlBXfcgMcOloyuRdb62/iLFPGBcVNF4EXjhdYBhYHmbJpiBrVxZhDvltE11j+LBQUxEEJg==", "requires": { "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", diff --git a/routes/api.php b/routes/api.php index 10f5556..b9e54c2 100644 --- a/routes/api.php +++ b/routes/api.php @@ -39,8 +39,8 @@ use Illuminate\Support\Facades\Route; */ Route::group([ - 'middleware' => ['auth:sanctum', 'verified'], - 'prefix' => 'v1' + 'middleware' => ['auth:sanctum', 'verified'], + 'prefix' => 'v1', ], function () { Route::controller(AliasController::class)->group(function () { Route::get('/aliases', 'index'); diff --git a/routes/web.php b/routes/web.php index 5cc5c94..ba1b396 100644 --- a/routes/web.php +++ b/routes/web.php @@ -96,10 +96,9 @@ Route::middleware(['auth', 'verified', '2fa', 'webauthn'])->group(function () { Route::get('/failed-deliveries', [ShowFailedDeliveryController::class, 'index'])->name('failed_deliveries.index'); }); - Route::group([ 'middleware' => ['auth', '2fa', 'webauthn'], - 'prefix' => 'settings' + 'prefix' => 'settings', ], function () { Route::controller(SettingController::class)->group(function () { Route::get('/', 'show')->name('settings.show'); diff --git a/server.php b/server.php index 5fb6379..b07fa44 100644 --- a/server.php +++ b/server.php @@ -3,10 +3,8 @@ /** * Laravel - A PHP Framework For Web Artisans * - * @package Laravel * @author Taylor Otwell */ - $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ); diff --git a/tests/Feature/Api/AliasRecipientsTest.php b/tests/Feature/Api/AliasRecipientsTest.php index f990cea..043a6aa 100644 --- a/tests/Feature/Api/AliasRecipientsTest.php +++ b/tests/Feature/Api/AliasRecipientsTest.php @@ -22,16 +22,16 @@ class AliasRecipientsTest extends TestCase public function user_can_attach_recipient_to_alias() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('POST', '/api/v1/alias-recipients', [ 'alias_id' => $alias->id, - 'recipient_ids' => [$recipient->id] + 'recipient_ids' => [$recipient->id], ]); $response->assertStatus(200); @@ -43,24 +43,24 @@ class AliasRecipientsTest extends TestCase public function user_can_attach_multiple_recipients_to_alias() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient1 = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient2 = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient3 = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('POST', '/api/v1/alias-recipients', [ 'alias_id' => $alias->id, - 'recipient_ids' => [$recipient1->id, $recipient2->id, $recipient3->id] + 'recipient_ids' => [$recipient1->id, $recipient2->id, $recipient3->id], ]); $response->assertStatus(200); @@ -71,29 +71,29 @@ class AliasRecipientsTest extends TestCase public function user_can_update_existing_recipients_for_alias() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient1 = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipient1 + 'recipient' => $recipient1, ]); $recipient2 = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient3 = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('POST', '/api/v1/alias-recipients', [ 'alias_id' => $alias->id, - 'recipient_ids' => [$recipient2->id, $recipient3->id] + 'recipient_ids' => [$recipient2->id, $recipient3->id], ]); $response->assertStatus(200); @@ -104,17 +104,17 @@ class AliasRecipientsTest extends TestCase public function user_cannot_attach_unverified_recipient_to_alias() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $unverifiedRecipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); $response = $this->json('POST', '/api/v1/alias-recipients', [ 'alias_id' => $alias->id, - 'recipient_ids' => [$unverifiedRecipient->id] + 'recipient_ids' => [$unverifiedRecipient->id], ]); $response->assertStatus(422); @@ -125,16 +125,16 @@ class AliasRecipientsTest extends TestCase public function user_cannot_attach_more_than_allowed_recipients_to_alias() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipients = Recipient::factory()->count(11)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('POST', '/api/v1/alias-recipients', [ 'alias_id' => $alias->id, - 'recipient_ids' => $recipients->pluck('id') + 'recipient_ids' => $recipients->pluck('id'), ]); $response->assertStatus(422); @@ -145,16 +145,16 @@ class AliasRecipientsTest extends TestCase public function alias_recipient_record_is_deleted_if_recipient_is_deleted() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipient + 'recipient' => $recipient, ]); $this->assertEquals($alias->recipients[0]->email, $recipient->email); @@ -163,7 +163,7 @@ class AliasRecipientsTest extends TestCase $this->assertCount(0, AliasRecipient::all()); $this->assertDatabaseMissing('alias_recipients', [ 'alias_id' => $alias->id, - 'recipient_id' => $recipient->id + 'recipient_id' => $recipient->id, ]); } } diff --git a/tests/Feature/Api/AliasesTest.php b/tests/Feature/Api/AliasesTest.php index fe119dc..62ae003 100644 --- a/tests/Feature/Api/AliasesTest.php +++ b/tests/Feature/Api/AliasesTest.php @@ -29,7 +29,7 @@ class AliasesTest extends TestCase { // Arrange Alias::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -45,12 +45,12 @@ class AliasesTest extends TestCase { // Arrange Alias::factory()->count(2)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); Alias::factory()->create([ 'user_id' => $this->user->id, - 'deleted_at' => now() + 'deleted_at' => now(), ]); // Act @@ -67,11 +67,11 @@ class AliasesTest extends TestCase // Arrange Alias::factory()->count(2)->create([ 'user_id' => $this->user->id, - 'deleted_at' => now() + 'deleted_at' => now(), ]); Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -88,12 +88,12 @@ class AliasesTest extends TestCase // Arrange Alias::factory()->create([ 'user_id' => $this->user->id, - 'active' => true + 'active' => true, ]); Alias::factory()->count(2)->create([ 'user_id' => $this->user->id, - 'active' => false + 'active' => false, ]); // Act @@ -109,7 +109,7 @@ class AliasesTest extends TestCase { // Arrange $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -127,7 +127,7 @@ class AliasesTest extends TestCase $response = $this->json('POST', '/api/v1/aliases', [ 'domain' => 'anonaddy.me', 'description' => 'the description', - 'local_part' => 'not-required-for-shared-alias' + 'local_part' => 'not-required-for-shared-alias', ]); $response->assertStatus(201); @@ -139,11 +139,11 @@ class AliasesTest extends TestCase public function user_can_generate_alias_with_recipients() { $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient2 = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('POST', '/api/v1/aliases', [ @@ -151,8 +151,8 @@ class AliasesTest extends TestCase 'description' => 'the description', 'recipient_ids' => [ $recipient->id, - $recipient2->id - ] + $recipient2->id, + ], ]); $response->assertStatus(201); @@ -167,7 +167,7 @@ class AliasesTest extends TestCase 'domain' => 'anonaddy.me', 'format' => 'uuid', 'description' => 'the description', - 'local_part' => 'not-required-for-shared-alias' + 'local_part' => 'not-required-for-shared-alias', ]); $response->assertStatus(201); @@ -180,43 +180,43 @@ class AliasesTest extends TestCase public function user_can_generate_new_alias_with_local_part() { $response = $this->json('POST', '/api/v1/aliases', [ - 'domain' => $this->user->username . '.anonaddy.com', + 'domain' => $this->user->username.'.anonaddy.com', 'format' => 'custom', 'description' => 'the description', - 'local_part' => 'valid-local-part' + 'local_part' => 'valid-local-part', ]); $response->assertStatus(201); $this->assertCount(1, $this->user->aliases); $this->assertEquals('valid-local-part', $response->getData()->data->local_part); - $this->assertEquals('valid-local-part@'.$this->user->username . '.anonaddy.com', $this->user->aliases[0]->email); + $this->assertEquals('valid-local-part@'.$this->user->username.'.anonaddy.com', $this->user->aliases[0]->email); } /** @test */ public function user_can_generate_new_alias_with_local_part_and_extension() { $response = $this->json('POST', '/api/v1/aliases', [ - 'domain' => $this->user->username . '.anonaddy.com', + 'domain' => $this->user->username.'.anonaddy.com', 'format' => 'custom', 'description' => 'the description', - 'local_part' => 'valid-local-part+extension' + 'local_part' => 'valid-local-part+extension', ]); $response->assertStatus(201); $this->assertCount(1, $this->user->aliases); $this->assertEquals('valid-local-part', $response->getData()->data->local_part); $this->assertEquals('extension', $response->getData()->data->extension); - $this->assertEquals('valid-local-part@'.$this->user->username . '.anonaddy.com', $this->user->aliases[0]->email); + $this->assertEquals('valid-local-part@'.$this->user->username.'.anonaddy.com', $this->user->aliases[0]->email); } /** @test */ public function user_cannot_generate_new_alias_with_invalid_local_part() { $response = $this->json('POST', '/api/v1/aliases', [ - 'domain' => $this->user->username . '.anonaddy.com', + 'domain' => $this->user->username.'.anonaddy.com', 'format' => 'custom', 'description' => 'the description', - 'local_part' => 'invalid-local-part.' + 'local_part' => 'invalid-local-part.', ]); $response->assertStatus(422); @@ -230,7 +230,7 @@ class AliasesTest extends TestCase $response = $this->json('POST', '/api/v1/aliases', [ 'domain' => 'anonaddy.me', 'description' => 'the description', - 'format' => 'random_words' + 'format' => 'random_words', ]); $response->assertStatus(201); @@ -244,18 +244,18 @@ class AliasesTest extends TestCase { Username::factory()->create([ 'user_id' => $this->user->id, - 'username' => 'john' + 'username' => 'john', ]); $domain = Domain::factory()->create([ 'user_id' => $this->user->id, 'domain' => 'john.xyz', - 'domain_verified_at' => now() + 'domain_verified_at' => now(), ]); $response = $this->json('POST', '/api/v1/aliases', [ 'domain' => 'john.xyz', - 'description' => 'the description' + 'description' => 'the description', ]); $response->assertStatus(201); @@ -268,11 +268,11 @@ class AliasesTest extends TestCase public function user_can_update_alias_description() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('PATCH', '/api/v1/aliases/'.$alias->id, [ - 'description' => 'The new description' + 'description' => 'The new description', ]); $response->assertStatus(200); @@ -284,7 +284,7 @@ class AliasesTest extends TestCase { $alias = Alias::factory()->create([ 'user_id' => $this->user->id, - 'active' => true + 'active' => true, ]); $response = $this->json('DELETE', '/api/v1/aliases/'.$alias->id); @@ -298,7 +298,7 @@ class AliasesTest extends TestCase public function user_can_forget_alias() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('DELETE', '/api/v1/aliases/'.$alias->id.'/forget'); @@ -307,7 +307,7 @@ class AliasesTest extends TestCase $this->assertEmpty($this->user->aliases()->withTrashed()->get()); $this->assertDatabaseMissing('aliases', [ - 'id' => $alias->id + 'id' => $alias->id, ]); } @@ -324,7 +324,7 @@ class AliasesTest extends TestCase 'emails_forwarded' => 10, 'emails_blocked' => 1, 'emails_replied' => 2, - 'emails_sent' => 3 + 'emails_sent' => 3, ]); $response = $this->json('DELETE', '/api/v1/aliases/'.$sharedDomainAlias->id.'/forget'); @@ -341,7 +341,7 @@ class AliasesTest extends TestCase 'emails_blocked' => 0, 'emails_replied' => 0, 'emails_sent' => 0, - 'deleted_at' => now() + 'deleted_at' => now(), ]); } @@ -350,7 +350,7 @@ class AliasesTest extends TestCase { $alias = Alias::factory()->create([ 'user_id' => $this->user->id, - 'deleted_at' => now() + 'deleted_at' => now(), ]); $response = $this->json('PATCH', '/api/v1/aliases/'.$alias->id.'/restore'); @@ -364,11 +364,11 @@ class AliasesTest extends TestCase { $alias = Alias::factory()->create([ 'user_id' => $this->user->id, - 'active' => false + 'active' => false, ]); $response = $this->json('POST', '/api/v1/active-aliases/', [ - 'id' => $alias->id + 'id' => $alias->id, ]); $response->assertStatus(200); @@ -380,7 +380,7 @@ class AliasesTest extends TestCase { $alias = Alias::factory()->create([ 'user_id' => $this->user->id, - 'active' => true + 'active' => true, ]); $response = $this->json('DELETE', '/api/v1/active-aliases/'.$alias->id); diff --git a/tests/Feature/Api/ApiTokenDetailsTest.php b/tests/Feature/Api/ApiTokenDetailsTest.php index 7be53d1..d3abd67 100644 --- a/tests/Feature/Api/ApiTokenDetailsTest.php +++ b/tests/Feature/Api/ApiTokenDetailsTest.php @@ -22,7 +22,7 @@ class ApiTokenDetailsTest extends TestCase $token = $user->createToken('New'); $response = $this->withHeaders([ - 'Authorization' => 'Bearer ' . $token->plainTextToken, + 'Authorization' => 'Bearer '.$token->plainTextToken, ])->json('GET', '/api/v1/api-token-details'); $response->assertSuccessful(); diff --git a/tests/Feature/Api/ApiTokensTest.php b/tests/Feature/Api/ApiTokensTest.php index 85dda27..8e319a1 100644 --- a/tests/Feature/Api/ApiTokensTest.php +++ b/tests/Feature/Api/ApiTokensTest.php @@ -26,7 +26,7 @@ class ApiTokensTest extends TestCase public function user_can_create_api_token() { $response = $this->post('/settings/personal-access-tokens', [ - 'name' => 'New' + 'name' => 'New', ]); $response->assertStatus(200); @@ -34,7 +34,7 @@ class ApiTokensTest extends TestCase $this->assertNotNull($response->getData()->accessToken); $this->assertDatabaseHas('personal_access_tokens', [ 'name' => 'New', - 'tokenable_id' => $this->user->id + 'tokenable_id' => $this->user->id, ]); } @@ -51,7 +51,7 @@ class ApiTokensTest extends TestCase $this->assertDatabaseMissing('personal_access_tokens', [ 'name' => 'New', 'tokenable_id' => $this->user->id, - 'id' => $token->accessToken->id + 'id' => $token->accessToken->id, ]); } } diff --git a/tests/Feature/Api/DomainsTest.php b/tests/Feature/Api/DomainsTest.php index 811c173..7b5a77e 100644 --- a/tests/Feature/Api/DomainsTest.php +++ b/tests/Feature/Api/DomainsTest.php @@ -22,7 +22,7 @@ class DomainsTest extends TestCase { // Arrange Domain::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -38,7 +38,7 @@ class DomainsTest extends TestCase { // Arrange $domain = Domain::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -54,7 +54,7 @@ class DomainsTest extends TestCase public function user_can_create_new_domain() { $response = $this->json('POST', '/api/v1/domains', [ - 'domain' => 'random.com' + 'domain' => 'random.com', ]); $response->assertStatus(201); @@ -66,11 +66,11 @@ class DomainsTest extends TestCase { Domain::factory()->create([ 'user_id' => $this->user->id, - 'domain' => 'random.com' + 'domain' => 'random.com', ]); $response = $this->json('POST', '/api/v1/domains', [ - 'domain' => 'random.com' + 'domain' => 'random.com', ]); $response @@ -82,7 +82,7 @@ class DomainsTest extends TestCase public function new_domain_must_be_a_valid_fqdn() { $response = $this->json('POST', '/api/v1/domains', [ - 'domain' => 'random.' + 'domain' => 'random.', ]); $response @@ -94,7 +94,7 @@ class DomainsTest extends TestCase public function new_domain_must_not_include_protocol() { $response = $this->json('POST', '/api/v1/domains', [ - 'domain' => 'https://random.com' + 'domain' => 'https://random.com', ]); $response @@ -106,7 +106,7 @@ class DomainsTest extends TestCase public function new_domain_must_not_be_local() { $response = $this->json('POST', '/api/v1/domains', [ - 'domain' => config('anonaddy.domain') + 'domain' => config('anonaddy.domain'), ]); $response @@ -118,7 +118,7 @@ class DomainsTest extends TestCase public function new_domain_must_not_be_local_subdomain() { $response = $this->json('POST', '/api/v1/domains', [ - 'domain' => 'subdomain'.config('anonaddy.domain') + 'domain' => 'subdomain'.config('anonaddy.domain'), ]); $response @@ -131,11 +131,11 @@ class DomainsTest extends TestCase { $domain = Domain::factory()->create([ 'user_id' => $this->user->id, - 'active' => false + 'active' => false, ]); $response = $this->json('POST', '/api/v1/active-domains/', [ - 'id' => $domain->id + 'id' => $domain->id, ]); $response->assertStatus(200); @@ -147,7 +147,7 @@ class DomainsTest extends TestCase { $domain = Domain::factory()->create([ 'user_id' => $this->user->id, - 'active' => true + 'active' => true, ]); $response = $this->json('DELETE', '/api/v1/active-domains/'.$domain->id); @@ -161,11 +161,11 @@ class DomainsTest extends TestCase { $domain = Domain::factory()->create([ 'user_id' => $this->user->id, - 'catch_all' => false + 'catch_all' => false, ]); $response = $this->json('POST', '/api/v1/catch-all-domains/', [ - 'id' => $domain->id + 'id' => $domain->id, ]); $response->assertStatus(200); @@ -177,7 +177,7 @@ class DomainsTest extends TestCase { $domain = Domain::factory()->create([ 'user_id' => $this->user->id, - 'catch_all' => true + 'catch_all' => true, ]); $response = $this->json('DELETE', '/api/v1/catch-all-domains/'.$domain->id); @@ -190,11 +190,11 @@ class DomainsTest extends TestCase public function user_can_update_domain_description() { $domain = Domain::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('PATCH', '/api/v1/domains/'.$domain->id, [ - 'description' => 'The new description' + 'description' => 'The new description', ]); $response->assertStatus(200); @@ -205,7 +205,7 @@ class DomainsTest extends TestCase public function user_can_delete_domain() { $domain = Domain::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('DELETE', '/api/v1/domains/'.$domain->id); @@ -219,21 +219,21 @@ class DomainsTest extends TestCase { $domain = Domain::factory()->create([ 'user_id' => $this->user->id, - 'domain_verified_at' => now() + 'domain_verified_at' => now(), ]); $newDefaultRecipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('PATCH', '/api/v1/domains/'.$domain->id.'/default-recipient', [ - 'default_recipient' => $newDefaultRecipient->id + 'default_recipient' => $newDefaultRecipient->id, ]); $response->assertStatus(200); $this->assertDatabaseHas('domains', [ 'id' => $domain->id, - 'default_recipient_id' => $newDefaultRecipient->id + 'default_recipient_id' => $newDefaultRecipient->id, ]); $this->assertEquals($newDefaultRecipient->email, $domain->refresh()->defaultRecipient->email); @@ -244,22 +244,22 @@ class DomainsTest extends TestCase { $domain = Domain::factory()->create([ 'user_id' => $this->user->id, - 'domain_verified_at' => now() + 'domain_verified_at' => now(), ]); $newDefaultRecipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); $response = $this->json('PATCH', '/api/v1/domains/'.$domain->id.'/default-recipient', [ - 'default_recipient' => $newDefaultRecipient->id + 'default_recipient' => $newDefaultRecipient->id, ]); $response->assertStatus(404); $this->assertDatabaseMissing('domains', [ 'id' => $domain->id, - 'default_recipient_id' => $newDefaultRecipient->id + 'default_recipient_id' => $newDefaultRecipient->id, ]); } @@ -267,7 +267,7 @@ class DomainsTest extends TestCase public function user_can_remove_domain_default_recipient() { $defaultRecipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $domain = Domain::factory()->create([ @@ -277,13 +277,13 @@ class DomainsTest extends TestCase ]); $response = $this->json('PATCH', '/api/v1/domains/'.$domain->id.'/default-recipient', [ - 'default_recipient' => '' + 'default_recipient' => '', ]); $response->assertStatus(200); $this->assertDatabaseHas('domains', [ 'id' => $domain->id, - 'default_recipient_id' => null + 'default_recipient_id' => null, ]); $this->assertNull($domain->refresh()->defaultRecipient); diff --git a/tests/Feature/Api/FailedDeliveriesTest.php b/tests/Feature/Api/FailedDeliveriesTest.php index d6064c8..fec5f60 100644 --- a/tests/Feature/Api/FailedDeliveriesTest.php +++ b/tests/Feature/Api/FailedDeliveriesTest.php @@ -23,7 +23,7 @@ class FailedDeliveriesTest extends TestCase { // Arrange FailedDelivery::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -39,7 +39,7 @@ class FailedDeliveriesTest extends TestCase { // Arrange $failedDelivery = FailedDelivery::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -55,7 +55,7 @@ class FailedDeliveriesTest extends TestCase public function user_can_delete_failed_delivery() { $failedDelivery = FailedDelivery::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('DELETE', '/api/v1/failed-deliveries/'.$failedDelivery->id); diff --git a/tests/Feature/Api/RecipientsTest.php b/tests/Feature/Api/RecipientsTest.php index 3e38e7a..918e603 100644 --- a/tests/Feature/Api/RecipientsTest.php +++ b/tests/Feature/Api/RecipientsTest.php @@ -22,7 +22,7 @@ class RecipientsTest extends TestCase { // Arrange Recipient::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -38,7 +38,7 @@ class RecipientsTest extends TestCase { // Arrange $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -54,7 +54,7 @@ class RecipientsTest extends TestCase public function user_can_create_new_recipient() { $response = $this->json('POST', '/api/v1/recipients', [ - 'email' => 'johndoe@example.com' + 'email' => 'johndoe@example.com', ]); $response->assertStatus(201); @@ -66,11 +66,11 @@ class RecipientsTest extends TestCase { Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'johndoe@example.com' + 'email' => 'johndoe@example.com', ]); $response = $this->json('POST', '/api/v1/recipients', [ - 'email' => 'johndoe@example.com' + 'email' => 'johndoe@example.com', ]); $response @@ -83,11 +83,11 @@ class RecipientsTest extends TestCase { Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'johndoe@example.com' + 'email' => 'johndoe@example.com', ]); $response = $this->json('POST', '/api/v1/recipients', [ - 'email' => 'JOHNdoe@example.com' + 'email' => 'JOHNdoe@example.com', ]); $response @@ -101,7 +101,7 @@ class RecipientsTest extends TestCase $this->user->recipients()->save($this->user->defaultRecipient); $response = $this->json('POST', '/api/v1/recipients', [ - 'email' => $this->user->email + 'email' => $this->user->email, ]); $response @@ -113,7 +113,7 @@ class RecipientsTest extends TestCase public function user_can_not_create_recipient_with_local_domain() { $response = $this->json('POST', '/api/v1/recipients', [ - 'email' => 'johndoe@anonaddy.com' + 'email' => 'johndoe@anonaddy.com', ]); $response @@ -127,11 +127,11 @@ class RecipientsTest extends TestCase Domain::factory()->create([ 'user_id' => $this->user->id, 'domain' => 'example.com', - 'domain_verified_at' => now() + 'domain_verified_at' => now(), ]); $response = $this->json('POST', '/api/v1/recipients', [ - 'email' => 'johndoe@example.com' + 'email' => 'johndoe@example.com', ]); $response @@ -143,7 +143,7 @@ class RecipientsTest extends TestCase public function new_recipient_must_have_valid_email() { $response = $this->json('POST', '/api/v1/recipients', [ - 'email' => 'johndoe@example.' + 'email' => 'johndoe@example.', ]); $response @@ -155,7 +155,7 @@ class RecipientsTest extends TestCase public function user_can_delete_recipient() { $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('DELETE', '/api/v1/recipients/'.$recipient->id); @@ -185,11 +185,11 @@ class RecipientsTest extends TestCase $gnupg->deletekey('26A987650243B28802524E2F809FD0D502E2F695'); $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('PATCH', '/api/v1/recipient-keys/'.$recipient->id, [ - 'key_data' => file_get_contents(base_path('tests/keys/AnonAddyPublicKey.asc')) + 'key_data' => file_get_contents(base_path('tests/keys/AnonAddyPublicKey.asc')), ]); $response->assertStatus(200); @@ -200,11 +200,11 @@ class RecipientsTest extends TestCase public function gpg_key_must_be_correct_format() { $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('PATCH', '/api/v1/recipient-keys/'.$recipient->id, [ - 'key_data' => 'Invalid Key Data' + 'key_data' => 'Invalid Key Data', ]); $response @@ -216,11 +216,11 @@ class RecipientsTest extends TestCase public function gpg_key_must_be_valid() { $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('PATCH', '/api/v1/recipient-keys/'.$recipient->id, [ - 'key_data' => file_get_contents(base_path('tests/keys/InvalidAnonAddyPublicKey.asc')) + 'key_data' => file_get_contents(base_path('tests/keys/InvalidAnonAddyPublicKey.asc')), ]); $response @@ -236,7 +236,7 @@ class RecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, 'should_encrypt' => true, - 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695' + 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695', ]); $response = $this->json('DELETE', '/api/v1/recipient-keys/'.$recipient->id); @@ -252,11 +252,11 @@ class RecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, 'should_encrypt' => false, - 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695' + 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695', ]); $response = $this->json('POST', '/api/v1/encrypted-recipients/', [ - 'id' => $recipient->id + 'id' => $recipient->id, ]); $response->assertStatus(200); @@ -269,7 +269,7 @@ class RecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, 'should_encrypt' => true, - 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695' + 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695', ]); $response = $this->json('DELETE', '/api/v1/encrypted-recipients/'.$recipient->id); @@ -283,11 +283,11 @@ class RecipientsTest extends TestCase { $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'can_reply_send' => false + 'can_reply_send' => false, ]); $response = $this->json('POST', '/api/v1/allowed-recipients/', [ - 'id' => $recipient->id + 'id' => $recipient->id, ]); $response->assertStatus(200); @@ -299,7 +299,7 @@ class RecipientsTest extends TestCase { $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'can_reply_send' => true + 'can_reply_send' => true, ]); $response = $this->json('DELETE', '/api/v1/allowed-recipients/'.$recipient->id); @@ -314,11 +314,11 @@ class RecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, 'inline_encryption' => false, - 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695' + 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695', ]); $response = $this->json('POST', '/api/v1/inline-encrypted-recipients/', [ - 'id' => $recipient->id + 'id' => $recipient->id, ]); $response->assertStatus(200); @@ -331,7 +331,7 @@ class RecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, 'inline_encryption' => true, - 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695' + 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695', ]); $response = $this->json('DELETE', '/api/v1/inline-encrypted-recipients/'.$recipient->id); @@ -346,11 +346,11 @@ class RecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, 'protected_headers' => false, - 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695' + 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695', ]); $response = $this->json('POST', '/api/v1/protected-headers-recipients/', [ - 'id' => $recipient->id + 'id' => $recipient->id, ]); $response->assertStatus(200); @@ -363,7 +363,7 @@ class RecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, 'protected_headers' => true, - 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695' + 'fingerprint' => '26A987650243B28802524E2F809FD0D502E2F695', ]); $response = $this->json('DELETE', '/api/v1/protected-headers-recipients/'.$recipient->id); diff --git a/tests/Feature/Api/RulesTest.php b/tests/Feature/Api/RulesTest.php index 047e115..f9eb281 100644 --- a/tests/Feature/Api/RulesTest.php +++ b/tests/Feature/Api/RulesTest.php @@ -31,7 +31,7 @@ class RulesTest extends TestCase { // Arrange Rule::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // At @@ -47,7 +47,7 @@ class RulesTest extends TestCase { // Arrange $rule = Rule::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -69,34 +69,34 @@ class RulesTest extends TestCase 'type' => 'sender', 'match' => 'is exactly', 'values' => [ - 'Test Email' - ] + 'Test Email', + ], ], [ 'type' => 'sender', 'match' => 'starts with', 'values' => [ - 'will' - ] + 'will', + ], ], [ 'type' => 'alias', 'match' => 'is exactly', 'values' => [ - 'ebay@johndoe.anonaddy.com' - ] - ] + 'ebay@johndoe.anonaddy.com', + ], + ], ], 'actions' => [ [ 'type' => 'subject', - 'value' => 'New Subject!' + 'value' => 'New Subject!', ], ], 'operator' => 'AND', 'forwards' => true, 'replies' => false, - 'sends' => false + 'sends' => false, ]); $response->assertStatus(201); @@ -113,20 +113,20 @@ class RulesTest extends TestCase 'type' => 'invalid', 'match' => 'is exactly', 'values' => [ - 'Test Email' - ] - ] + 'Test Email', + ], + ], ], 'actions' => [ [ 'type' => 'subject', - 'value' => 'New Subject!' + 'value' => 'New Subject!', ], ], 'operator' => 'AND', 'forwards' => true, 'replies' => false, - 'sends' => false + 'sends' => false, ]); $response->assertStatus(422); @@ -137,7 +137,7 @@ class RulesTest extends TestCase { $rule = Rule::factory()->create([ 'user_id' => $this->user->id, - 'operator' => 'AND' + 'operator' => 'AND', ]); $response = $this->json('PATCH', '/api/v1/rules/'.$rule->id, [ @@ -147,20 +147,20 @@ class RulesTest extends TestCase 'type' => 'subject', 'match' => 'is exactly', 'values' => [ - 'Test Email' - ] - ] + 'Test Email', + ], + ], ], 'actions' => [ [ 'type' => 'subject', - 'value' => 'New Subject!' + 'value' => 'New Subject!', ], ], 'operator' => 'OR', 'forwards' => true, 'replies' => false, - 'sends' => false + 'sends' => false, ]); $response->assertStatus(200); @@ -172,7 +172,7 @@ class RulesTest extends TestCase public function user_can_delete_rule() { $rule = Rule::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('DELETE', '/api/v1/rules/'.$rule->id); @@ -186,11 +186,11 @@ class RulesTest extends TestCase { $rule = Rule::factory()->create([ 'user_id' => $this->user->id, - 'active' => false + 'active' => false, ]); $response = $this->json('POST', '/api/v1/active-rules/', [ - 'id' => $rule->id + 'id' => $rule->id, ]); $response->assertStatus(200); @@ -202,7 +202,7 @@ class RulesTest extends TestCase { $rule = Rule::factory()->create([ 'user_id' => $this->user->id, - 'active' => true + 'active' => true, ]); $response = $this->json('DELETE', '/api/v1/active-rules/'.$rule->id); @@ -221,34 +221,34 @@ class RulesTest extends TestCase 'type' => 'subject', 'match' => 'is exactly', 'values' => [ - 'Test Email' - ] + 'Test Email', + ], ], [ 'type' => 'sender', 'match' => 'starts with', 'values' => [ - 'will' - ] + 'will', + ], ], [ 'type' => 'alias', 'match' => 'is exactly', 'values' => [ - 'ebay@johndoe.anonaddy.com' - ] - ] + 'ebay@johndoe.anonaddy.com', + ], + ], ], 'actions' => [ [ 'type' => 'subject', - 'value' => 'New Subject!' + 'value' => 'New Subject!', ], ], 'operator' => 'AND', 'forwards' => true, 'replies' => false, - 'sends' => false + 'sends' => false, ]); $alias = Alias::factory()->create([ @@ -283,34 +283,34 @@ class RulesTest extends TestCase 'type' => 'subject', 'match' => 'is exactly', 'values' => [ - 'Test Email' - ] + 'Test Email', + ], ], [ 'type' => 'sender', 'match' => 'starts with', 'values' => [ - 'will' - ] + 'will', + ], ], [ 'type' => 'alias', 'match' => 'is exactly', 'values' => [ - 'ebay@johndoe.anonaddy.com' - ] - ] + 'ebay@johndoe.anonaddy.com', + ], + ], ], 'actions' => [ [ 'type' => 'subject', - 'value' => 'New Subject!' + 'value' => 'New Subject!', ], ], 'operator' => 'AND', 'forwards' => false, 'replies' => true, - 'sends' => true + 'sends' => true, ]); $alias = Alias::factory()->create([ @@ -345,21 +345,21 @@ class RulesTest extends TestCase 'type' => 'alias', 'match' => 'is not', 'values' => [ - 'woot@johndoe.anonaddy.com' - ] - ] + 'woot@johndoe.anonaddy.com', + ], + ], ], 'actions' => [ [ 'type' => 'subject', - 'value' => 'Applied after' + 'value' => 'Applied after', ], ], 'operator' => 'AND', 'forwards' => true, 'replies' => false, 'sends' => false, - 'order' => 1 + 'order' => 1, ]); Rule::factory()->create([ @@ -369,34 +369,34 @@ class RulesTest extends TestCase 'type' => 'subject', 'match' => 'is', 'values' => [ - 'Test Email' - ] + 'Test Email', + ], ], [ 'type' => 'sender', 'match' => 'ends with', 'values' => [ - 'anonaddy.com' - ] + 'anonaddy.com', + ], ], [ 'type' => 'alias', 'match' => 'is', 'values' => [ - 'ebay@johndoe.anonaddy.com' - ] - ] + 'ebay@johndoe.anonaddy.com', + ], + ], ], 'actions' => [ [ 'type' => 'subject', - 'value' => 'New Subject!' + 'value' => 'New Subject!', ], ], 'operator' => 'AND', 'forwards' => true, 'replies' => false, - 'sends' => false + 'sends' => false, ]); $alias = Alias::factory()->create([ @@ -426,25 +426,25 @@ class RulesTest extends TestCase { $ruleOne = Rule::factory()->create([ 'user_id' => $this->user->id, - 'order' => 2 + 'order' => 2, ]); $ruleTwo = Rule::factory()->create([ 'user_id' => $this->user->id, - 'order' => 0 + 'order' => 0, ]); $ruleThree = Rule::factory()->create([ 'user_id' => $this->user->id, - 'order' => 1 + 'order' => 1, ]); $response = $this->json('POST', '/api/v1/reorder-rules/', [ 'ids' => [ $ruleOne->id, $ruleTwo->id, - $ruleThree->id - ] + $ruleThree->id, + ], ]); $this->assertEquals(0, $ruleOne->refresh()->order); @@ -472,14 +472,14 @@ class RulesTest extends TestCase $part['headers']['from'] = $from->filter(function ($f) { return filter_var($f['address'], FILTER_VALIDATE_EMAIL); })->map(function ($f) { - return $f['display'] . ' <' . $f['address'] . '>'; + return $f['display'].' <'.$f['address'].'>'; })->first(); $mimePart->setPart($part); } } catch (\Exception $e) { - $part['headers']['from'] = str_replace("\\\"", "", $part['headers']['from']); - $part['headers']['from'] = str_replace("\\", "", $part['headers']['from']); + $part['headers']['from'] = str_replace('\\"', '', $part['headers']['from']); + $part['headers']['from'] = str_replace('\\', '', $part['headers']['from']); $mimePart->setPart($part); } @@ -504,7 +504,7 @@ class RulesTest extends TestCase if ($file == 'stream') { $fd = fopen('php://stdin', 'r'); $this->rawEmail = ''; - while (!feof($fd)) { + while (! feof($fd)) { $this->rawEmail .= fread($fd, 1024); } fclose($fd); @@ -512,6 +512,7 @@ class RulesTest extends TestCase } else { $parser->setPath($file); } + return $parser; } } diff --git a/tests/Feature/Api/UsernamesTest.php b/tests/Feature/Api/UsernamesTest.php index 132c5b6..ae25005 100644 --- a/tests/Feature/Api/UsernamesTest.php +++ b/tests/Feature/Api/UsernamesTest.php @@ -29,7 +29,7 @@ class UsernamesTest extends TestCase { // Arrange Username::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -45,7 +45,7 @@ class UsernamesTest extends TestCase { // Arrange $username = Username::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -61,7 +61,7 @@ class UsernamesTest extends TestCase public function user_can_create_username() { $response = $this->json('POST', '/api/v1/usernames', [ - 'username' => 'janedoe' + 'username' => 'janedoe', ]); $response->assertStatus(201); @@ -73,19 +73,19 @@ class UsernamesTest extends TestCase public function user_can_not_exceed_username_limit() { $this->json('POST', '/api/v1/usernames', [ - 'username' => 'username1' + 'username' => 'username1', ]); $this->json('POST', '/api/v1/usernames', [ - 'username' => 'username2' + 'username' => 'username2', ]); $this->json('POST', '/api/v1/usernames', [ - 'username' => 'username3' + 'username' => 'username3', ]); $response = $this->json('POST', '/api/v1/usernames', [ - 'username' => 'janedoe' + 'username' => 'janedoe', ]); $response->assertStatus(403); @@ -98,11 +98,11 @@ class UsernamesTest extends TestCase { Username::factory()->create([ 'user_id' => $this->user->id, - 'username' => 'janedoe' + 'username' => 'janedoe', ]); $response = $this->json('POST', '/api/v1/usernames', [ - 'username' => 'janedoe' + 'username' => 'janedoe', ]); $response @@ -114,11 +114,11 @@ class UsernamesTest extends TestCase public function user_can_not_create_username_that_has_been_deleted() { DeletedUsername::factory()->create([ - 'username' => 'janedoe' + 'username' => 'janedoe', ]); $response = $this->json('POST', '/api/v1/usernames', [ - 'username' => 'janedoe' + 'username' => 'janedoe', ]); $response @@ -132,7 +132,7 @@ class UsernamesTest extends TestCase $user = User::factory()->create(); $response = $this->json('POST', '/api/v1/usernames', [ - 'username' => $user->username + 'username' => $user->username, ]); $response @@ -144,7 +144,7 @@ class UsernamesTest extends TestCase public function username_must_be_alpha_numeric() { $response = $this->json('POST', '/api/v1/usernames', [ - 'username' => 'username01_' + 'username' => 'username01_', ]); $response @@ -156,7 +156,7 @@ class UsernamesTest extends TestCase public function username_must_be_less_than_max_length() { $response = $this->json('POST', '/api/v1/usernames', [ - 'username' => 'abcdefghijklmnopqrstu' + 'username' => 'abcdefghijklmnopqrstu', ]); $response @@ -169,11 +169,11 @@ class UsernamesTest extends TestCase { $username = Username::factory()->create([ 'user_id' => $this->user->id, - 'active' => false + 'active' => false, ]); $response = $this->json('POST', '/api/v1/active-usernames/', [ - 'id' => $username->id + 'id' => $username->id, ]); $response->assertStatus(200); @@ -185,7 +185,7 @@ class UsernamesTest extends TestCase { $username = Username::factory()->create([ 'user_id' => $this->user->id, - 'active' => true + 'active' => true, ]); $response = $this->json('DELETE', '/api/v1/active-usernames/'.$username->id); @@ -199,11 +199,11 @@ class UsernamesTest extends TestCase { $username = Username::factory()->create([ 'user_id' => $this->user->id, - 'catch_all' => false + 'catch_all' => false, ]); $response = $this->json('POST', '/api/v1/catch-all-usernames/', [ - 'id' => $username->id + 'id' => $username->id, ]); $response->assertStatus(200); @@ -215,7 +215,7 @@ class UsernamesTest extends TestCase { $username = Username::factory()->create([ 'user_id' => $this->user->id, - 'catch_all' => true + 'catch_all' => true, ]); $response = $this->json('DELETE', '/api/v1/catch-all-usernames/'.$username->id); @@ -228,11 +228,11 @@ class UsernamesTest extends TestCase public function user_can_update_usernames_description() { $username = Username::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('PATCH', '/api/v1/usernames/'.$username->id, [ - 'description' => 'The new description' + 'description' => 'The new description', ]); $response->assertStatus(200); @@ -243,7 +243,7 @@ class UsernamesTest extends TestCase public function user_can_delete_username() { $username = Username::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('DELETE', '/api/v1/usernames/'.$username->id); @@ -272,21 +272,21 @@ class UsernamesTest extends TestCase public function user_can_update_username_default_recipient() { $username = Username::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $newDefaultRecipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->json('PATCH', '/api/v1/usernames/'.$username->id.'/default-recipient', [ - 'default_recipient' => $newDefaultRecipient->id + 'default_recipient' => $newDefaultRecipient->id, ]); $response->assertStatus(200); $this->assertDatabaseHas('usernames', [ 'id' => $username->id, - 'default_recipient_id' => $newDefaultRecipient->id + 'default_recipient_id' => $newDefaultRecipient->id, ]); $this->assertEquals($newDefaultRecipient->email, $username->refresh()->defaultRecipient->email); @@ -296,22 +296,22 @@ class UsernamesTest extends TestCase public function user_cannot_update_username_default_recipient_with_unverified_recipient() { $username = Username::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $newDefaultRecipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); $response = $this->json('PATCH', '/api/v1/usernames/'.$username->id.'/default-recipient', [ - 'default_recipient' => $newDefaultRecipient->id + 'default_recipient' => $newDefaultRecipient->id, ]); $response->assertStatus(404); $this->assertDatabaseMissing('usernames', [ 'id' => $username->id, - 'default_recipient_id' => $newDefaultRecipient->id + 'default_recipient_id' => $newDefaultRecipient->id, ]); } @@ -319,22 +319,22 @@ class UsernamesTest extends TestCase public function user_can_remove_username_default_recipient() { $defaultRecipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $username = Username::factory()->create([ 'user_id' => $this->user->id, - 'default_recipient_id' => $defaultRecipient->id + 'default_recipient_id' => $defaultRecipient->id, ]); $response = $this->json('PATCH', '/api/v1/usernames/'.$username->id.'/default-recipient', [ - 'default_recipient' => '' + 'default_recipient' => '', ]); $response->assertStatus(200); $this->assertDatabaseHas('usernames', [ 'id' => $username->id, - 'default_recipient_id' => null + 'default_recipient_id' => null, ]); $this->assertNull($username->refresh()->defaultRecipient); diff --git a/tests/Feature/ApiAuthenticationTest.php b/tests/Feature/ApiAuthenticationTest.php index 1816578..0a699de 100644 --- a/tests/Feature/ApiAuthenticationTest.php +++ b/tests/Feature/ApiAuthenticationTest.php @@ -19,7 +19,7 @@ class ApiAuthenticationTest extends TestCase parent::setUp(); $this->user = User::factory()->create([ - 'password' => Hash::make('mypassword') + 'password' => Hash::make('mypassword'), ]); $this->user->usernames()->save($this->user->defaultUsername); @@ -35,7 +35,7 @@ class ApiAuthenticationTest extends TestCase $response = $this->json('POST', '/api/auth/login', [ 'username' => 'johndoe', 'password' => 'mypassword', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response->assertSuccessful(); @@ -50,7 +50,7 @@ class ApiAuthenticationTest extends TestCase $response = $this->json('POST', '/api/auth/login', [ 'username' => 'johndoe', 'password' => 'myincorrectpassword', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response->assertUnauthorized(); @@ -64,7 +64,7 @@ class ApiAuthenticationTest extends TestCase $response = $this->json('POST', '/api/auth/login', [ 'username' => 'doesnotexist', 'password' => 'mypassword', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response->assertUnauthorized(); @@ -77,25 +77,25 @@ class ApiAuthenticationTest extends TestCase $this->json('POST', '/api/auth/login', [ 'username' => 'johndoe', 'password' => 'incorrect1', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $this->json('POST', '/api/auth/login', [ 'username' => 'johndoe', 'password' => 'incorrect2', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $this->json('POST', '/api/auth/login', [ 'username' => 'johndoe', 'password' => 'incorrect3', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response = $this->json('POST', '/api/auth/login', [ 'username' => 'johndoe', 'password' => 'incorrect4', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response->assertStatus(429); @@ -116,13 +116,13 @@ class ApiAuthenticationTest extends TestCase 'trustPath' => '{"type":"Webauthn\\TrustPath\\EmptyTrustPath"}', 'aaguid' => '00000000-0000-0000-0000-000000000000', 'credentialPublicKey' => 'xyz', - 'counter' => 0 + 'counter' => 0, ]); $response = $this->json('POST', '/api/auth/login', [ 'username' => 'johndoe', 'password' => 'mypassword', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response->assertForbidden(); @@ -137,13 +137,13 @@ class ApiAuthenticationTest extends TestCase $secret = app('pragmarx.google2fa')->generateSecretKey(); $this->user->update([ 'two_factor_secret' => $secret, - 'two_factor_enabled' => true + 'two_factor_enabled' => true, ]); $response = $this->json('POST', '/api/auth/login', [ 'username' => 'johndoe', 'password' => 'mypassword', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response->assertStatus(422); @@ -158,7 +158,7 @@ class ApiAuthenticationTest extends TestCase ])->json('POST', '/api/auth/mfa', [ 'mfa_key' => $mfaKey, 'otp' => '000000', - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response2->assertUnauthorized(); @@ -169,7 +169,7 @@ class ApiAuthenticationTest extends TestCase ])->json('POST', '/api/auth/mfa', [ 'mfa_key' => $mfaKey, 'otp' => app('pragmarx.google2fa')->getCurrentOtp($secret), - 'device_name' => 'Firefox' + 'device_name' => 'Firefox', ]); $response3->assertSuccessful(); diff --git a/tests/Feature/LoginTest.php b/tests/Feature/LoginTest.php index 6d92a88..5e53124 100644 --- a/tests/Feature/LoginTest.php +++ b/tests/Feature/LoginTest.php @@ -22,7 +22,7 @@ class LoginTest extends TestCase parent::setUp(); $this->user = User::factory()->create([ - 'password' => Hash::make('mypassword') + 'password' => Hash::make('mypassword'), ]); $this->user->recipients()->save($this->user->defaultRecipient); @@ -36,7 +36,7 @@ class LoginTest extends TestCase { $response = $this->post('/login', [ 'username' => 'johndoe', - 'password' => 'mypassword' + 'password' => 'mypassword', ]); $response @@ -48,12 +48,12 @@ class LoginTest extends TestCase public function user_can_login_with_any_username() { $username = Username::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->post('/login', [ 'username' => $username->username, - 'password' => 'mypassword' + 'password' => 'mypassword', ]); $response @@ -67,12 +67,12 @@ class LoginTest extends TestCase $this->user->update([ 'two_factor_enabled' => true, 'two_factor_secret' => 'secret', - 'two_factor_backup_code' => bcrypt($code = Str::random(40)) + 'two_factor_backup_code' => bcrypt($code = Str::random(40)), ]); $response = $this->post('/login', [ 'username' => 'johndoe', - 'password' => 'mypassword' + 'password' => 'mypassword', ]); $response @@ -88,7 +88,7 @@ class LoginTest extends TestCase $backupCodeView->assertSee('Login Using 2FA Backup Code'); $backupCodeLogin = $this->post('/login/backup-code', [ - 'backup_code' => $code + 'backup_code' => $code, ]); $backupCodeLogin @@ -106,7 +106,7 @@ class LoginTest extends TestCase $recipient = $this->user->recipients[0]; $this->post('/username/email', [ - 'email' => $recipient->email + 'email' => $recipient->email, ]); Notification::assertSentTo( @@ -123,7 +123,7 @@ class LoginTest extends TestCase Notification::fake(); $this->post('/username/email', [ - 'email' => 'doesnotexist@example.com' + 'email' => 'doesnotexist@example.com', ]); Notification::assertNothingSent(); diff --git a/tests/Feature/ReceiveEmailTest.php b/tests/Feature/ReceiveEmailTest.php index d744813..05a5c66 100644 --- a/tests/Feature/ReceiveEmailTest.php +++ b/tests/Feature/ReceiveEmailTest.php @@ -51,7 +51,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -59,7 +59,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -86,7 +86,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['EBAY'], '--extension' => [''], '--domain' => ['JOHNDOE.ANONADDY.COM'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -94,7 +94,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -119,7 +119,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['attachment'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -127,7 +127,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'attachment@johndoe.'.config('anonaddy.domain'), 'local_part' => 'attachment', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -152,7 +152,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay', 'amazon', 'paypal'], '--extension' => ['', '', ''], '--domain' => ['johndoe.anonaddy.com', 'johndoe.anonaddy.com', 'johndoe.anonaddy.com'], - '--size' => '1217' + '--size' => '1217', ] )->assertExitCode(0); @@ -160,19 +160,19 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertDatabaseHas('aliases', [ 'email' => 'amazon@johndoe.'.config('anonaddy.domain'), 'local_part' => 'amazon', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertDatabaseHas('aliases', [ 'email' => 'paypal@johndoe.'.config('anonaddy.domain'), 'local_part' => 'paypal', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(3, $this->user->aliases()->count()); @@ -197,7 +197,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => ['2.3'], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '789' + '--size' => '789', ] )->assertExitCode(0); @@ -205,7 +205,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -240,13 +240,13 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '559' + '--size' => '559', ] )->assertExitCode(0); $this->assertDatabaseHas('aliases', [ 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertCount(1, $this->user->aliases); @@ -266,7 +266,7 @@ class ReceiveEmailTest extends TestCase $uuid = '86064c92-da41-443e-a2bf-5a7b0247842f'; config([ - 'anonaddy.admin_username' => 'random' + 'anonaddy.admin_username' => 'random', ]); Alias::factory()->create([ @@ -288,7 +288,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => [$uuid], '--extension' => [''], '--domain' => ['anonaddy.me'], - '--size' => '892' + '--size' => '892', ] )->assertExitCode(0); @@ -296,7 +296,7 @@ class ReceiveEmailTest extends TestCase 'local_part' => $uuid, 'domain' => 'anonaddy.me', 'email' => $uuid.'@anonaddy.me', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertCount(1, $this->user->aliases); @@ -316,7 +316,7 @@ class ReceiveEmailTest extends TestCase $localPart = 'circus.waltz449'; config([ - 'anonaddy.admin_username' => 'random' + 'anonaddy.admin_username' => 'random', ]); Alias::factory()->create([ @@ -337,7 +337,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => [$localPart], '--extension' => [''], '--domain' => ['anonaddy.me'], - '--size' => '892' + '--size' => '892', ] )->assertExitCode(0); @@ -345,7 +345,7 @@ class ReceiveEmailTest extends TestCase 'local_part' => $localPart, 'domain' => 'anonaddy.me', 'email' => $localPart.'@anonaddy.me', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertCount(1, $this->user->aliases); @@ -371,22 +371,22 @@ class ReceiveEmailTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'one@example.com' + 'email' => 'one@example.com', ]); $recipient2 = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'two@example.com' + 'email' => 'two@example.com', ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipient + 'recipient' => $recipient, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipient2 + 'recipient' => $recipient2, ]); $this->artisan( @@ -398,13 +398,13 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '444' + '--size' => '444', ] )->assertExitCode(0); $this->assertDatabaseHas('aliases', [ 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); Mail::assertQueued(ForwardEmail::class, function ($mail) { @@ -425,12 +425,12 @@ class ReceiveEmailTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'one@example.com' + 'email' => 'one@example.com', ]); $recipient2 = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'two@example.com' + 'email' => 'two@example.com', ]); $this->artisan( @@ -442,14 +442,14 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => ['2.3'], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '444' + '--size' => '444', ] )->assertExitCode(0); $this->assertDatabaseHas('aliases', [ 'extension' => '2.3', 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); Mail::assertQueued(ForwardEmail::class, function ($mail) use ($recipient) { @@ -471,12 +471,12 @@ class ReceiveEmailTest extends TestCase Recipient::factory()->create([ 'user_id' => $this->user->id, 'email' => 'one@example.com', - 'email_verified_at' => null + 'email_verified_at' => null, ]); $verifiedRecipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'two@example.com' + 'email' => 'two@example.com', ]); $this->artisan( @@ -488,13 +488,13 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => ['2.3'], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '444' + '--size' => '444', ] )->assertExitCode(0); $this->assertDatabaseHas('aliases', [ 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $alias = $this->user->aliases()->where('email', 'ebay@johndoe.'.config('anonaddy.domain'))->first(); @@ -526,13 +526,13 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); $this->assertDatabaseMissing('aliases', [ 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); Mail::assertNotQueued(ForwardEmail::class); @@ -550,19 +550,19 @@ class ReceiveEmailTest extends TestCase 'user_id' => $this->user->id, 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', - 'domain' => 'johndoe.'.config('anonaddy.domain') + 'domain' => 'johndoe.'.config('anonaddy.domain'), ]); Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'will@anonaddy.com' + 'email' => 'will@anonaddy.com', ]); $this->assertDatabaseHas('aliases', [ 'id' => '8f36380f-df4e-4875-bb12-9c4448573712', 'user_id' => $this->user->id, 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), - 'active' => true + 'active' => true, ]); $this->artisan( @@ -574,7 +574,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['8f36380f-df4e-4875-bb12-9c4448573712'], '--extension' => [''], '--domain' => ['unsubscribe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -584,7 +584,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'active' => false + 'active' => false, ]); Mail::assertNotQueued(ForwardEmail::class); @@ -602,14 +602,14 @@ class ReceiveEmailTest extends TestCase 'user_id' => $this->user->id, 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', - 'domain' => 'johndoe.'.config('anonaddy.domain') + 'domain' => 'johndoe.'.config('anonaddy.domain'), ]); $this->assertDatabaseHas('aliases', [ 'id' => '8f36380f-df4e-4875-bb12-9c4448573712', 'user_id' => $this->user->id, 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), - 'active' => true + 'active' => true, ]); $this->artisan( @@ -621,7 +621,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['8f36380f-df4e-4875-bb12-9c4448573712'], '--extension' => [''], '--domain' => ['unsubscribe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -631,7 +631,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'active' => true + 'active' => true, ]); Mail::assertNotQueued(ForwardEmail::class); @@ -655,7 +655,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['anonaddy.me'], - '--size' => '1346' + '--size' => '1346', ] )->assertExitCode(0); @@ -663,7 +663,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@anonaddy.me', 'local_part' => 'ebay', 'domain' => 'anonaddy.me', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -683,7 +683,7 @@ class ReceiveEmailTest extends TestCase $domain = Domain::factory()->create([ 'user_id' => $this->user->id, 'domain' => 'example.com', - 'domain_verified_at' => now() + 'domain_verified_at' => now(), ]); $this->artisan( @@ -695,7 +695,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['example.com'], - '--size' => '871' + '--size' => '871', ] )->assertExitCode(0); @@ -705,7 +705,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@example.com', 'local_part' => 'ebay', 'domain' => 'example.com', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -726,7 +726,7 @@ class ReceiveEmailTest extends TestCase 'user_id' => $this->user->id, 'domain' => 'example.com', 'domain_verified_at' => now(), - 'domain_sending_verified_at' => now() + 'domain_sending_verified_at' => now(), ]); $this->artisan( @@ -738,7 +738,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['example.com'], - '--size' => '871' + '--size' => '871', ] )->assertExitCode(0); @@ -748,7 +748,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@example.com', 'local_part' => 'ebay', 'domain' => 'example.com', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -767,7 +767,7 @@ class ReceiveEmailTest extends TestCase $username = Username::factory()->create([ 'user_id' => $this->user->id, - 'username' => 'janedoe' + 'username' => 'janedoe', ]); $this->artisan( @@ -779,7 +779,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['janedoe.anonaddy.com'], - '--size' => '638' + '--size' => '638', ] )->assertExitCode(0); @@ -789,7 +789,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@janedoe.anonaddy.com', 'local_part' => 'ebay', 'domain' => 'janedoe.anonaddy.com', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -817,7 +817,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -825,7 +825,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@johndoe.'.config('anonaddy.domain'), 'local_part' => 'ebay', 'domain' => 'johndoe.'.config('anonaddy.domain'), - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -855,7 +855,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -864,12 +864,12 @@ class ReceiveEmailTest extends TestCase 'local_part' => 'ebay', 'domain' => 'johndoe.'.config('anonaddy.domain'), 'emails_forwarded' => 1, - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'bandwidth' => '9486760' + 'bandwidth' => '9486760', ]); Notification::assertNotSentTo( @@ -894,7 +894,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.me'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -902,7 +902,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@johndoe.anonaddy.me', 'local_part' => 'ebay', 'domain' => 'johndoe.anonaddy.me', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -919,14 +919,14 @@ class ReceiveEmailTest extends TestCase Mail::assertNothingSent(); $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $domain = Domain::factory()->create([ 'user_id' => $this->user->id, 'default_recipient_id' => $recipient->id, 'domain' => 'example.com', - 'domain_verified_at' => now() + 'domain_verified_at' => now(), ]); $this->artisan( @@ -938,7 +938,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['example.com'], - '--size' => '871' + '--size' => '871', ] )->assertExitCode(0); @@ -948,7 +948,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@example.com', 'local_part' => 'ebay', 'domain' => 'example.com', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -966,13 +966,13 @@ class ReceiveEmailTest extends TestCase Mail::assertNothingSent(); $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $username = Username::factory()->create([ 'user_id' => $this->user->id, 'default_recipient_id' => $recipient->id, - 'username' => 'janedoe' + 'username' => 'janedoe', ]); $this->artisan( @@ -984,7 +984,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['janedoe.anonaddy.com'], - '--size' => '559' + '--size' => '559', ] )->assertExitCode(0); @@ -994,7 +994,7 @@ class ReceiveEmailTest extends TestCase 'email' => 'ebay@janedoe.anonaddy.com', 'local_part' => 'ebay', 'domain' => 'janedoe.anonaddy.com', - 'emails_blocked' => 0 + 'emails_blocked' => 0, ]); $this->assertEquals(1, $this->user->aliases()->count()); @@ -1024,7 +1024,7 @@ class ReceiveEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [''], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1346' + '--size' => '1346', ] )->assertExitCode(0); diff --git a/tests/Feature/RegistrationTest.php b/tests/Feature/RegistrationTest.php index adf667a..c62e14b 100644 --- a/tests/Feature/RegistrationTest.php +++ b/tests/Feature/RegistrationTest.php @@ -37,7 +37,7 @@ class RegistrationTest extends TestCase ->assertSessionHasNoErrors(); $this->assertDatabaseHas('usernames', [ - 'username' => 'johndoe' + 'username' => 'johndoe', ]); $user = Username::where('username', 'johndoe')->first()->user; @@ -62,7 +62,7 @@ class RegistrationTest extends TestCase $response->assertSessionHasErrors(['username']); $this->assertDatabaseMissing('users', [ - 'username' => 'Ω' + 'username' => 'Ω', ]); } @@ -106,7 +106,7 @@ class RegistrationTest extends TestCase $response->assertSessionHasErrors(['username']); $this->assertDatabaseMissing('users', [ - 'username' => 'john_doe' + 'username' => 'john_doe', ]); } @@ -123,7 +123,7 @@ class RegistrationTest extends TestCase $response->assertSessionHasErrors(['email']); $this->assertDatabaseMissing('users', [ - 'username' => 'johndoe' + 'username' => 'johndoe', ]); } @@ -134,12 +134,12 @@ class RegistrationTest extends TestCase Recipient::factory()->create([ 'user_id' => $user->id, - 'email' => 'johndoe@example.com' + 'email' => 'johndoe@example.com', ]); Username::factory()->create([ 'user_id' => $user->id, - 'username' => 'johndoe' + 'username' => 'johndoe', ]); $response = $this->post('/register', [ @@ -160,7 +160,7 @@ class RegistrationTest extends TestCase Username::factory()->create([ 'user_id' => $user->id, - 'username' => 'johndoe' + 'username' => 'johndoe', ]); $response = $this->post('/register', [ @@ -188,7 +188,7 @@ class RegistrationTest extends TestCase $response->assertSessionHasErrors(['username']); $this->assertDatabaseMissing('users', [ - 'username' => 'www' + 'username' => 'www', ]); } @@ -206,7 +206,7 @@ class RegistrationTest extends TestCase $response->assertSessionHasErrors(['username']); $this->assertDatabaseMissing('users', [ - 'username' => 'www' + 'username' => 'www', ]); } @@ -226,7 +226,7 @@ class RegistrationTest extends TestCase $response->assertSessionHasErrors(['username']); $this->assertDatabaseMissing('users', [ - 'username' => 'johndoe' + 'username' => 'johndoe', ]); } @@ -246,7 +246,7 @@ class RegistrationTest extends TestCase $response->assertSessionHasErrors(['username']); $this->assertDatabaseMissing('users', [ - 'username' => 'johndoe' + 'username' => 'johndoe', ]); } } diff --git a/tests/Feature/ReplyToEmailTest.php b/tests/Feature/ReplyToEmailTest.php index 6c42079..f46d5b2 100644 --- a/tests/Feature/ReplyToEmailTest.php +++ b/tests/Feature/ReplyToEmailTest.php @@ -55,7 +55,7 @@ class ReplyToEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [$extension], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -81,7 +81,7 @@ class ReplyToEmailTest extends TestCase ]); $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $this->user->email_verified_at = null; @@ -101,7 +101,7 @@ class ReplyToEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [$extension], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -136,12 +136,12 @@ class ReplyToEmailTest extends TestCase '--sender' => $this->user->email, '--recipient' => [ 'ebay+'.$extension1.'@johndoe.anonaddy.com', - 'ebay+'.$extension2.'@johndoe.anonaddy.com' + 'ebay+'.$extension2.'@johndoe.anonaddy.com', ], '--local_part' => ['ebay', 'ebay'], '--extension' => [$extension1, $extension2], '--domain' => ['johndoe.anonaddy.com', 'johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); diff --git a/tests/Feature/SendFromEmailTest.php b/tests/Feature/SendFromEmailTest.php index e8216b1..221d896 100644 --- a/tests/Feature/SendFromEmailTest.php +++ b/tests/Feature/SendFromEmailTest.php @@ -54,7 +54,7 @@ class SendFromEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [$extension], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -89,12 +89,12 @@ class SendFromEmailTest extends TestCase '--sender' => $this->user->email, '--recipient' => [ 'ebay+'.$extension1.'@johndoe.anonaddy.com', - 'ebay+'.$extension2.'@johndoe.anonaddy.com' + 'ebay+'.$extension2.'@johndoe.anonaddy.com', ], '--local_part' => ['ebay', 'ebay'], '--extension' => [$extension1, $extension2], '--domain' => ['johndoe.anonaddy.com', 'johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); @@ -119,7 +119,7 @@ class SendFromEmailTest extends TestCase $extension = 'contact=ebay.com'; $this->assertDatabaseMissing('aliases', [ - 'email' => 'ebay@johndoe.anonaddy.com' + 'email' => 'ebay@johndoe.anonaddy.com', ]); $this->artisan( @@ -131,7 +131,7 @@ class SendFromEmailTest extends TestCase '--local_part' => ['ebay'], '--extension' => [$extension], '--domain' => ['johndoe.anonaddy.com'], - '--size' => '1000' + '--size' => '1000', ] )->assertExitCode(0); diff --git a/tests/Feature/SettingsTest.php b/tests/Feature/SettingsTest.php index 9ca61a9..fae5144 100644 --- a/tests/Feature/SettingsTest.php +++ b/tests/Feature/SettingsTest.php @@ -38,19 +38,19 @@ class SettingsTest extends TestCase public function user_can_update_default_recipient() { $newDefaultRecipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $this->assertNotEquals($this->user->default_recipient_id, $newDefaultRecipient->id); $response = $this->post('/settings/default-recipient', [ - 'default_recipient' => $newDefaultRecipient->id + 'default_recipient' => $newDefaultRecipient->id, ]); $response->assertStatus(302); $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'default_recipient_id' => $newDefaultRecipient->id + 'default_recipient_id' => $newDefaultRecipient->id, ]); } @@ -59,13 +59,13 @@ class SettingsTest extends TestCase { $newDefaultRecipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); $this->assertNotEquals($this->user->default_recipient_id, $newDefaultRecipient->id); $response = $this->post('/settings/default-recipient', [ - 'default_recipient' => $newDefaultRecipient->id + 'default_recipient' => $newDefaultRecipient->id, ]); $response->assertStatus(404); @@ -78,13 +78,13 @@ class SettingsTest extends TestCase $defaultAliasDomain = $this->user->username.'.anonaddy.me'; $response = $this->post('/settings/default-alias-domain', [ - 'domain' => $defaultAliasDomain + 'domain' => $defaultAliasDomain, ]); $response->assertStatus(302); $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'default_alias_domain' => $defaultAliasDomain + 'default_alias_domain' => $defaultAliasDomain, ]); } @@ -92,14 +92,14 @@ class SettingsTest extends TestCase public function user_cannot_update_default_alias_domain_if_invalid() { $response = $this->post('/settings/default-alias-domain', [ - 'domain' => 'invalid.anonaddy.me' + 'domain' => 'invalid.anonaddy.me', ]); $response->assertStatus(302); $response->assertSessionHasErrors(['domain']); $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'default_alias_domain' => null + 'default_alias_domain' => null, ]); } @@ -109,13 +109,13 @@ class SettingsTest extends TestCase $defaultAliasFormat = 'random_words'; $response = $this->post('/settings/default-alias-format', [ - 'format' => $defaultAliasFormat + 'format' => $defaultAliasFormat, ]); $response->assertStatus(302); $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'default_alias_format' => $defaultAliasFormat + 'default_alias_format' => $defaultAliasFormat, ]); } @@ -123,14 +123,14 @@ class SettingsTest extends TestCase public function user_cannot_update_default_alias_format_if_invalid() { $response = $this->post('/settings/default-alias-format', [ - 'format' => 'invalid_format' + 'format' => 'invalid_format', ]); $response->assertStatus(302); $response->assertSessionHasErrors(['format']); $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'default_alias_format' => null + 'default_alias_format' => null, ]); } @@ -140,7 +140,7 @@ class SettingsTest extends TestCase $this->assertNull($this->user->from_name); $response = $this->post('/settings/from-name', [ - 'from_name' => 'John Doe' + 'from_name' => 'John Doe', ]); $response->assertStatus(302); @@ -153,7 +153,7 @@ class SettingsTest extends TestCase $this->assertNull($this->user->from_name); $response = $this->post('/settings/from-name', [ - 'from_name' => '' + 'from_name' => '', ]); $response->assertStatus(302); @@ -166,7 +166,7 @@ class SettingsTest extends TestCase $this->assertNull($this->user->email_subject); $response = $this->post('/settings/email-subject', [ - 'email_subject' => 'The subject' + 'email_subject' => 'The subject', ]); $response->assertStatus(302); @@ -179,7 +179,7 @@ class SettingsTest extends TestCase $this->assertNull($this->user->email_subject); $response = $this->post('/settings/email-subject', [ - 'email_subject' => '' + 'email_subject' => '', ]); $response->assertStatus(302); @@ -192,7 +192,7 @@ class SettingsTest extends TestCase $this->assertEquals('top', $this->user->banner_location); $response = $this->post('/settings/banner-location', [ - 'banner_location' => 'bottom' + 'banner_location' => 'bottom', ]); $response->assertStatus(302); @@ -205,7 +205,7 @@ class SettingsTest extends TestCase $this->assertEquals('top', $this->user->banner_location); $response = $this->post('/settings/banner-location', [ - 'banner_location' => 'side' + 'banner_location' => 'side', ]); $response->assertStatus(302); @@ -220,7 +220,7 @@ class SettingsTest extends TestCase $this->assertFalse($this->user->use_reply_to); $response = $this->post('/settings/use-reply-to/', [ - 'use_reply_to' => true + 'use_reply_to' => true, ]); $response->assertStatus(302); @@ -235,7 +235,7 @@ class SettingsTest extends TestCase $this->assertTrue($this->user->use_reply_to); $response = $this->post('/settings/use-reply-to/', [ - 'use_reply_to' => false + 'use_reply_to' => false, ]); $response->assertStatus(302); @@ -246,7 +246,7 @@ class SettingsTest extends TestCase public function user_can_generate_new_backup_code() { $this->user->update([ - 'two_factor_backup_code' => bcrypt(Str::random(40)) + 'two_factor_backup_code' => bcrypt(Str::random(40)), ]); $currentBackupCode = $this->user->two_factor_backup_code; @@ -267,12 +267,12 @@ class SettingsTest extends TestCase $this->user->update(['password' => Hash::make('mypassword')]); - if (!Hash::check('mypassword', $this->user->password)) { + if (! Hash::check('mypassword', $this->user->password)) { $this->fail('Password does not match'); } $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $uuidAlias = Alias::factory()->create([ @@ -283,42 +283,41 @@ class SettingsTest extends TestCase 'emails_forwarded' => 10, 'emails_blocked' => 1, 'emails_replied' => 2, - 'emails_sent' => 3 + 'emails_sent' => 3, ]); $uuidAlias->update(['local_part' => $uuidAlias->id]); - $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipient + 'recipient' => $recipient, ]); $domain = Domain::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $aliasWithCustomDomain = Alias::factory()->create([ 'user_id' => $this->user->id, 'aliasable_id' => $domain->id, - 'aliasable_type' => 'App\Models\Domain' + 'aliasable_type' => 'App\Models\Domain', ]); $username = Username::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $aliasWithUsername = Alias::factory()->create([ 'user_id' => $this->user->id, 'aliasable_id' => $username->id, - 'aliasable_type' => 'App\Models\Username' + 'aliasable_type' => 'App\Models\Username', ]); $response = $this->post('/settings/account', [ - 'current_password_delete' => 'mypassword' + 'current_password_delete' => 'mypassword', ]); $response->assertRedirect('/login'); @@ -335,7 +334,7 @@ class SettingsTest extends TestCase $this->assertDatabaseMissing('aliases', [ 'id' => $alias->id, - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $this->assertDatabaseHas('aliases', [ @@ -347,21 +346,21 @@ class SettingsTest extends TestCase 'emails_blocked' => 0, 'emails_replied' => 0, 'emails_sent' => 0, - 'deleted_at' => now() + 'deleted_at' => now(), ]); $this->assertDatabaseMissing('aliases', [ 'id' => $aliasWithCustomDomain->id, 'user_id' => $this->user->id, 'aliasable_id' => $domain->id, - 'aliasable_type' => 'App\Models\Domain' + 'aliasable_type' => 'App\Models\Domain', ]); $this->assertDatabaseMissing('aliases', [ 'id' => $aliasWithUsername->id, 'user_id' => $this->user->id, 'aliasable_id' => $username->id, - 'aliasable_type' => 'App\Models\Username' + 'aliasable_type' => 'App\Models\Username', ]); $this->assertDatabaseMissing('recipients', [ @@ -376,7 +375,7 @@ class SettingsTest extends TestCase $this->assertDatabaseMissing('usernames', [ 'id' => $username->id, - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $this->assertEquals(DeletedUsername::first()->username, $this->user->username); @@ -390,12 +389,12 @@ class SettingsTest extends TestCase $this->user->update(['password' => Hash::make('mypassword')]); - if (!Hash::check('mypassword', $this->user->password)) { + if (! Hash::check('mypassword', $this->user->password)) { $this->fail('Password does not match'); } $response = $this->post('/settings/account', [ - 'current_password_delete' => 'wrongpassword' + 'current_password_delete' => 'wrongpassword', ]); $response->assertStatus(302); @@ -404,29 +403,29 @@ class SettingsTest extends TestCase $this->assertNull(DeletedUsername::first()); $this->assertDatabaseHas('users', [ - 'id' => $this->user->id + 'id' => $this->user->id, ]); $this->assertDatabaseHas('usernames', [ - 'username' => $this->user->username + 'username' => $this->user->username, ]); } /** - * @test - */ + * @test + */ public function user_can_download_aliases_export() { Excel::fake(); Alias::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); Alias::factory()->create([ 'user_id' => $this->user->id, 'deleted_at' => now(), - 'active' => false + 'active' => false, ]); Alias::factory()->create(); @@ -436,6 +435,7 @@ class SettingsTest extends TestCase Excel::assertDownloaded('aliases-'.now()->toDateString().'.csv', function (AliasesExport $export) { $this->assertCount(4, $export->collection()); + return $export->collection()->contains(function ($alias) { return $alias['user_id'] === $this->user->id; }); diff --git a/tests/Feature/ShowAliasesTest.php b/tests/Feature/ShowAliasesTest.php index 3364f04..870b682 100644 --- a/tests/Feature/ShowAliasesTest.php +++ b/tests/Feature/ShowAliasesTest.php @@ -29,7 +29,7 @@ class ShowAliasesTest extends TestCase { // Arrange $aliases = Alias::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); // Act @@ -47,15 +47,15 @@ class ShowAliasesTest extends TestCase // Arrange $a = Alias::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(15) + 'created_at' => Carbon::now()->subDays(15), ]); $b = Alias::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(5) + 'created_at' => Carbon::now()->subDays(5), ]); $c = Alias::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(10) + 'created_at' => Carbon::now()->subDays(10), ]); // Act @@ -73,12 +73,12 @@ class ShowAliasesTest extends TestCase public function deleted_aliases_are_not_listed() { Alias::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); Alias::factory()->count(2)->create([ 'user_id' => $this->user->id, - 'deleted_at' => Carbon::now()->subDays(5) + 'deleted_at' => Carbon::now()->subDays(5), ]); $response = $this->get('/'); @@ -91,16 +91,16 @@ class ShowAliasesTest extends TestCase public function aliases_are_listed_with_recipients() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $aliasRecipient = AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipient + 'recipient' => $recipient, ]); $response = $this->get('/'); @@ -114,26 +114,26 @@ class ShowAliasesTest extends TestCase public function aliases_are_listed_with_only_verified_recipient_options() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $unverifiedRecipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); $aliasRecipient = AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipient + 'recipient' => $recipient, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $unverifiedRecipient + 'recipient' => $unverifiedRecipient, ]); $response = $this->get('/'); diff --git a/tests/Feature/ShowDomainsTest.php b/tests/Feature/ShowDomainsTest.php index 73bb540..f050559 100644 --- a/tests/Feature/ShowDomainsTest.php +++ b/tests/Feature/ShowDomainsTest.php @@ -26,7 +26,7 @@ class ShowDomainsTest extends TestCase public function user_can_view_domains_from_the_domains_page() { $domains = Domain::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->get('/domains'); @@ -41,15 +41,15 @@ class ShowDomainsTest extends TestCase { $a = Domain::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(15) + 'created_at' => Carbon::now()->subDays(15), ]); $b = Domain::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(5) + 'created_at' => Carbon::now()->subDays(5), ]); $c = Domain::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(10) + 'created_at' => Carbon::now()->subDays(10), ]); $response = $this->get('/domains'); @@ -66,7 +66,7 @@ class ShowDomainsTest extends TestCase { $domain = Domain::factory()->create([ 'user_id' => $this->user->id, - 'domain' => 'example.com' + 'domain' => 'example.com', ]); $response = $this->get('/domains/'.$domain->id.'/check-sending'); diff --git a/tests/Feature/ShowFailedDeliveriesTest.php b/tests/Feature/ShowFailedDeliveriesTest.php index d581989..f3fd537 100644 --- a/tests/Feature/ShowFailedDeliveriesTest.php +++ b/tests/Feature/ShowFailedDeliveriesTest.php @@ -29,7 +29,7 @@ class ShowFailedDeliveriesTest extends TestCase public function user_can_view_failed_deliveries_from_the_failed_deliveries_page() { $failedDeliveries = FailedDelivery::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->get('/failed-deliveries'); @@ -44,15 +44,15 @@ class ShowFailedDeliveriesTest extends TestCase { $a = FailedDelivery::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(15) + 'created_at' => Carbon::now()->subDays(15), ]); $b = FailedDelivery::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(5) + 'created_at' => Carbon::now()->subDays(5), ]); $c = FailedDelivery::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(10) + 'created_at' => Carbon::now()->subDays(10), ]); $response = $this->get('/failed-deliveries'); diff --git a/tests/Feature/ShowRecipientsTest.php b/tests/Feature/ShowRecipientsTest.php index 20c9d86..eb2a44e 100644 --- a/tests/Feature/ShowRecipientsTest.php +++ b/tests/Feature/ShowRecipientsTest.php @@ -33,7 +33,7 @@ class ShowRecipientsTest extends TestCase public function user_can_view_recipients_from_the_recipients_page() { $recipients = Recipient::factory()->count(5)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->get('/recipients'); @@ -48,15 +48,15 @@ class ShowRecipientsTest extends TestCase { $a = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(15) + 'created_at' => Carbon::now()->subDays(15), ]); $b = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(5) + 'created_at' => Carbon::now()->subDays(5), ]); $c = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(10) + 'created_at' => Carbon::now()->subDays(10), ]); $response = $this->get('/recipients'); @@ -72,14 +72,14 @@ class ShowRecipientsTest extends TestCase public function recipients_are_listed_with_aliases_count() { $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); Alias::factory()->count(3)->create(['user_id' => $this->user->id]) ->each(function ($alias) use ($recipient) { AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipient + 'recipient' => $recipient, ]); }); @@ -99,11 +99,11 @@ class ShowRecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); $response = $this->json('POST', '/recipients/email/resend', [ - 'recipient_id' => $recipient->id + 'recipient_id' => $recipient->id, ]); $response->assertStatus(200); @@ -119,7 +119,7 @@ class ShowRecipientsTest extends TestCase { $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); $this->assertNull($recipient->refresh()->email_verified_at); @@ -151,11 +151,11 @@ class ShowRecipientsTest extends TestCase $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); $response = $this->json('POST', '/recipients/email/resend', [ - 'recipient_id' => $recipient->id + 'recipient_id' => $recipient->id, ]); $response->assertStatus(200); @@ -166,7 +166,7 @@ class ShowRecipientsTest extends TestCase ); $response2 = $this->json('POST', '/recipients/email/resend', [ - 'recipient_id' => $recipient->id + 'recipient_id' => $recipient->id, ]); $response2->assertStatus(429); diff --git a/tests/Feature/ShowUsernamesTest.php b/tests/Feature/ShowUsernamesTest.php index d9fdbce..ee16b80 100644 --- a/tests/Feature/ShowUsernamesTest.php +++ b/tests/Feature/ShowUsernamesTest.php @@ -26,7 +26,7 @@ class ShowUsernamesTest extends TestCase public function user_can_view_usernames_from_the_usernames_page() { $usernames = Username::factory()->count(3)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $response = $this->get('/usernames'); @@ -41,15 +41,15 @@ class ShowUsernamesTest extends TestCase { $a = Username::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(15) + 'created_at' => Carbon::now()->subDays(15), ]); $b = Username::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(5) + 'created_at' => Carbon::now()->subDays(5), ]); $c = Username::factory()->create([ 'user_id' => $this->user->id, - 'created_at' => Carbon::now()->subDays(10) + 'created_at' => Carbon::now()->subDays(10), ]); $response = $this->get('/usernames'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 200fdee..075ec0f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -21,8 +21,8 @@ abstract class TestCase extends BaseTestCase 'anonaddy.limit' => 1000, 'anonaddy.additional_username_limit' => 3, 'anonaddy.domain' => 'anonaddy.com', - 'anonaddy.all_domains' => ['anonaddy.com','anonaddy.me'], - 'anonaddy.dkim_signing_key' => file_get_contents(base_path('tests/keys/TestDkimSigningKey')) + 'anonaddy.all_domains' => ['anonaddy.com', 'anonaddy.me'], + 'anonaddy.dkim_signing_key' => file_get_contents(base_path('tests/keys/TestDkimSigningKey')), ]); //$this->withoutExceptionHandling(); diff --git a/tests/Unit/AliasTest.php b/tests/Unit/AliasTest.php index 174fbbb..d606196 100644 --- a/tests/Unit/AliasTest.php +++ b/tests/Unit/AliasTest.php @@ -27,26 +27,26 @@ class AliasTest extends TestCase public function alias_can_get_verified_recipients() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $verifiedRecipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $unverifiedRecipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email_verified_at' => null + 'email_verified_at' => null, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $verifiedRecipient + 'recipient' => $verifiedRecipient, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $unverifiedRecipient + 'recipient' => $unverifiedRecipient, ]); $this->assertCount(2, $alias->recipients); @@ -58,12 +58,12 @@ class AliasTest extends TestCase public function alias_can_set_default_recipient_email() { Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'default@example.com' + 'email' => 'default@example.com', ]); $this->user->defaultRecipient = $recipient; @@ -76,12 +76,12 @@ class AliasTest extends TestCase public function alias_can_get_default_recipient_email() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipient = Recipient::factory()->create([ 'user_id' => $this->user->id, - 'email' => 'default@example.com' + 'email' => 'default@example.com', ]); $this->user->defaultRecipient = $recipient; @@ -98,35 +98,35 @@ class AliasTest extends TestCase public function alias_can_get_verified_recipients_or_default() { $alias = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $recipientOne = Recipient::factory()->create([ 'user_id' => $this->user->id, 'email' => 'one@example.com', 'should_encrypt' => true, - 'fingerprint' => 'ABCDE' + 'fingerprint' => 'ABCDE', ]); $recipientTwo = Recipient::factory()->create([ 'user_id' => $this->user->id, 'email' => 'two@example.com', 'should_encrypt' => true, - 'fingerprint' => 'ABCDE' + 'fingerprint' => 'ABCDE', ]); $recipientThree = Recipient::factory()->create([ 'user_id' => $this->user->id, 'email' => 'three@example.com', 'should_encrypt' => false, - 'fingerprint' => 'ABCDE' + 'fingerprint' => 'ABCDE', ]); $recipientFour = Recipient::factory()->create([ 'user_id' => $this->user->id, 'email' => 'four@example.com', 'should_encrypt' => true, - 'fingerprint' => null + 'fingerprint' => null, ]); $recipientFive = Recipient::factory()->create([ @@ -134,32 +134,32 @@ class AliasTest extends TestCase 'email' => 'five@example.com', 'should_encrypt' => false, 'fingerprint' => null, - 'email_verified_at' => null + 'email_verified_at' => null, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipientOne + 'recipient' => $recipientOne, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipientTwo + 'recipient' => $recipientTwo, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipientThree + 'recipient' => $recipientThree, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipientFour + 'recipient' => $recipientFour, ]); AliasRecipient::create([ 'alias' => $alias, - 'recipient' => $recipientFive + 'recipient' => $recipientFive, ]); $this->assertCount(4, $alias->verifiedRecipientsOrDefault()); diff --git a/tests/Unit/UserTest.php b/tests/Unit/UserTest.php index a95b2f1..1ada553 100644 --- a/tests/Unit/UserTest.php +++ b/tests/Unit/UserTest.php @@ -30,7 +30,7 @@ class UserTest extends TestCase public function user_can_get_aliases_from_relationship() { $aliases = Alias::factory()->count(10)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $aliases->assertEquals($this->user->aliases); @@ -40,7 +40,7 @@ class UserTest extends TestCase public function user_can_only_get_their_own_aliases_from_relationship() { $aliases = Alias::factory()->count(5)->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); Alias::factory()->count(10)->create(); @@ -53,19 +53,19 @@ class UserTest extends TestCase { Alias::factory()->create([ 'user_id' => $this->user->id, - 'emails_forwarded' => 5 + 'emails_forwarded' => 5, ]); Alias::factory()->create([ 'user_id' => $this->user->id, 'emails_forwarded' => 3, - 'deleted_at' => now() + 'deleted_at' => now(), ]); Alias::factory()->create([ 'user_id' => $this->user->id, 'emails_forwarded' => 2, - 'active' => false + 'active' => false, ]); $this->assertEquals(10, $this->user->totalEmailsForwarded()); @@ -76,19 +76,19 @@ class UserTest extends TestCase { Alias::factory()->create([ 'user_id' => $this->user->id, - 'emails_blocked' => 3 + 'emails_blocked' => 3, ]); Alias::factory()->create([ 'user_id' => $this->user->id, 'emails_blocked' => 4, - 'deleted_at' => now() + 'deleted_at' => now(), ]); Alias::factory()->create([ 'user_id' => $this->user->id, 'emails_blocked' => 1, - 'active' => false + 'active' => false, ]); $this->assertEquals(8, $this->user->totalEmailsBlocked()); @@ -99,19 +99,19 @@ class UserTest extends TestCase { Alias::factory()->create([ 'user_id' => $this->user->id, - 'emails_replied' => 2 + 'emails_replied' => 2, ]); Alias::factory()->create([ 'user_id' => $this->user->id, 'emails_replied' => 4, - 'deleted_at' => now() + 'deleted_at' => now(), ]); Alias::factory()->create([ 'user_id' => $this->user->id, 'emails_replied' => 1, - 'active' => false + 'active' => false, ]); $this->assertEquals(7, $this->user->totalEmailsReplied()); @@ -121,30 +121,30 @@ class UserTest extends TestCase public function user_can_get_aliases_using_default_recipient() { $recipient = Recipient::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); $aliasNotUsingDefault = Alias::factory()->create([ - 'user_id' => $this->user->id + 'user_id' => $this->user->id, ]); AliasRecipient::create([ 'alias' => $aliasNotUsingDefault, - 'recipient' => $recipient - ]); - - Alias::factory()->create([ - 'user_id' => $this->user->id + 'recipient' => $recipient, ]); Alias::factory()->create([ 'user_id' => $this->user->id, - 'deleted_at' => now() ]); Alias::factory()->create([ 'user_id' => $this->user->id, - 'active' => false + 'deleted_at' => now(), + ]); + + Alias::factory()->create([ + 'user_id' => $this->user->id, + 'active' => false, ]); $this->assertCount(2, $this->user->aliasesUsingDefault); @@ -158,7 +158,7 @@ class UserTest extends TestCase $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'bandwidth' => 10485760 + 'bandwidth' => 10485760, ]); $this->assertEquals(10, $this->user->bandwidth_mb); @@ -171,7 +171,7 @@ class UserTest extends TestCase $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'bandwidth' => 7324019 + 'bandwidth' => 7324019, ]); $this->assertEquals(6.98, $this->user->bandwidth_mb); @@ -190,7 +190,7 @@ class UserTest extends TestCase $this->assertDatabaseHas('users', [ 'id' => $this->user->id, - 'bandwidth' => 100943820 + 'bandwidth' => 100943820, ]); $this->assertTrue($this->user->nearBandwidthLimit());