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

Builder::nothing()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
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