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

codeigniter4 / CodeIgniter4 / 11877849301

17 Nov 2024 09:50AM UTC coverage: 84.415% (-0.006%) from 84.421%
11877849301

push

github

web-flow
fix: `DownloadResponse` cache headers (#9237)

* fix: `DownloadResponse` cache headers

* update phpstan-baseline

20404 of 24171 relevant lines covered (84.42%)

189.62 hits per line

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

80.0
/system/Exceptions/DownloadException.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\Exceptions;
15

16
use RuntimeException;
17

18
/**
19
 * Class DownloadException
20
 */
21
class DownloadException extends RuntimeException implements ExceptionInterface
22
{
23
    use DebugTraceableTrait;
24

25
    /**
26
     * @return static
27
     */
28
    public static function forCannotSetFilePath(string $path)
29
    {
30
        return new static(lang('HTTP.cannotSetFilepath', [$path]));
1✔
31
    }
32

33
    /**
34
     * @return static
35
     */
36
    public static function forCannotSetBinary()
37
    {
38
        return new static(lang('HTTP.cannotSetBinary'));
1✔
39
    }
40

41
    /**
42
     * @return static
43
     */
44
    public static function forNotFoundDownloadSource()
45
    {
46
        return new static(lang('HTTP.notFoundDownloadSource'));
1✔
47
    }
48

49
    /**
50
     * @deprecated Since v4.5.6
51
     *
52
     * @return static
53
     */
54
    public static function forCannotSetCache()
55
    {
56
        return new static(lang('HTTP.cannotSetCache'));
×
57
    }
58

59
    /**
60
     * @return static
61
     */
62
    public static function forCannotSetStatusCode(int $code, string $reason)
63
    {
64
        return new static(lang('HTTP.cannotSetStatusCode', [$code, $reason]));
1✔
65
    }
66
}
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