Passed
Push — master ( cad03c...008588 )
by Marc
02:28
created

FbpDefinition::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the phpflo\phpflo-fbp package.
4
 *
5
 * (c) Marc Aschmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace PhpFlo\Fbp;
12
13
use PhpFlo\Common\DefinitionInterface;
14
use PhpFlo\Common\FbpDefinitionsInterface;
15
16
/**
17
 * Class FbpDefinition
18
 *
19
 * @package PhpFlo\Fbp
20
 * @author Marc Aschmann <[email protected]>
21
 */
22
class FbpDefinition implements DefinitionInterface, FbpDefinitionsInterface
23
{
24
    /**
25
     * @var array
26
     */
27
    private $schema;
28
29
    public function __construct()
30
    {
31
        $this->schema = [
32
            self::PROPERTIES_LABEL => [
33
                'name' => '',
34
            ],
35
            self::INITIALIZERS_LABEL => [],
36
            self::PROCESSES_LABEL => [],
37
            self::CONNECTIONS_LABEL => [],
38
        ];
39
    }
40
41
    /**
42
     * @return array
43
     */
44
    public function toArray()
45
    {
46
        return $this->schema;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function toJson()
53
    {
54
        return FbpDumper::toJson($this->schema);
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function toYaml()
61
    {
62
        return FbpDumper::toYaml($this->schema);
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function toFbp()
69
    {
70
        return FbpDumper::toFbp($this->schema);
71
    }
72
}
73