• 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/Matej.php
1
<?php declare(strict_types=1);
2

3
namespace Lmc\Matej;
4

5
use Http\Client\HttpClient;
6
use Http\Message\MessageFactory;
7
use Lmc\Matej\Http\RequestManager;
8
use Lmc\Matej\Http\ResponseDecoderInterface;
9
use Lmc\Matej\RequestBuilder\RequestBuilderFactory;
10

11
class Matej
12
{
13
    public const CLIENT_ID = 'php-client';
14
    public const VERSION = '4.1.0';
15

16
    /** @var RequestManager */
17
    private $requestManager;
18

19
    public function __construct(string $accountId, string $apiKey)
20
    {
UNCOV
21
        $this->requestManager = new RequestManager($accountId, $apiKey);
12✔
22
    }
3✔
23

24
    public function request(): RequestBuilderFactory
25
    {
UNCOV
26
        return new RequestBuilderFactory($this->getRequestManager());
8✔
27
    }
28

29
    /** @return $this */
30
    public function setHttpClient(HttpClient $client): self
31
    {
UNCOV
32
        $this->getRequestManager()->setHttpClient($client);
8✔
33

UNCOV
34
        return $this;
8✔
35
    }
36

37
    /**
38
     * @internal used mainly in integration tests
39
     * @return $this
40
     */
41
    public function setBaseUrl(string $baseUrl): self
42
    {
UNCOV
43
        $this->getRequestManager()->setBaseUrl($baseUrl);
4✔
44

UNCOV
45
        return $this;
4✔
46
    }
47

48
    /**
49
     * @codeCoverageIgnore
50
     * @return $this
51
     */
52
    public function setHttpMessageFactory(MessageFactory $messageFactory): self
53
    {
54
        $this->getRequestManager()->setMessageFactory($messageFactory);
55

56
        return $this;
57
    }
58

59
    /**
60
     * @codeCoverageIgnore
61
     * @return $this
62
     */
63
    public function setHttpResponseDecoder(ResponseDecoderInterface $responseDecoder): self
64
    {
65
        $this->getRequestManager()->setResponseDecoder($responseDecoder);
66

67
        return $this;
68
    }
69

70
    protected function getRequestManager(): RequestManager
71
    {
UNCOV
72
        return $this->requestManager;
8✔
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

© 2026 Coveralls, Inc