Test Failed
Push — master ( b17eba...69b436 )
by Kirill
06:37
created

Builder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 24
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A nothing() 0 6 2
A extractResult() 0 6 1
1
<?php
2
/**
3
 * This file is part of Hydrogen package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace RDS\Hydrogen\Processor\DatabaseProcessor;
11
12
use RDS\Hydrogen\Processor\BuilderInterface;
13
14
/**
15
 * Class Builder
16
 */
17
abstract class Builder implements BuilderInterface
18
{
19
    /**
20
     * @return \Generator
21
     */
22
    protected function nothing(): \Generator
23
    {
24
        if (false) {
25
            yield;
26
        }
27
    }
28
29
    /**
30
     * @param \Generator $generator
31
     * @param \Closure $then
32
     * @return \Generator
33
     */
34
    protected function extractResult(\Generator $generator, \Closure $then): \Generator
35
    {
36
        yield from $generator;
37
38
        $then($generator->getReturn());
39
    }
40
}
41