Completed
Push — master ( a3140b...10de85 )
by Kacper
04:29
created

Stream   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 41
rs 10
c 1
b 0
f 1
wmc 5
lcom 0
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setInnerXml() 0 4 1
A setContent() 0 4 1
A appendChild() 0 6 2
1
<?php
2
/**
3
 * Nucleus - XMPP Library for PHP
4
 *
5
 * Copyright (C) 2016, Some rights reserved.
6
 *
7
 * @author Kacper "Kadet" Donat <[email protected]>
8
 *
9
 * Contact with author:
10
 * Xmpp: [email protected]
11
 * E-mail: [email protected]
12
 *
13
 * From Kadet with love.
14
 */
15
16
namespace Kadet\Xmpp\Stream;
17
18
19
use Kadet\Xmpp\Xml\XmlElement;
20
21
class Stream extends XmlElement
22
{
23
    /**
24
     * XmlElement constructor
25
     *
26
     * @param array  $options    {
27
     * @var mixed    $content    Content of element
28
     * @var array    $attributes Element attributes
29
     *                           }
30
     */
31
    public function __construct(array $options)
32
    {
33
        parent::__construct('stream:stream', 'http://etherx.jabber.org/streams', $options);
34
    }
35
36
37
    public function setInnerXml($value)
38
    {
39
        return false;
40
    }
41
42
    public function setContent($value)
43
    {
44
        return false;
45
    }
46
47
    /**
48
     * Appends child to element
49
     *
50
     * @param XmlElement|string $element
51
     *
52
     * @return XmlElement|string Same as $element
53
     */
54
    public function appendChild($element)
55
    {
56
        if ($element instanceof XmlElement) {
57
            $element->parent = $this;
58
        }
59
    }
60
61
}
62