Completed
Push — 1.x ( ee8545...084efb )
by Joel
02:48
created

BuildStream   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A readFrame() 0 16 3
1
<?php
2
3
namespace Docker\Stream;
4
5
/**
6
 * Represent a stream when building a dockerfile
7
 *
8
 * Callable(s) passed to this stream will take a BuildFrame object as the first argument
9
 */
10
class BuildStream extends MultiJsonStream
11
{
12
    /**
13
     * {@inheritdoc}
14
     *
15
     * @return BuildFrame|null
16
     */
17
    protected function readFrame()
18
    {
19
        $frame = parent::readFrame();
20
21
        if ($frame === null) {
22
            return null;
23
        }
24
25
        $buildFrame = new BuildFrame();
26
27
        if (isset($frame->stream)) {
28
            $buildFrame->setStream($frame->stream);
29
        }
30
31
        return $buildFrame;
32
    }
33
}
34