Passed
Push — master ( 6a517a...47e44f )
by Petr
08:35
created

ComRegistry   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 9
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 4
1
<?php
2
3
namespace kalanis\kw_mapper\Storage\Shared\DotNet;
4
5
6
use \COM;
0 ignored issues
show
Bug introduced by
The type \COM 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
/**
10
 * Class ComRegistry
11
 * @package kalanis\kw_mapper\Storage\Database\Shared\DotNet
12
 * Dummy class for describe methods for accessing registry
13
 * @method string RegRead(string $key)
14
 * @method null RegWrite(string $key, mixed $content, string $type)
15
 * @method null RegDelete(string $key)
16
 * @link https://docs.microsoft.com/en-us/windows/win32/winprog64/accessing-an-alternate-registry-view
17
 * @link https://docs.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-entries?view=powershell-7.1
18
 * @link https://ss64.com/vb/shell.html
19
 * @codeCoverageIgnore do not know for now how to check that
20
 */
21
class ComRegistry extends COM
22
{
23
    /**
24
     * @param string|null $moduleName
25
     * @param string|null $serverName
26
     * @param int|null $codePage
27
     * @param string|null $typeLib
28
     */
29
    public function __construct(?string $moduleName = null, ?string $serverName = null, ?int $codePage = null, ?string $typeLib = null)
30
    {
31
        // @todo: nowhere to find if can be init with an empty values or not - look and change if need
32
        if (!is_null($typeLib)) {
33
            parent::__construct('WScript.Shell', $serverName, $codePage, $typeLib);
34
        } elseif (!is_null($codePage)) {
35
            parent::__construct('WScript.Shell', $serverName, $codePage);
36
        } elseif (!is_null($serverName)) {
37
            parent::__construct('WScript.Shell', $serverName);
38
        } else {
39
            parent::__construct('WScript.Shell');
40
        }
41
    }
42
}
43