Completed
Push — master ( 6ebd1c...df9bae )
by John
10:14
created

Fixer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fix() 0 8 2
A chain() 0 6 1
process() 0 1 ?
1
<?php
2
/*
3
 * This file is part of the KleijnWeb\SwaggerBundle 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
9
namespace KleijnWeb\SwaggerBundle\Dev\DocumentFixer;
10
11
use KleijnWeb\SwaggerBundle\Document\SwaggerDocument;
12
13
abstract class Fixer
14
{
15
    /**
16
     * @var Fixer
17
     */
18
    private $next;
19
20
    /**
21
     * @param SwaggerDocument $document
22
     */
23
    public function fix(SwaggerDocument $document)
24
    {
25
        $this->process($document);
26
27
        if ($this->next) {
28
            $this->next->fix($document);
29
        }
30
    }
31
32
    /**
33
     * @param Fixer $next
34
     *
35
     * @return $this
36
     */
37
    public function chain(Fixer $next)
38
    {
39
        $this->next = $next;
40
41
        return $this;
42
    }
43
44
    /**
45
     * @param SwaggerDocument $document
46
     *
47
     * @return void
48
     */
49
    abstract public function process(SwaggerDocument $document);
50
}
51