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

jwilsson / spotify-web-api-php / 20206432806

14 Dec 2025 10:12AM UTC coverage: 97.919% (-0.8%) from 98.747%
20206432806

push

github

jwilsson
Fix faulty proxy header detection regex

1 of 1 new or added line in 1 file covered. (100.0%)

11 existing lines in 2 files now uncovered.

753 of 769 relevant lines covered (97.92%)

16.57 hits per line

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

75.0
/src/SpotifyWebAPIException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace SpotifyWebAPI;
6

7
class SpotifyWebAPIException extends \Exception
8
{
9
    public const string TOKEN_EXPIRED = 'The access token expired';
10
    public const int RATE_LIMIT_STATUS = 429;
11

12
    /**
13
     * The reason string from a player request's error object.
14
     *
15
     * @var string
16
     */
17
    private string $reason = '';
18

19
    /**
20
     * Returns the reason string from a player request's error object.
21
     *
22
     * @return string
23
     */
24
    public function getReason(): string
25
    {
26
        return $this->reason;
6✔
27
    }
28

29
    /**
30
     * Returns whether the exception was thrown because of an expired access token.
31
     *
32
     * @return bool
33
     */
34
    public function hasExpiredToken(): bool
35
    {
36
        return $this->getMessage() === self::TOKEN_EXPIRED;
3✔
37
    }
38

39
    /**
40
     * Returns whether the exception was thrown because of rate limiting.
41
     *
42
     * @return bool
43
     */
44
    public function isRateLimited(): bool
45
    {
UNCOV
46
        return $this->getCode() === self::RATE_LIMIT_STATUS;
×
47
    }
48

49
    /**
50
     * Set the reason string.
51
     *
52
     * @param string $reason
53
     *
54
     * @return void
55
     */
56
    public function setReason(string $reason): void
57
    {
58
        $this->reason = $reason;
6✔
59
    }
60
}
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