• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daycry / auth / 10060982055

23 Jul 2024 02:35PM UTC coverage: 59.361% (+0.09%) from 59.271%
10060982055

push

github

web-flow
Merge pull request #17 from daycry/development

Fixes

33 of 86 new or added lines in 29 files covered. (38.37%)

2 existing lines in 2 files now uncovered.

1858 of 3130 relevant lines covered (59.36%)

22.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Exceptions/FailTooManyRequestsException.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of Daycry Auth.
7
 *
8
 * (c) Daycry <daycry9@proton.me>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Daycry\Auth\Exceptions;
15

16
use Config\Services;
17
use Daycry\Exceptions\Exceptions\RuntimeException;
18

19
class FailTooManyRequestsException extends RuntimeException
20
{
21
    protected $code           = 429;
22
    public static $authorized = true;
23

24
    public static function forApiKeyLimit(string $key)
25
    {
26
        self::$authorized = false;
×
NEW
27
        $parser           = Services::parser();
×
28

29
        return new self($parser->setData(['key' => $key])->renderString(lang('Auth.textRestApiKeyTimeLimit')));
×
30
    }
31

32
    public static function forInvalidAttemptsLimit()
33
    {
34
        self::$authorized = false;
×
35

36
        return new self(lang('Auth.throttled'));
×
37
    }
38

39
    public static function forIpAddressTimeLimit()
40
    {
41
        self::$authorized = false;
×
42

43
        return new self(lang('Auth.textRestIpAddressTimeLimit'));
×
44
    }
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc