Completed
Push — master ( 5309e4...b64411 )
by Frederick
12s
created

NpmRegistryRepository::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Vanbrabantf\NpmStatFetcher\Repositories;
4
5
use GuzzleHttp\Client;
6
7
class NpmRegistryRepository
8
{
9
    /**
10
     * @var Client
11
     */
12
    private $client;
13
14
    public function __construct(Client $client)
15
    {
16
        $this->client = $client;
17
    }
18
19
    /**
20
     * @param string $path
21
     * @return string
22
     */
23
    public function getResourceByPath(string $path): string
24
    {
25
        $resource =  $this->client->get($path);
26
27
        return $resource->getBody()->getContents();
28
    }
29
}