Passed
Pull Request — master (#61)
by
unknown
03:32
created

ClientServiceDescription::getSchemaPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Acquia\Hmac\Client;
4
5
use GuzzleHttp\Command\Guzzle\Description;
0 ignored issues
show
Bug introduced by
The type GuzzleHttp\Command\Guzzle\Description was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Webbj74\JSDL\Loader\ServiceDescriptionLoader;
0 ignored issues
show
Bug introduced by
The type Webbj74\JSDL\Loader\ServiceDescriptionLoader was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
/**
9
 * Class ClientServiceDescription.
10
 */
11
class ClientServiceDescription extends Description
12
{
13
14
    /**
15
     * The JSON Schema Path
16
     */
17
    protected $schema_path;
18
19
    /**
20
     * Acquia Client Service descriptions.
21
     *
22
     * Loads the commands available from a service via JSON file located in the
23
     * service SDK.
24
     *
25
     * @param string $schema_path
26
     *   The full path to the JDSL JSON schema being loaded.
27
     *
28
     * @param array $options
29
     *   An array of options to use when configuring the service description.
30
     */
31
    public function __construct(string $schema_path, array $options = [])
32
    {
33
        $this->schema_path = $schema_path;
34
        $loader = new ServiceDescriptionLoader();
35
        $description = $loader->load($this->getSchemaPath());
36
        parent::__construct($description, $options);
37
    }
38
39
    /**
40
     * Returns the path to the file containing the service description schema.
41
     *
42
     * @return string
43
     *   The path to the service description schema file.
44
     */
45
    protected function getSchemaPath(): string
46
    {
47
        return $this->schema_path;
48
    }
49
}
50