Completed
Push — rework ( 30a2d6...381fae )
by Markus
02:34
created

BrowserAllPackagesListHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 23
ccs 0
cts 14
cp 0
rs 10
c 1
b 0
f 0
wmc 2
lcom 1
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 20 2
1
<?php
2
3
namespace SSpkS\Handler;
4
5
use \SSpkS\Output\HtmlOutput;
6
use \SSpkS\Package\PackageFinder;
7
8
class BrowserAllPackagesListHandler extends AbstractHandler
9
{
10
    public function handle()
11
    {
12
        // No architecture, but full list of packages requested --> show simple list
13
        $output = new HtmlOutput($this->config);
14
15
        $pkgs = new PackageFinder($this->config->paths['packages']);
16
        $packagesList = $pkgs->getAllPackageFiles();
17
18
        // Prepare data for template
19
        $packages = array();
20
        foreach ($packagesList as $spkFile) {
21
            $packages[] = array(
22
                'url'      => $this->config->baseUrl . $spkFile,
23
                'filename' => basename($spkFile),
24
            );
25
        }
26
        $output->setVariable('packagelist', $packages);
27
        $output->setTemplate('html_packagelist_all');
28
        $output->output();
29
    }
30
}
31