RegistryRecord::addEntries()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace kalanis\kw_mapper\Records;
4
5
6
use kalanis\kw_mapper\Interfaces\IEntryType;
7
use kalanis\kw_mapper\Interfaces\IRegistry;
8
use kalanis\kw_mapper\Mappers\Database\WinRegistry;
9
10
11
/**
12
 * Class RegistryRecord
13
 * @package kalanis\kw_mapper\Records
14
 * @property int $part
15
 * @property string $path
16
 * @property string $type
17
 * @property string $content
18
 * @codeCoverageIgnore cannot check this on *nix
19
 */
20
class RegistryRecord extends AStrictRecord
21
{
22
    protected function addEntries(): void
23
    {
24
        $this->addEntry('part', IEntryType::TYPE_SET, [IRegistry::HKEY_CLASSES_ROOT, IRegistry::HKEY_CURRENT_CONFIG, IRegistry::HKEY_CURRENT_USER, IRegistry::HKEY_LOCAL_MACHINE, IRegistry::HKEY_USERS, ]);
25
        $this->addEntry('path', IEntryType::TYPE_STRING, 1024);
26
        $this->addEntry('type', IEntryType::TYPE_SET, [IRegistry::REG_BINARY, IRegistry::REG_DWORD, IRegistry::REG_EXPAND_SZ, IRegistry::REG_MULTI_SZ, IRegistry::REG_NONE, IRegistry::REG_SZ, ]);
27
        $this->addEntry('content', IEntryType::TYPE_STRING, PHP_INT_MAX);
28
        $this->setMapper(WinRegistry::class);
29
    }
30
}
31