WrappedStoreCommand   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 23
ccs 4
cts 8
cp 0.5
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A registerAppendix() 0 3 1
A registerColumn() 0 3 1
A wrapStoreCommand() 0 3 1
A hasData() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\ORM\Command\Special;
6
7
use Cycle\ORM\Command\CommandInterface;
8
use Cycle\ORM\Command\StoreCommandInterface;
9
10
final class WrappedStoreCommand extends WrappedCommand implements StoreCommandInterface
11
{
12
    /** @var StoreCommandInterface */
13
    protected CommandInterface $command;
14
15 152
    public static function wrapStoreCommand(StoreCommandInterface $command): self
16
    {
17 152
        return new self($command);
18
    }
19
20
    public function registerAppendix(string $key, mixed $value): void
21
    {
22
        $this->command->registerAppendix($key, $value);
0 ignored issues
show
Bug introduced by
The method registerAppendix() does not exist on Cycle\ORM\Command\CommandInterface. It seems like you code against a sub-type of Cycle\ORM\Command\CommandInterface such as Cycle\ORM\Command\StoreCommandInterface or Cycle\ORM\Command\StoreCommand or Cycle\ORM\Command\Special\WrappedStoreCommand or Cycle\ORM\Command\Database\Update. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        $this->command->/** @scrutinizer ignore-call */ 
23
                        registerAppendix($key, $value);
Loading history...
23
    }
24
25
    public function registerColumn(string $key, mixed $value): void
26
    {
27
        $this->command->registerColumn($key, $value);
0 ignored issues
show
Bug introduced by
The method registerColumn() does not exist on Cycle\ORM\Command\CommandInterface. It seems like you code against a sub-type of Cycle\ORM\Command\CommandInterface such as Cycle\ORM\Command\StoreCommandInterface or Cycle\ORM\Command\StoreCommand or Cycle\ORM\Command\Special\WrappedStoreCommand or Cycle\ORM\Command\Database\Update. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        $this->command->/** @scrutinizer ignore-call */ 
28
                        registerColumn($key, $value);
Loading history...
28
    }
29
30 168
    public function hasData(): bool
31
    {
32 168
        return $this->command->hasData();
0 ignored issues
show
Bug introduced by
The method hasData() does not exist on Cycle\ORM\Command\CommandInterface. It seems like you code against a sub-type of Cycle\ORM\Command\CommandInterface such as Cycle\ORM\Command\StoreCommandInterface or Cycle\ORM\Command\StoreCommand or Cycle\ORM\Command\Special\WrappedStoreCommand or Cycle\ORM\Command\Database\Update. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

32
        return $this->command->/** @scrutinizer ignore-call */ hasData();
Loading history...
33
    }
34
}
35