GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

PurgeController::startPurge()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.6
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
4
5
namespace Katten\Purge\Controllers;
6
7
8
use Katten\Purge\Purger;
9
use Katten\Purge\Factory\DomFactory;
10
use Katten\Purge\Factory\BlockHashTableFactory;
11
use Sabberworm\CSS\CSSList\Document;
12
use Symfony\Component\Console\Output\OutputInterface;
13
14
15
16
17
class PurgeController {
18
  
19
    
20
    private $output;
21
    
22
    
23
    private $purger;
24
    
25
    
26
    
27
    public function __construct(Document $css, OutputInterface $output) {
28
        
29
        $this->output = $output;
30
        
31
        $this->purger = new Purger(BlockHashTableFactory::build($css));
32
    }
33
    
34
35
36
    /**
37
     * Loop through available HTML files and run
38
     * purge against them
39
     * 
40
     * @param array $html
41
     */ 
42
    public function startPurge(array $html) {
43
        
44
        $i = 1;
45
        $total = count($html);
46
            
47
        
48
        foreach ($html as $value) {
49
            $this->output->write("Loading HTML file ($i/$total)");
50
            $dom = DomFactory::build($value);
51
            $this->output->writeln(" [<info>OK</info>]");
52
            
53
            $this->output->write("Purging CSS from HTML file ($i/$total)");
54
            $this->purger->purge($dom);
55
            $this->output->writeln(" [<info>OK</info>]");
56
            
57
            $i++;
58
        }
59
        
60
        $this->output->writeln("Purge Successfully Completed!\n");
61
    }
62
    
63
    
64
    
65
    public function getPurgeResults() {
66
        
67
        return $this->purger->getPurgedCss();
68
    }
69
        
70
    
71
72
}
73