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

lmc-eu / matej-client-php / 7527331519

15 Jan 2024 10:11AM UTC coverage: 100.0%. Remained the same
7527331519

Pull #135

github

web-flow
Merge 117257645 into 9666a6254
Pull Request #135: Update to new coding standard

20 of 21 new or added lines in 5 files covered. (95.24%)

400 existing lines in 23 files now uncovered.

758 of 758 relevant lines covered (100.0%)

18.54 hits per line

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

100.0
/src/Exception/AuthorizationException.php
1
<?php declare(strict_types=1);
2

3
namespace Lmc\Matej\Exception;
4

5
use Psr\Http\Message\RequestInterface;
6
use Psr\Http\Message\ResponseInterface;
7

8
/**
9
 * Exception thrown when request authorization fails.
10
 */
11
class AuthorizationException extends RequestException
12
{
13
    public static function fromRequestAndResponse(
14
        RequestInterface $request,
15
        ResponseInterface $response,
16
        \Throwable $previous = null
17
    ): self {
UNCOV
18
        $responseData = json_decode($response->getBody()->getContents());
8✔
19

UNCOV
20
        $message = sprintf(
8✔
UNCOV
21
            'Matej API authorization error for url "%s"%s',
8✔
UNCOV
22
            $request->getRequestTarget(),
8✔
UNCOV
23
            isset($responseData->message) ? ' (' . $responseData->message . ')' : ''
8✔
UNCOV
24
        );
6✔
25

UNCOV
26
        return new self($message, $request, $response, $previous);
8✔
27
    }
28
}
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