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.

HtmlPublisher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 38
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A assembleBook() 0 35 3
1
<?php
2
/*
3
 * This file is part of the trefoil application.
4
 *
5
 * (c) Miguel Angel Gabriel <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Trefoil\Publishers;
12
13
/**
14
 * It publishes the book as a single HTML page. All the internal links
15
 * are transformed into anchors. This means that the generated book can be
16
 * browsed offline or copied under any web server directory.
17
 */
18
class HtmlPublisher extends BasePublisher
19
{
20
    public function assembleBook()
21
    {
22
        // generate easybook CSS file
23
        if ($this->app->edition('include_styles')) {
24
            $this->app->render(
25
                      '@theme/style.css.twig',
26
                      array('resources_dir' => $this->app['app.dir.resources'] . '/'),
27
                      $this->app['publishing.dir.output'] . '/css/easybook.css'
28
            );
29
        }
30
31
        // generate custom CSS file
32
        $customCss = $this->app->getCustomTemplate('style.css');
33
        $hasCustomCss = file_exists($customCss);
34
        if ($hasCustomCss) {
35
            $this->app['filesystem']->copy(
36
                                    $customCss,
37
                                    $this->app['publishing.dir.output'] . '/css/styles.css',
38
                                    true
39
            );
40
        }
41
42
        // implode all the contents to create the whole book
43
        $this->app->render(
44
                  'book.twig',
45
                  array(
46
                      'items'          => $this->app['publishing.items'],
47
                      'has_custom_css' => $hasCustomCss
48
                  ),
49
                  $this->app['publishing.dir.output'] . '/book.html'
50
        );
51
52
        // copy book images
53
        $this->prepareBookImages($this->app['publishing.dir.output'] . '/images');
54
    }
55
}
56