Limits   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A xmlDeserialize() 0 16 3
1
<?php
2
3
namespace Xdaysaysay\CoreBundle\XmlMapping;
4
5
use Sabre\Xml\Element\KeyValue;
6
use Sabre\Xml\Reader;
7
use Sabre\Xml\XmlDeserializable;
8
9
class Limits implements XmlDeserializable
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    public $minspeed;
12
    public $maxspeed;
13
14
    public static function xmlDeserialize(Reader $reader)
15
    {
16
        $idlequeue = new self();
17
18
        // Borrowing a parser from the KeyValue class.
19
        $keyValue = KeyValue::xmlDeserialize($reader);
20
21
        if (isset($keyValue['{}minspeed'])) {
22
            $idlequeue->minspeed = $keyValue['{}minspeed'];
23
        }
24
        if (isset($keyValue['{}maxspeed'])) {
25
            $idlequeue->maxspeed = $keyValue['{}maxspeed'];
26
        }
27
28
        return $idlequeue;
29
    }
30
31
}