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

codeigniter4 / CodeIgniter4 / 8677009716

13 Apr 2024 11:45PM UTC coverage: 84.44% (-2.2%) from 86.607%
8677009716

push

github

web-flow
Merge pull request #8776 from kenjis/fix-findQualifiedNameFromPath-Cannot-declare-class-v3

fix: Cannot declare class CodeIgniter\Config\Services, because the name is already in use

0 of 3 new or added lines in 1 file covered. (0.0%)

478 existing lines in 72 files now uncovered.

20318 of 24062 relevant lines covered (84.44%)

188.23 hits per line

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

90.0
/system/Security/Exceptions/SecurityException.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter 4 framework.
7
 *
8
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
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 CodeIgniter\Security\Exceptions;
15

16
use CodeIgniter\Exceptions\FrameworkException;
17
use CodeIgniter\Exceptions\HTTPExceptionInterface;
18

19
class SecurityException extends FrameworkException implements HTTPExceptionInterface
20
{
21
    /**
22
     * Throws when some specific action is not allowed.
23
     *
24
     * @return static
25
     */
26
    public static function forDisallowedAction()
27
    {
28
        return new static(lang('Security.disallowedAction'), 403);
15✔
29
    }
30

31
    /**
32
     * Throws when the source string contains invalid UTF-8 characters.
33
     *
34
     * @param string $source The source string
35
     * @param string $string The invalid string
36
     *
37
     * @return static
38
     */
39
    public static function forInvalidUTF8Chars(string $source, string $string)
40
    {
41
        return new static(
1✔
42
            'Invalid UTF-8 characters in ' . $source . ': ' . $string,
1✔
43
            400
1✔
44
        );
1✔
45
    }
46

47
    /**
48
     * Throws when the source string contains invalid control characters.
49
     *
50
     * @param string $source The source string
51
     * @param string $string The invalid string
52
     *
53
     * @return static
54
     */
55
    public static function forInvalidControlChars(string $source, string $string)
56
    {
57
        return new static(
3✔
58
            'Invalid Control characters in ' . $source . ': ' . $string,
3✔
59
            400
3✔
60
        );
3✔
61
    }
62

63
    /**
64
     * @deprecated Use `CookieException::forInvalidSameSite()` instead.
65
     *
66
     * @codeCoverageIgnore
67
     *
68
     * @return static
69
     */
70
    public static function forInvalidSameSite(string $samesite)
71
    {
UNCOV
72
        return new static(lang('Security.invalidSameSite', [$samesite]));
×
73
    }
74
}
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

© 2025 Coveralls, Inc